Bug 586161

Summary: Error saving/restoring VM with attached disks
Product: Red Hat Enterprise Linux 5 Reporter: Shi jin <jinzishuai>
Component: libvirtAssignee: Daniel Veillard <veillard>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 5.5CC: berrange, dallan, llim, mzhan, virt-maint, xen-maint
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.8.2-1.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-13 22:56:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Shi jin 2010-04-26 23:50:45 UTC
Hi there,

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.

Thanks.
Shi

Comment 1 Jiri Denemark 2010-09-02 11:59:43 UTC
Fixed in libvirt-0.8.2-1.el5

Comment 3 Min Zhan 2010-10-26 08:34:31 UTC
Verified with Passed in below environment on 4 arches:
-RHEL5.6-Server-x86_64-KVM 
-RHEL5.6-Server-x86_64-Xen
-RHEL5.6-Client-i386-Xen
-RHEL5.6-Server-ia64-Xen

kernel-xen-2.6.18-228.el5
xen-3.0.3-117.el5
kvm-qemu-img-83-205.el5
kernel-2.6.18-228.el5
libvirt-0.8.2-8.el5


Steps:
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

Comment 5 errata-xmlrpc 2011-01-13 22:56:39 UTC
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.

http://rhn.redhat.com/errata/RHEA-2011-0060.html