Configure a CPU model

Configure a CPU modelΒΆ

The Compute service enables you to control the guest host CPU model that is exposed to KVM virtual machines. The use cases include:

  • Maximization of performance of virtual machines by exposing new host CPU features to the guest
  • Ensuring a consistent default CPU value across all machines by removing the reliance on the QEMU variable default values

You can define the CPU model for your deployment by setting the cpu_mode parameter on the Reclass cluster level. A universal default value for this parameter does not exist as the configuration depends a lot on a particular use case, workload needs, and compute hardware. Therefore, picking up the value for the cpu_mode parameter is worth careful consideration.

The supported values include:

host-model
Clone the host CPU feature flags
host-passthrough
Use the host CPU model
custom
Use the CPU model defined with [libvirt]cpu_model
none
Do not set a specific CPU model. For example, with the [libvirt] virt_type as KVM/QEMU, the default CPU model from QEMU will be used providing a basic set of CPU features that are compatible with most hosts

The cpu_mode parameter directly affects the possibility of performing the VM migration. To be able to migrate a VM from one compute host to another one, the destination host must support the CPU flags of the guest host. If a cloud environment is running on a heterogeneous hardware, the cpu_mode parameter should be set to custom. Though, such configuration will decrease the workload performance.

Starting from the MCP maintenance update 2019.2.10, you can use the custom CpuFlagsFilter Nova scheduler filter. The filter works only for live migrations and ensures that the CPU features of a live migration source host match the target host. Use the CpuFlagsFilter filter only if your deployment meets the following criteria:

  • The CPU mode is set to host-passthrough or host-model.
  • The OpenStack compute nodes have heterogeneous CPUs.
  • The OpenStack compute nodes are not organized in aggregates with the same CPU in each aggregate.