New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use hugepages source type='memfd' to avoid hugetlbfs selinux issues #3781
Comments
|
Thanks @crobinso . /assign @jean-edouard |
Add source field and set it equal to memfd. Workaround for issue: kubevirt#3781 Signed-off-by: Alice Frosi <afrosi@redhat.com>
Add source field and set it equal to memfd. Workaround for issue: kubevirt#3781 Signed-off-by: Alice Frosi <afrosi@redhat.com>
Add source field and set it equal to memfd. Workaround for issue: kubevirt#3781 Signed-off-by: Alice Frosi <afrosi@redhat.com>
Add source field and set it equal to memfd. Workaround for issue: kubevirt#3781 Signed-off-by: Alice Frosi <afrosi@redhat.com>
Add source field and set it equal to memfd. Workaround for issue: kubevirt#3781 Signed-off-by: Alice Frosi <afrosi@redhat.com>
|
From 4.10.0 onwards - see https://libvirt.org/formatdomain.html#memory-backing |
|
@alicefr right I believe they use centos7 as the base OS but you'll want to specifically check the qemu package version installed there, because they are are all based on RHEL8 qemu content currently. The question is whether it's version 4.2.0-27 or something older |
|
@crobinso so, do you think that simply checking libvirtd version doesn't help? I was thinking to simply set memfd only if libvirtd is newer than 4.10.0 |
|
@alicefr in practice for kubevirt it may be sufficient if libvirt 4.10 is always paired with a new enough qemu in their CI, I'm not sure. give it a spin and see if it works. libvirt should be reporting this in its domcapabilities output though which is meant for reporting these types of features, but unfortunately that support is missing (and kubevirt isn't consuming domcapabilities yet anyways) |
Use of
<hugepages>with libvirt by default uses hugetlbfs. This provokes some selinux violations with plain container_t, so virt_launcher_t needs to enable extra rules to account for this: https://github.com/kubevirt/kubevirt/blob/master/cmd/virt-handler/virt_launcher.cil@berrange suggested Kubevirt can avoid these issues by using memfd instead of hugetlbfs. The libvirt XML is:
At present this also requires
<numa>configuration, the most basic is:The numa requirement is a qemu limitation that is fixed in qemu 5.0.0 (see this commit but needs libvirt support before it can be used.
qemu-kvm in av-8.2 libvirt container has memfd support but not the older versions.
/kind enhancement
The text was updated successfully, but these errors were encountered: