[libvirt] CPU compare and baseline

Jiri Denemark jdenemar at redhat.com
Tue Mar 22 14:01:46 UTC 2011


On Mon, Mar 21, 2011 at 18:34:40 +0100, Edouard Thuleau wrote:
> Hi,
> I try to understand the compare and baseline CPU commands with libvirt.
> This functions are useful for the migration ? Before migrate a domain to
> other host, libvirt verifies the CPU compatibility, that's right ?
Right.

> > *$ virsh cpu-baseline cpu_gargamel.xml *

It's not clear what the content of cpu_gargamel.xml is. Does it contain CPU
definitions from both hosts? virsh cpu-baseline is supposed to give you an
intersection of the CPUs given in the XML file; it doesn't use host CPU on
which this command is called.

If you take the two host CPUs above, remove <vendor> elements (since CPUs with
non-matching vendors are considered incompatible), and pass that to
cpu-baseline, you will get the following guest CPU which you can use to be
able to migrate between the two hosts:

<cpu match='exact'>
  <model>Opteron_G2</model>
  <feature policy='require' name='ht'/>
  <feature policy='require' name='vme'/>
  <feature policy='disable' name='svm'/>
  <feature policy='disable' name='rdtscp'/>
</cpu>

Note, that there is no <vendor> element there since mentioning vendor in guest
CPU config means that you always want to run the domain on CPUs from this
specific vendor and migrating it to another vendor will fail.

Jirka




More information about the libvir-list mailing list