Bug 1473516 - Fail to start domain with 'host-model' cpu mode from managedsave state on some machines
Fail to start domain with 'host-model' cpu mode from managedsave state on som...
Status: ASSIGNED
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.4
x86_64 Linux
unspecified Severity unspecified
: rc
: ---
Assigned To: Jiri Denemark
Luyao Huang
:
Depends On:
Blocks: libvirtCPUconfig
  Show dependency treegraph
 
Reported: 2017-07-21 00:38 EDT by yanqzhan@redhat.com
Modified: 2017-07-31 06:23 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description yanqzhan@redhat.com 2017-07-21 00:38:19 EDT
Description of problem:
the phenom CPU model defined in QEMU contains "npt" feature while libvirt doesn't know anything about the feature. When a new domain is started, QEMU disables this feature on host, which is ignored by libvirt (it doesn't know the feature), but once restoring the domain it sees QEMU unexpectedly disabled some feature and complains about it.

Version-Release number of selected component (if applicable):
libvirt-3.2.0-14.el7_4.2.x86_64

How reproducible:
100% (on some machines)

Steps to Reproduce:
virsh # capabilities 
<capabilities>

  <host>
    <uuid>00020003-0004-0005-0006-000700080009</uuid>
    <cpu>
      <arch>x86_64</arch>
      <model>Opteron_G2</model>
      <vendor>AMD</vendor>
      <topology sockets='1' cores='2' threads='1'/>
      <feature name='vme'/>
      <feature name='ht'/>
      <feature name='mmxext'/>
      <feature name='fxsr_opt'/>
      <feature name='3dnowext'/>
      <feature name='3dnow'/>
      <feature name='cmp_legacy'/>
      <feature name='extapic'/>
      <feature name='cr8legacy'/>
      <pages unit='KiB' size='4'/>
      <pages unit='KiB' size='2048'/>
    </cpu>

1.Config domain xml as:
# virsh dumpxml avocado-vt-vm1
...
  <cpu mode='host-model' check='partial'>
    <model fallback='allow'/>
  </cpu>
...

2.Start guest, check xml:
# virsh dumpxml avocado-vt-vm1
...
  <cpu mode='custom' match='exact' check='full'>
    <model fallback='forbid'>phenom</model>
    <vendor>AMD</vendor>
    <feature policy='require' name='vme'/>
    <feature policy='require' name='cx16'/>
    <feature policy='require' name='x2apic'/>
    <feature policy='require' name='tsc-deadline'/>
    <feature policy='require' name='hypervisor'/>
    <feature policy='require' name='arat'/>
    <feature policy='require' name='lahf_lm'/>
    <feature policy='require' name='cmp_legacy'/>
    <feature policy='require' name='cr8legacy'/>
    <feature policy='disable' name='monitor'/>
    <feature policy='disable' name='svm'/>
    <feature policy='disable' name='popcnt'/>
    <feature policy='disable' name='pdpe1gb'/>
    <feature policy='disable' name='rdtscp'/>
    <feature policy='disable' name='abm'/>
    <feature policy='disable' name='sse4a'/>
  </cpu>
...

# virsh dumpxml avocado-vt-vm1 --migratable
...
  <cpu mode='custom' match='exact' check='partial'>
    <model fallback='forbid'>phenom</model>
    <vendor>AMD</vendor>
    <feature policy='require' name='vme'/>
    <feature policy='require' name='cx16'/>
    <feature policy='require' name='x2apic'/>
    <feature policy='require' name='tsc-deadline'/>
    <feature policy='require' name='hypervisor'/>
    <feature policy='require' name='arat'/>
    <feature policy='require' name='lahf_lm'/>
    <feature policy='require' name='cmp_legacy'/>
    <feature policy='require' name='cr8legacy'/>
    <feature policy='disable' name='monitor'/>
    <feature policy='disable' name='svm'/>
  </cpu>
...

3.Do managedsave:
# virsh managedsave avocado-vt-vm1

Domain avocado-vt-vm1 state saved by libvirt

4.Try to start the domain:
# virsh start avocado-vt-vm1 
error: Failed to start domain avocado-vt-vm1
error: operation failed: guest CPU doesn't match specification


Actual results:
As in step4, starting the domain from a managedsave state failed with error that cpu doesn't match

Expected results:
Should succeed to start the domain without error.

Additional info:
1.Also reproduces on the libvirt 3.2.0-14.
2.Not reproduce on libvirt-3.2.0-13.el7.x86_64

Note You need to log in before you can comment on or make changes to this bug.