Description of problem:
After upgrading to RHEL6.6 and latest libvirt/virt-manager/qemu packages, existing
guest VMs are failing 'virsh save' with a message similar to that in Bug 841629 - (but that is very old).
virsh/virt-manager was working as expected before the reboot.
A newly created VM with the default processor setting (no optional hardware features) works as expected, but selecting 'copy from host' for the CPU type causes the 'virsh save' problem. Tested on two hosts, with hardware types 'Westmere' and 'SandyBridge'
Version-Release number of selected component (if applicable):
kernel 2.6.32-504.el6.x86_64 #1 SMP Tue Sep 16 01:56:35 EDT 2014 x86_64 x86_64 x86_64
Steps to Reproduce:
1. Define a VM. Leave the processor default settings at the default. The guest OS does not seem to matter.
2. 'virsh save' works
3. Change the processor type to 'copy from host' and reboot the guest.
4. 'virsh save' fails.
Can you provide the exact libvirt version, the XML of the failing VM and the exact error message? (by running virt-manager with --debug in a terminal)
Without that, I can only guess that 'copy from host' is done by virt-manager and it also includes CPU features that don't work with save.
Created attachment 981601 [details]
VM XML as a 'generic' CPU
Created attachment 981602 [details]
VM definition after changing CPU type to match host 'westmere'
Created attachment 981603 [details]
virt-manager --debug output showing errors on 'save' operation
The Westmere XML explicitly lists the 'invtsc' feature which blocks save/migration. Deleting the feature or using <cpu mode='host-model'/> should both produce a CPU that allows save.
Moving the bug to virt-manager to see if it can stop adding this non-migratable feature.
I don't think virt-manager should get to this level of details and filtering out non-migratable features, virt-manager reads this information directly from the cpu_map.xml file (it has been changed upstream and in RHEL-7). The easiest way to workaround it is to choose a CPU which hasn't that feature (or manually drop it) from the XML.
Great - disabling 'invtsc' explicitly does seem to fix the problem. I see that RHEL7 doesn't specify it. It does seem to be a serious portability problem that 'copy from host' results in an un-saveable guest.
that's why virt-manager changed a lot in RHEL-7 and we are late in RHEL-6 to think about back-porting it. It seems that the best solution is to choose a different model or manually drop "invtsc" as you have done.
*** Bug 1188245 has been marked as a duplicate of this bug. ***
I can reproduce this issue with package:
steps to reproduce:
1. Use virt-install cmd install a guest with option "--cpu host":
# virt-install -n cpu-test-old -r 1024 --cpu host --disk=/var/tmp/cpu-test-old.img,size=5 --cdrom=/iso/RHEL-6.6-20140926.0-Server-x86_64-dvd1.iso
Creating storage file cpu-test-old.img | 5.0 GB 00:00
Result: Installation finished with no error.
# virsh dumpxml cpu-test-old
<cpu mode='custom' match='exact'>
<feature policy='require' name='avx'/>
<feature policy='require' name='tsc-deadline'/>
<feature policy='require' name='dtes64'/>
<feature policy='require' name='xsave'/>
<feature policy='require' name='vmx'/>
<feature policy='require' name='xtpr'/>
<feature policy='require' name='pcid'/>
<feature policy='require' name='est'/>
<feature policy='require' name='monitor'/>
<feature policy='require' name='smx'/>
<feature policy='require' name='tm'/>
<feature policy='require' name='pclmuldq'/>
<feature policy='require' name='acpi'/>
<feature policy='require' name='vme'/>
<feature policy='require' name='osxsave'/>
<feature policy='require' name='tm2'/>
<feature policy='require' name='ht'/>
<feature policy='require' name='pdcm'/>
<feature policy='require' name='ds'/>
<feature policy='require' name='invtsc'/>
<feature policy='require' name='rdtscp'/>
<feature policy='require' name='ss'/>
<feature policy='require' name='pbe'/>
<feature policy='require' name='ds_cpl'/>
<feature policy='require' name='x2apic'/>
2. Use virsh cmd to save the guest:
# virsh save cpu-test-old /tmp/cpu-test-old.save
error: Failed to save domain cpu-test-old to /tmp/cpu-test-old.save
error: internal error unable to execute QEMU command 'migrate': An undefined error has ocurred
Then try to verify this bug with new build:
steps to verify:
# virt-install -n cpu-test -r 1024 --cpu host --disk=/var/tmp/cpu-test.img,size=5 --cdrom=/iso/RHEL-6.6-20140926.0-Server-x86_64-dvd1.iso
Creating storage file cpu-test.img | 5.0 GB 00:00
Creating domain... | 0 B 00:00
Result: Installation finished with no error.
# virsh dumpxml cpu-test
# virsh save cpu-test /tmp/cpu-test.save2
Domain cpu-test saved to /tmp/cpu-test.save2
# virsh restore /tmp/cpu-test.save2
Domain restored from /tmp/cpu-test.save2
Result: Guest can be saved/restored successfully.
So move this bug from ON_QA to VERIFIED.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.