Received: from [140.186.70.92] (port=33900 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Py7lA-0004dp-0y for qemu-devel@nongnu.org; Fri, 11 Mar 2011 14:12:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Py7l8-0001O6-MD for qemu-devel@nongnu.org; Fri, 11 Mar 2011 14:12:23 -0500 Received: from web161603.mail.bf1.yahoo.com ([98.139.210.172]:24423) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Py7l8-0001O0-HC for qemu-devel@nongnu.org; Fri, 11 Mar 2011 14:12:22 -0500 Message-ID: <720386.19420.qm@web161603.mail.bf1.yahoo.com> Date: Fri, 11 Mar 2011 11:12:21 -0800 (PST) From: SAURAV LAHIRI Subject: Re: [Qemu-devel] Issue with snapshot outside qcow2 disk - qemu 0.14.0 In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-193469796-1299870741=:19420" List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Jes Sorensen , qemu-devel@nongnu.org --0-193469796-1299870741=:19420 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Thank you Stefan that does clarify on how to correctly use "qemu-img commit= " Regards sl --- On Fri, 11/3/11, Stefan Hajnoczi wrote: From: Stefan Hajnoczi Subject: Re: [Qemu-devel] Issue with snapshot outside qcow2 disk - qemu 0.1= 4.0 To: "SAURAV LAHIRI" Cc: "Jes Sorensen" , qemu-devel@nongnu.org Date: Friday, 11 March, 2011, 7:55 On Fri, Mar 11, 2011 at 9:50 AM, Jes Sorensen wro= te: > 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.=A0 If you have the following: qemu-img create -f qcow2 -o backing_file=3Dmaster.img,backing_fmt=3Draw 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.=A0 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 =0A=0A=0A --0-193469796-1299870741=:19420 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Thank you Stefan that does clarify on how to = correctly use "qemu-img commit "

Regards
sl

--- On Fri,= 11/3/11, Stefan Hajnoczi <stefanha@gmail.com> wrote:
<= blockquote style=3D"border-left: 2px solid rgb(16, 16, 255); margin-left: 5= px; padding-left: 5px;">
From: Stefan Hajnoczi <stefanha@gmail.com>= ;
Subject: Re: [Qemu-devel] Issue with snapshot outside qcow2 disk - qem= u 0.14.0
To: "SAURAV LAHIRI" <saurav_lahiri@yahoo.com>
Cc: "Jes= Sorensen" <Jes.Sorensen@redhat.com>, qemu-devel@nongnu.org
Date: = Friday, 11 March, 2011, 7:55

On Fri, Mar 11= , 2011 at 9:50 AM, Jes Sorensen <Jes.Sorensen@redha= t.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 rega= rd to merging changes, assuming that we go snapshot_blkdev
>> righ= taway. 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 pract= ical approach(since vm shutdown would not
>> be required).
>= >
>> Also incase If i have interpreted "qemu-img convert" incor= rectly and
>> does require a VM shutdown. Then when is expected ti= me when the "live
>> merge" will be available.
>
> I b= elieve commit only applies to images with internal files. If you use
Nope, qemu-img commit only applies to images with backing files (aka
ex= ternal snapshots).

> convert then it doesn't modify the actual images, so lets say you have a
> chain like this:
>
= > original->snapshotA->snapshotB
>
> original and snap= shotA are read-only when snapshotB is running.
> Therefore you should= be able to use convert to simply copy snapshotA
> into a new image f= ile snapshotX and save that for your backup. If you
> later restore, = you have a single image file you can boot from.
>
> What you ca= nnot 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 c= ommit merges the deltas from a qcow2 (or qed or other
copy-on-write imag= e format) into the backing file.  If you have the
following:
qemu-img create -f qcow2 -o backing_file=3Dmaster.img,backing_fmt=3Drawinstance.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-i= mg commit so that
you can move back to the original disk image file whic= h has now been
updated with the deltas.  You no longer need the fil= e 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 i= nto 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
=

=0A=0A=0A --0-193469796-1299870741=:19420--