On Wed, Feb 22, 2012 at 5:13 PM, Federico Simoncelli <fsimo...@redhat.com> wrote: > Preparation > =========== > > $ mkdir /tmp/{src/dst} > $ qemu-img create -f qcow2 /tmp/src/hd0base.qcow2 20G > Formatting '/tmp/src/hd0base.qcow2', fmt=qcow2 size=21474836480 > encryption=off cluster_size=65536 > > Step 1 - Initital Scenario > ========================== > VM1 is running on the src/hd0base. (Where "<=" stands for "uses") > > [src/hd0base] <= VM1(read-write) > > $ qemu-system-x86_64 -hda /tmp/src/hd0base.qcow2 -monitor stdio > QEMU 1.0.50 monitor - type 'help' for more information > (qemu) > > Step 3 - Mirrored Live Snapshot > =============================== > A mirrored live snapshot is issued using src/hd0snap1 and dst/hd0snap1 as > image files. (Where "<-" stands for "has backing file") > > [src/hd0base] <- [src/hd0snap1] <= VM1(read-write) > ... <- [dst/hd0snap1] <= VM1(write-only) > > $ qemu-img create -f qcow2 \ > -b /tmp/src/hd0base.qcow2 /tmp/src/hd0snap1.qcow2 20G > Formatting '/tmp/src/hd0snap1.qcow2', fmt=qcow2 size=21474836480 > backing_file='/tmp/src/hd0base.qcow2' encryption=off cluster_size=65536 > > $ qemu-img create -f qcow2 \ > -b /tmp/dst/hd0base.qcow2 /tmp/dst/hd0snap1.qcow2 20G > Formatting '/tmp/dst/hd0snap1.qcow2', fmt=qcow2 size=21474836480 > backing_file='/tmp/src/hd0base.qcow2' encryption=off cluster_size=65536
At this stage /tmp/dst/hd0base.qcow2 does not exist yet. The qemu-img output you pasted shows /tmp/src/hd0base.qcow2 was actually used. Typo? > (qemu) snapshot_blkdev -n ide0-hd0 \ > blkmirror:/tmp/src/hd0snap1.qcow2:/tmp/dst/hd0snap1.qcow2 blkmirror > > Step 4 - Backing File Copy > ========================== > An external manager copies src/hd0base to the destination dst/hd0base. > > [src/hd0base] <- [src/hd0snap1] <= VM1(read-write) > [dst/hd0base] <- [dst/hd0snap1] <= VM1(write-only) > > $ cp -a /tmp/src/hd0base.qcow2 /tmp/dst/hd0base.qcow2 Are we missing a fixup step that changes backing_file in dst/hd0snap1.qcow2 to point at dst/hd0base.qcow2? > Step 5 - Final Switch to Destination > ==================================== > VM1 is now able to switch to the destination for both read and write > operations. > > [src/hd0base] <- [src/hd0snap1] <= VM1(read-write) > > (qemu) snapshot_blkdev -n ide0-hd0 /tmp/dst/hd0snap1.qcow2 > > -- > Federico > >