Enabling KVM nested virtualization for one guest without halting/rebooting all of them

peoro asked:

I’d like to enable nested virtualization on KVM for at least one of my guests.

I believe that this requires reloading the kvm_intel module passing it a nested=1 option. I cannot halt/reboot some guests now, although I can reboot the one that actually needs nested virtualization.

Is it possible to enable nested virtualization for one guest, without having to reload all of them? Would it be safe to virsh save all my guests, reload the module and then virsh restore?

My answer:

You will have to stop all VMs somehow before you will be able to unload the kvm_intel module and reload it with new module options.

You can save and restore your VMs but keep in mind that it may take several minutes to do so, and any open connections may timeout. Depending on what they are doing, a normal shutdown might be better anyway.

You may wish to use virsh managedsave instead of virsh save, as you may end up having to reboot the hypervisor, and this will cause all such VMs to restart from their saved state on virsh start/when libvirtd autostarts them.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.