From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:58471) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0atR-0003YR-NR for qemu-devel@nongnu.org; Thu, 23 Feb 2012 10:47:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S0atQ-0002px-F5 for qemu-devel@nongnu.org; Thu, 23 Feb 2012 10:47:41 -0500 Received: from mail-lpp01m010-f45.google.com ([209.85.215.45]:63218) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0atQ-0002pn-9R for qemu-devel@nongnu.org; Thu, 23 Feb 2012 10:47:40 -0500 Received: by lahi5 with SMTP id i5so1751653lah.4 for ; Thu, 23 Feb 2012 07:47:38 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1329930815-7995-1-git-send-email-fsimonce@redhat.com> References: <1329930815-7995-1-git-send-email-fsimonce@redhat.com> Date: Thu, 23 Feb 2012 15:47:38 +0000 Message-ID: From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] Live Block Migration using Mirroring List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Federico Simoncelli Cc: kwolf@redhat.com, mtosatti@redhat.com, qemu-devel@nongnu.org On Wed, Feb 22, 2012 at 5:13 PM, Federico Simoncelli wrote: > Preparation > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > $ mkdir /tmp/{src/dst} > $ qemu-img create -f qcow2 /tmp/src/hd0base.qcow2 20G > Formatting '/tmp/src/hd0base.qcow2', fmt=3Dqcow2 size=3D21474836480 > encryption=3Doff cluster_size=3D65536 > > Step 1 - Initital Scenario > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D > VM1 is running on the src/hd0base. (Where "<=3D" stands for "uses") > > [src/hd0base] <=3D 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 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D > 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] <=3D VM1(read-write) > =A0 =A0 ... =A0 =A0 =A0<- [dst/hd0snap1] <=3D VM1(write-only) > > $ qemu-img create -f qcow2 \ > =A0 =A0 =A0 =A0 =A0 -b /tmp/src/hd0base.qcow2 /tmp/src/hd0snap1.qcow2 20G > Formatting '/tmp/src/hd0snap1.qcow2', fmt=3Dqcow2 size=3D21474836480 > backing_file=3D'/tmp/src/hd0base.qcow2' encryption=3Doff cluster_size=3D6= 5536 > > $ qemu-img create -f qcow2 \ > =A0 =A0 =A0 =A0 =A0 -b /tmp/dst/hd0base.qcow2 /tmp/dst/hd0snap1.qcow2 20G > Formatting '/tmp/dst/hd0snap1.qcow2', fmt=3Dqcow2 size=3D21474836480 > backing_file=3D'/tmp/src/hd0base.qcow2' encryption=3Doff cluster_size=3D6= 5536 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 \ > =A0 =A0 =A0 =A0 blkmirror:/tmp/src/hd0snap1.qcow2:/tmp/dst/hd0snap1.qcow2= blkmirror > > Step 4 - Backing File Copy > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D > An external manager copies src/hd0base to the destination dst/hd0base. > > [src/hd0base] <- [src/hd0snap1] <=3D VM1(read-write) > [dst/hd0base] <- [dst/hd0snap1] <=3D 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 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > VM1 is now able to switch to the destination for both read and write > operations. > > [src/hd0base] <- [src/hd0snap1] <=3D VM1(read-write) > > (qemu) snapshot_blkdev -n ide0-hd0 /tmp/dst/hd0snap1.qcow2 > > -- > Federico > >