Use All host CPU Features To The Guest By Updating CPU modes
Problem
Some of the CPU feature flags are not passed to the guest VM by default or If you want to use all features from the host CPU.
Environment
- Platform9 Managed OpenStack - v5.4 and Higher
Procedure
We have two methods to pass those flags to guest VMs. This need to be updated in the [ libvirt ] section of */opt/pf9/etc/nova/conf.d/nova_override.conf. *
- Using
host-model
-host-model
is a safe choice if your compute node CPUs are largely identical. That closely matches the host and requests additional CPU flags to complete the match if flags are not passed by default.
[libvirt]
cpu_mode = host-model
cpu_model_extra_flags = <flags seperated by comma>
2. Using host-passthrough
- libvirt tells KVM to pass through the host CPU with no modifications. In comparison to host-model
which simply matches feature flags, host-passthrough
ensures every last detail of the host CPU is matched. This gives the best performance, and can be important to some apps which check low level CPU details, but it comes at a cost with respect to migration.
In host-passthrough
mode, the guest can only be live-migrated to a target host that matches the source host extremely closely
[libvirt]
cpu_mode = host-passthrough
After updating the file restart the pf9-ostackhost service and reboot the guest VM.
# sudo systemctl restart pf9-ostackhost
# openstack server reboot --hard [Instance_UUID]
Now, guest VM will start showing that flags.