Skip to content

missing docs: unprivileged_userfaultfd requirement for postcopy#1004

Merged
kubevirt-bot merged 1 commit into
kubevirt:mainfrom
Aseeef:userfaultfd-fix
Jun 11, 2026
Merged

missing docs: unprivileged_userfaultfd requirement for postcopy#1004
kubevirt-bot merged 1 commit into
kubevirt:mainfrom
Aseeef:userfaultfd-fix

Conversation

@Aseeef

@Aseeef Aseeef commented Jun 3, 2026

Copy link
Copy Markdown
Member

What this PR does / why we need it:

On most modern distros, vm.unprivileged_userfaultfd is disabled by default preventing QEMU from capturing page faults during a postcopy migration on the receiving node. However this requirement is currently not documented anywhere.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes kubevirt/kubevirt#17780

Special notes for your reviewer:

Checklist

This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.

Release note:


@kubevirt-bot kubevirt-bot requested review from dhiller and phoracek June 3, 2026 16:57
@Aseeef Aseeef force-pushed the userfaultfd-fix branch from 06037c4 to 3ec5c13 Compare June 3, 2026 17:33
@kubevirt-bot kubevirt-bot added the dco-signoff: yes Indicates the PR's author has DCO signed all their commits. label Jun 3, 2026
@Aseeef Aseeef force-pushed the userfaultfd-fix branch 2 times, most recently from c1de67b to 49205fc Compare June 3, 2026 17:42
Comment thread docs/compute/live_migration.md Outdated
@Aseeef Aseeef force-pushed the userfaultfd-fix branch from 49205fc to 1b7a416 Compare June 4, 2026 15:42

@jean-edouard jean-edouard left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve
/hold
Just a couple comments, feel free to unhold.

post-copy migration:

```
vm.unprivileged_userfaultfd=1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you confirm that this is needed even with the seccomp policy deployed? If so, I don't understand how OpenShift cluster successfully run post-copy migrations today...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is needed. OpenShift clusters successfully runs post-copy because openshift/machine-config-operator#3724 modified the machine config operator to set this setting.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the instructions below to create the MachineConfig on OpenShift are not needed, are they?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically no... Good point, I should update that.

Comment thread docs/compute/live_migration.md Outdated
denied `userfaultfd` depending on the `container_t` policy in use.
Administrators may need to create a custom SELinux policy module to
permit this syscall for the virt-launcher context. Consult your
platform's documentation for the recommended approach.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can add that nodes that deploy container-selinux v2.248+ have the necessary permission (kernel_userfaultfd_use(container_domain)).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the updated paragraph fine?

@kubevirt-bot kubevirt-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 8, 2026
@kubevirt-bot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jean-edouard

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 8, 2026
@Aseeef Aseeef force-pushed the userfaultfd-fix branch from 1b7a416 to adb5d1c Compare June 8, 2026 14:50
@Aseeef

Aseeef commented Jun 8, 2026

Copy link
Copy Markdown
Member Author

/unhold

@kubevirt-bot kubevirt-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 8, 2026
On most modern distros, vm.unprivileged_userfaultfd is disabled by default
preventing QEMU from capturing page faults during a postcopy migration
on the receiving node. However this requirement is currently not documented
anywhere.

Second, some k8s cluster can choose to enable Seccomp. In this case, there
is an additional layer that needs to be enabled in order to use post-copy.
We document this information also.

Signed-off-by: Aseef Imran <aimran@redhat.com>
Assisted-by: Claude Opus 4.6 <claude@anthropic.com>
@Aseeef Aseeef force-pushed the userfaultfd-fix branch from adb5d1c to 1b2552b Compare June 8, 2026 15:38
@vladikr

vladikr commented Jun 11, 2026

Copy link
Copy Markdown
Member

/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Jun 11, 2026
@kubevirt-bot kubevirt-bot merged commit 7abf27f into kubevirt:main Jun 11, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Post-copy runs into permission issues and fix not documented anywhere

5 participants