qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Issue with snapshot outside qcow2 disk - qemu 0.14.0


From: SAURAV LAHIRI
Subject: Re: [Qemu-devel] Issue with snapshot outside qcow2 disk - qemu 0.14.0
Date: Fri, 11 Mar 2011 11:12:21 -0800 (PST)

Thank you Stefan that does clarify on how to correctly use "qemu-img commit "

Regards
sl

--- On Fri, 11/3/11, Stefan Hajnoczi <address@hidden> wrote:

From: Stefan Hajnoczi <address@hidden>
Subject: Re: [Qemu-devel] Issue with snapshot outside qcow2 disk - qemu 0.14.0
To: "SAURAV LAHIRI" <address@hidden>
Cc: "Jes Sorensen" <address@hidden>, address@hidden
Date: Friday, 11 March, 2011, 7:55

On Fri, Mar 11, 2011 at 9:50 AM, Jes Sorensen <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]