How-To Expose all Physical CPU Features to KVM

Problem

You want to expose a flag present on the physical CPU to the virtual machines running on the host.

Environment

  • Platform9 Managed OpenStack - All versions

  • Nova

  • KVM/qemu

Procedure

  1. Update the Nova configuration file locate at /opt/pf9/etc/nova/conf.d/nova_override.conf and make sure the following option is set within the [libvirt] stanza.

[pf9@lab01~]$ cat /opt/pf9/etc/nova/conf.d/nova_override.conf.........[libvirt]cpu_mode=host-model
  1. Once the file has been modified, restart the pf9-ostackhost service by running the following command.

# sudo systemctl restart pf9-ostackhost
  1. Hard reboot the VMs where you want to see the additional flags by running the following command.

# openstack server reboot --hard [Instance_UUID]

Additional Information

Using host-model is a safe choice if your compute node CPUs are largely identical. However, if your compute nodes span multiple processor generations, you may be better advised to select a custom CPU model.

https://docs.openstack.org/nova/rocky/admin/configuration/hypervisor-kvm.html#host-model-default-for-kvm-qemu

Last updated