I created a new VM using an Ubuntu server iso.

Then to create the snapshot:

virsh snapshot-create-as ubuntu ubuntu-snap "snap description" --disk-only --atomic

I started a apt-get update and while it was running observed that the original .img was not being updated but that the snap img was.

After a bit:

virsh blockpull --domain ubuntu --path /var/lib/libvirt/images/ubuntu.ubuntu-snap --base /var/lib/libvirt/images/ubuntu.img --wait --verbose

virsh blockpull --domain ubuntu --path /var/lib/libvirt/images/ubuntu.ubuntu-snap --wait --verbose

virsh snapshot-delete ubuntu ubuntu-snap --metadata

other interesting commands

virsh snapshot-list ubuntu

-- Marcos Woehrmann - 2014-12-21


Created ubuntu vm with 250 gb of disk.

Ran snapshot:

virsh snapshot-create-as ubuntu snap "test snap" --disk-only --atomic

this takes no time and creates the file /var/lib/libvirt/images/ubuntu.snap (the volume name is ubuntu.img).

To see the snapshot info:

virsh snapshot-list ubuntu

-- Marcos Woehrmann - 2014-12-21

Run apt-get dist-upgrade on the VM and as expected the ubuntu.snap file grew.

To flatten snapshot back into base image (actually the other way round, the base will be put into the snapshot):

virsh blockpull ubuntu /var/lib/libvirt/images/ubuntu.snap --wait --verbose

This takes a long time: I aborted it after 4 hours when it was about half done.

What we need is the "virsh blockcommit" which would (presumably) be faster since the 250 gb disk image doesn't have to be copied. Not sure why this isn't called blockpush.

Instead I'm going to create a snapshot:

virsh snapshot-create-as ubuntu2 snap1 "test snap" --disk-only --atomic

run the vm for a while and then create a second snapshot:

virsh snapshot-create-as ubuntu2 snap2 "test snap" --disk-only --atomic

and see how fast it is to merge the two snapshots into one.

-- Marcos Woehrmann - 2014-12-22

This topic: Sandbox > SnapshotDocs
Topic revision: r2 - 2014-12-22 - MarcosWoehrmann
This site is powered by the TWiki collaboration platform Powered by PerlCopyright 2014 Artifex Software Inc