On Fri, Mar 11, 2011 at 9:50 AM, Jes Sorensen <jes.soren...@redhat.com> wrote: > On 03/11/11 10:39, SAURAV LAHIRI wrote: >> Thank you Stefan, Jes. So it appears that snapshot_blkdev is the way >> to go for vm disk backup with running vms. >> >> In regard to merging changes, assuming that we go snapshot_blkdev >> rightaway. Stefan's suggestion: "qemu-img commit" Jes's suggestion: >> "qemu-img convert" >> >> Does qemu-img convert apply to running VM's. In that case it would >> appear to be the more practical approach(since vm shutdown would not >> be required). >> >> Also incase If i have interpreted "qemu-img convert" incorrectly and >> does require a VM shutdown. Then when is expected time when the "live >> merge" will be available. > > I believe commit only applies to images with internal files. If you use
Nope, qemu-img commit only applies to images with backing files (aka external snapshots). > convert then it doesn't modify the actual images, so lets say you have a > chain like this: > > original->snapshotA->snapshotB > > original and snapshotA are read-only when snapshotB is running. > Therefore you should be able to use convert to simply copy snapshotA > into a new image file snapshotX and save that for your backup. If you > later restore, you have a single image file you can boot from. > > What you cannot do is to create the new snapshotX file and switch to it > as the backing file for snapshotB while you are up and running. qemu-img commit merges the deltas from a qcow2 (or qed or other copy-on-write image format) into the backing file. If you have the following: qemu-img create -f qcow2 -o backing_file=master.img,backing_fmt=raw instance.qcow2 Then the following command will merge the delta from instance.qcow2 back into master.img: qemu-img commit instance.qcow2 My suggestion was to shut down the VM and run qemu-img commit so that you can move back to the original disk image file which has now been updated with the deltas. You no longer need the file with the deltas. So qemu-img commit lets you merge down the chain of snapshots, whereas qemu-img convert lets you copy a full disk image into a new image file. To be clear, qemu-img should not be used on an image file that is currently open by a running VM. Stefan