From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:60636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qa2gy-0006Ti-RM for qemu-devel@nongnu.org; Fri, 24 Jun 2011 05:28:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qa2gx-0002pK-Ff for qemu-devel@nongnu.org; Fri, 24 Jun 2011 05:28:48 -0400 Received: from mail-yw0-f45.google.com ([209.85.213.45]:46619) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qa2gx-0002pC-2Y for qemu-devel@nongnu.org; Fri, 24 Jun 2011 05:28:47 -0400 Received: by ywb3 with SMTP id 3so1340965ywb.4 for ; Fri, 24 Jun 2011 02:28:45 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4DFE1D8C.3000402@redhat.com> References: <1308075511-4745-1-git-send-email-stefanha@linux.vnet.ibm.com> <4DF9F899.5050301@redhat.com> <4DF9FBE4.9080300@redhat.com> <4DFA004E.9010001@redhat.com> <20110616145243.GB12173@amt.cnet> <20110616153018.GA20714@stefanha-thinkpad.localdomain> <20110617123152.GA7379@amt.cnet> <4DFE1D8C.3000402@redhat.com> Date: Fri, 24 Jun 2011 10:28:45 +0100 Message-ID: From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] Image streaming and live block copy List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: dlaor@redhat.com Cc: Kevin Wolf , Anthony Liguori , Stefan Hajnoczi , jes sorensen , Marcelo Tosatti , qemu-devel@nongnu.org, Avi Kivity , Adam Litke On Sun, Jun 19, 2011 at 5:02 PM, Dor Laor wrote: > On 06/18/2011 12:17 PM, Stefan Hajnoczi wrote: >> >> On Sat, Jun 18, 2011 at 10:15 AM, Stefan Hajnoczi >> =A0wrote: >>> >>> On Fri, Jun 17, 2011 at 1:31 PM, Marcelo Tosatti >>> =A0wrote: >>>> >>>> On Thu, Jun 16, 2011 at 04:30:18PM +0100, Stefan Hajnoczi wrote: >>>>> >>>>> On Thu, Jun 16, 2011 at 11:52:43AM -0300, Marcelo Tosatti wrote: >>>>> This approach does not use the backing file feature? >>>>> >>>>>> blkstream block driver: >>>>>> >>>>>> - Maintain in memory whether given block is allocated in local image= , >>>>>> if not, read from remote, write to local. Set block as local. >>>>>> Local and remote simply two block drivers from image streaming drive= r >>>>>> POV. >>>>>> - Once all blocks are local, notify mgmt so it can switch to local >>>>>> copy. >>>>>> - Writes are mirrored to source and destination, minding guest write= s >>>>>> over copy writes. >>>>> >>>>> We open the remote file read-only for image streaming and do not want >>>>> to >>>>> mirror writes. >>>> >>>> Why not? Is there any disadvantage of mirroring writes? >>> >>> Think of the use case with a Fedora master image over NFS. =A0You want = a >>> local clone of that master image and use the stream command to copy >>> the data from the master image into the local clone. >>> >>> You cannot modify that master image because other VMs are using it too >>> and/or you want to be able to clone new VMs from it in the future. >> >> BTW the workaround is to create two local images: >> 1. Local clone with master image as a backing file. =A0This is the live >> block copy source image. >> 2. Local image without a backing file. =A0This is the live block copy >> destination image. >> >> But this is not very elegant. =A0Writes get mirrored so that crash recov= ery >> works. > > There is an easier work around for image streaming using live block copy > (mirror approach): > =A0- Create the dst VM as an empty new COW image of the src (even over > =A0 =A0the non shared storage, use some protocol tag for the src location > =A0 =A0like nbd://original_path/src_file_name) Migration and non-shared storage has come up a few times in this discussion. But both live block copy and image streaming need access to source and destination - they do not have explicit non-shared storage support. I think non-shared and using nbd:// is orthogonal to the discussion. Just want to check that you agree and I haven't missed something? > =A0- Run the usual live block copy of src image (master read only OS > =A0 =A0template) to the destination. > =A0 =A0- Use a -src-read-only flag that will make the copy skip the src > =A0 =A0 =A0writing. > > Voila - no duplicate writes, crash recovery works since we reference the > original image and we share the code. So the running guest is using the destination image since the source is read-only? This approach makes sense to me. Stefan