ansibleplaybookbundle / kubevirt-apb

APB for managing KubeVirt deployments
Apache License 2.0
8 stars 16 forks source link

Add a nested_virt option #17

Closed rthallisey closed 6 years ago

rthallisey commented 6 years ago

Add a nested_virt param to the kubevirt-apb. This is going to require running:

echo "options kvm-intel nested=1" > /etc/modprobe.d/kvm-intel.conf
rmmod kvm-intel && modprobe kvm-intel || true
cat /sys/module/kvm_intel/parameters/nested

In order for this to work, the container needs to be a root user and needs to mount in /lib/modules.

mareklibra commented 6 years ago

To support both Intel and AMD:

if [ -d /sys/module/kvm_intel -a -d /etc/modprobe.d -a ! -f /etc/modprobe.d/kvm-intel.conf ]; then
    echo "options kvm-intel nested=1" > /etc/modprobe.d/kvm-intel.conf
    rmmod kvm-intel && modprobe kvm-intel || true
fi
if [ -d /sys/module/kvm_amd -a -d /etc/modprobe.d -a ! -f /etc/modprobe.d/kvm-amd.conf ]; then
    echo "options kvm-amd nested=1" > /etc/modprobe.d/kvm-amd.conf
    rmmod kvm-amd && modprobe kvm-amd || true
fi

To verify:

cat /sys/module/kvm_intel/parameters/nested
karmab commented 6 years ago

i'll be a bit picky and suggest modprobe -r instead of rmmod

mareklibra commented 6 years ago

works for me ...

karmab commented 6 years ago

i dont get in which container this code should go

rthallisey commented 6 years ago

@karmab can you explain further?

karmab commented 6 years ago

@rthallisey sure, you re saying in first comment the following

In order for this to work, the container needs to be a root user and needs to mount in /lib/modules.

and it dont get which container you re talking about:

rthallisey commented 6 years ago

The kubevirt-apb need to be root and mount /lib/modules.

Switching to Root: https://github.com/ansibleplaybookbundle/kubevirt-apb/pull/19/files#diff-3254677a7917c6c01f55212f86c57fbfL23

nellyc commented 6 years ago

@rthallisey where is this req coming forom? is it still relevant?

rthallisey commented 6 years ago

closing for now.