[fedora-virt] Suspending VMs on host shutdown

Daniel P. Berrange berrange at redhat.com
Mon Aug 15 16:23:09 UTC 2011


On Mon, Aug 15, 2011 at 11:12:25AM +0100, Tom Hughes wrote:
> The current default behaviour of libvirt, courtesy of the libvirt-guests 
> service, is to suspend any running VMs when the host is shutdown.
> 
> The only problem with this is that qemu doesn't seem to guarantee that a 
> VM suspended with one version of qemu can be restored by a later 
> version, so if you have a running VM but qemu has been updated since it 
> was started then you may find that rebooting the host leaves you with an 
> unbootable guest.

QEMU is *supposed* to guarentee that you can save/rstore across
versions, because this is exactly the same scenario as migrating
from one host to another with differing versions. No matter what
version of KVM you have, if you launch with the same command line
args and specifically the same '-M pc-0.xx' machine type then
they should be compatible.

That said QEMU has screwed this up several times in upstream
releases. In RHEL6 we've had to do patches to fix this, but
it is kinda hard so Fedora has often lost out in this respect.

> 
> My specific example was that this morning qemu-kvm updated from 
> 0.15.0-1.fc15 to 0.15.0-0.3.201108040af4922.fc15 and shortly after that 

This is a slightly different case. There is no guarentee at all that
there is compatibility from GIT snapshots to the final release. Any
and all things might break between GIT snapshots. Only official
releases are intended to be compatible.

> I restarted my host only to find that the VM that had been running for 
> some time wouldn't start. Looking at the logs showed:
> 
>    Unknown savevm section or instance 'kvmclock' 0
>    load of migration failed

Yep, this is an example of a QEMU screw up.

> The only way I was able to get things running again was to find the 
> saved memory image on disk and move it out of the way so that libvirt 
> would boot the VM from the disk image instead of trying to restore it.

virsh managedsave-remove $DOM

should have solved that too

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|


More information about the virt mailing list