Red Hat Bugzilla – Bug 586161
Error saving/restoring VM with attached disks
Last modified: 2011-01-13 17:56:39 EST
I have been playing with libvirt/KVM on saving the VM to a checkpoint file and restoring it from this file. It has worked very well for me on my RHEL-5.5 setup, until I added hot-plugged volumes.
If I add a volume to a running VM using "virsh attach-disk" and then call "virsh save". The checkpoint file was successfully written and VM stopped.
However, I get errors restoring it with "virsh restore":
$ virsh restore checkpoint
error: Failed to restore domain from checkpoint
error: operation failed: failed to start VM
I did two thinngs to narrow down the problem:
1. If I manually remove the lines of attached volume from the checkpoint file, then it restores fine.
2. If I have the additioinal volumes in the original XML template instead of hot-plugging them on the fly, the save/restore work very well.
So I think the problem is in save/restore hot-plugged volumes.
Fixed in libvirt-0.8.2-1.el5
Verified with Passed in below environment on 4 arches:
1. Run an KVM domain. In guest, load acpiphp module
# modprobe acpiphp
2. Attach a disk to the domain.
# virsh attach-disk rhel5u5 /var/lib/libvirt/images/newdisk.img vda
--sourcetype=file --driver=qemu --subdriver=qcow2
Disk attached successfully
In geust, the new disk is seen.
# fdisk -l
3. Save and restore the domain.
# virsh save rhel5u5 /tmp/tt.save
Domain rhel5u5 saved to /tmp/tt.save
# virsh restore /tmp/tt.save
Domain restored from /tmp/tt.save
# virsh list --all
Id Name State
16 rhel5u5 running
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.