8.4. Setting Virtual Machines CPU Model

Virtual machines are created with the host CPU model by default. If nodes in the compute cluster have different CPUs, live migration of VMs between compute nodes may not work or applications inside VMs that depend on particular CPUs may not function properly. To avoid this, you can find out which CPU model offers compatibility across all nodes in the compute cluster and manually set it as the compute cluster default. In this case, however, the compute cluster CPU model will be the least advanced one and compute nodes will lose CPU capabilities of a more advanced processor.

To set the compute cluster CPU model, do the following:

  1. Run virsh capabilities on each node to print an XML document with information on node’s CPU. Join the <cpu> sections from all XML outputs to a single XML file, e.g., cpu-compare.xml.

  2. Compare the CPU features using virsh cpu-baseline. For example:

    # virsh cpu-baseline cpu-compare.xml | grep model
      <model fallback='allow'>IvyBridge</model>
    

    The command will print the most compatible CPU model across all nodes.

  3. Set this CPU model for the compute cluster. For example:

    # vinfra service compute set --cpu-model IvyBridge
    

Take note of the following:

  • For the list of supported CPU models, run vinfra service compute show.
  • Changing CPU model affects only new VMs (i.e. those created after the change).