VM CPU types

Virtual machines are allocated access to a version of the host’s CPU. This virtual CPU, as seen by the VM, is usually different to the host’s CPU. Differences exist for a variety of reasons including preventing VMs from running their own nested VMs and to ensure compatibility with host CPUs across a cluster.

Host-Passthrough

When creating a virtual machine we can set the CPU type. The simplest approach is to use Host-Passthrough model and the VM will be presented with an exact copy of the host CPU. While selecting Host-Passthrough is good for performance, it does have downsides, one of which is that we do not entirely know what CPU the VM will receive, that is only determined when the VM is allocated to a host and started.

Warning - Host-Passthrough VM CPUs can prevent VM migration

Migrating a VM with a newer VM CPU type to a host with an older physical CPU type will raise an error:

Error: the CPU is incompatible with host CPU: Host CPU does not provide required features ....

These migration errors can impede normal cluster functioning, so the Host-Passthrough CPU type should be avoided in Production clusters.

kvm32 and kvm64

The kvm32 and kvm64 CPU types will emulate the presence of the oldest and most compatible CPU possible. While this will ensure that migration is possible, these CPU types will also disable many beneficial features found in modern CPUs and prevent optimal performance.

Optimal VM CPU types

Optimal CPU types can be selected by reviewing the CPU hardware present in your cluster and updating your templates accordingly.

CPU types are grouped according to the architectural generation or code name, not by model number. A quick search online will reveal the generation of your CPU; for instance, searching Intel Xeon E5-2690 shows an Intel ARK page listing the code name as Sandy Bridge which translates into the VM CPU type SandyBridge. Doing a similar review of all the CPU types in your cluster will produce a list of the CPU generations. Pick the oldest CPU generation in your cluster as your baseline and set your template’s CPU model to this baseline.

Selecting VM Template CPU model

Intel and AMD

Generally speaking, Intel CPU types are not compatible with AMD CPU types; there are key differences which mean that finding a lowest common denominator will require disabling features and losing a great deal of performance.

If you wish to mix AMD and Intel hosts in the same cluster, then consider the use of scheduling rules to keep VMs on either Intel or AMD hosts. You can then choose an appropriate baseline CPU for VMs on both AMD and Intel hosts and retain optimal performance on both. This will mean creating additional clones of templates for the differing CPU types but allows AMD and Intel hosts to contribute to the same storage pool.

Red Hat 9 and above

Red Hat announced that RHEL 9 would require a newer CPU type than the previous releases. The CPU type was given a new CPU designation - x86-64-v2 which classified a grouping of minimum CPU features and means that RHEL 9 cannot run on older hardware.

The oldest CPU type able to run RHEL9 is Opteron G4 for AMD and SandyBridge for Intel, so make sure that you have selected this generation or newer for VM Templates targeting RHEL9 or other new releases in the Red Hat family of products.

Available CPU types and their features

CPU types and their feature levels follow the ABI compatability levels provided by the QEMU project.