Re: [libvirt-users] The default location of vm snapshots

Thanks a lot for the details. From http://wiki.libvirt.org/page/Snapshots, we have to pause the domain before taking snapshot and resume after. Is there any way to do "live" snapshotting for running domain or reduce pause time? Thanks, Lei ------------------ Original ------------------ From: "Eric Blake"<eblake@redhat.com>; Date: Wed, Jun 6, 2012 08:24 PM To: "SimpleCloud"<simplecloud@qq.com>; Cc: "libvirt-users"<libvirt-users@redhat.com>; Subject: Re: [libvirt-users] The default location of vm snapshots On 06/06/2012 03:20 AM, SimpleCloud wrote:
Hi all,
Where could I find the memory dump and disk snapshots for vm after command "virsh snapshot-create <some_running_vm>"? Thanks in advance.
This particular form of snapshot is called the 'system checkpoint' snapshot, and the current qemu implementation is that the snapshot creates internal snapshots in your qcow2 files. If you do 'qemu-img info $path_to_img', you will see the disk snapshots listed as internal snapshots for each image associated with the domain, as well as the first qcow2 file also having memory associated with the internal snapshot.
I found the xml files in /var/lib/libvirt/qemu/snapshot/, but hava no idea about the raw snapshot file.
Looking in /var/lib/libvirt is generally unsupported (that is an internal libvirt detail, and subject to change in future releases). The only way to safely look at the snapshot XML is via the API (virDomainSnapshotGetXMLDesc, which is wrapped by 'virsh snapshot-dumpxml'). I am also hoping to submit a patch that will allow you the option to create an external snapshot rather than using qcow2 internal snapshots, but that's not in the code base yet. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 06/06/2012 07:05 AM, SimpleCloud wrote:
Thanks a lot for the details.
From http://wiki.libvirt.org/page/Snapshots, we have to pause the domain before taking snapshot and resume after.
Actually, you don't have to do it yourself; libvirt takes care of doing it for you if that's what qemu requires, as part of the libvirt snapshot comand.
Is there any way to do "live" snapshotting for running domain or reduce pause time?
You can do 'disk-only' snapshots instead of system checkpoints, which are much faster (less than 1 second, while system checkpoints can be seconds or even minutes long). And I'm also hoping to add code that will support external system checkpoints by doing a live migration to file coupled with a disk snapshot, which will hopefully reduce guest downtime compared to the current mandatory guest downtime of the qemu 'savevm' monitor command, but it may require qemu to implement more features first. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

you could try: snapshot-create-as guest guestsnap --disk-only Thanks. --Xingxing Gao 2012/6/6 Eric Blake <eblake@redhat.com>:
On 06/06/2012 07:05 AM, SimpleCloud wrote:
Thanks a lot for the details.
From http://wiki.libvirt.org/page/Snapshots, we have to pause the domain before taking snapshot and resume after.
Actually, you don't have to do it yourself; libvirt takes care of doing it for you if that's what qemu requires, as part of the libvirt snapshot comand.
Is there any way to do "live" snapshotting for running domain or reduce pause time?
You can do 'disk-only' snapshots instead of system checkpoints, which are much faster (less than 1 second, while system checkpoints can be seconds or even minutes long). And I'm also hoping to add code that will support external system checkpoints by doing a live migration to file coupled with a disk snapshot, which will hopefully reduce guest downtime compared to the current mandatory guest downtime of the qemu 'savevm' monitor command, but it may require qemu to implement more features first.
-- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
_______________________________________________ libvirt-users mailing list libvirt-users@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-users

[please don't top-post on technical lists] On 06/06/2012 06:22 PM, Xing.x.Gao wrote:
you could try: snapshot-create-as guest guestsnap --disk-only
Yes, this is...
Is there any way to do "live" snapshotting for running domain or reduce pause time?
You can do 'disk-only' snapshots instead of system checkpoints, which are much faster
...precisely what I meant by 'disk-only' snapshots. As long as you don't need the associated VM state (that is, if you are okay that reverting to the snapshot implies that any in-flight memory that has not been flushed to disk will be lost, and that the disks will probably need fsck), then this is indeed the way to go. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (3)
-
Eric Blake
-
SimpleCloud
-
Xing.x.Gao