qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Can I convert backing file to internal snapshot?


From: Eric Blake
Subject: Re: [Qemu-devel] Can I convert backing file to internal snapshot?
Date: Fri, 14 Sep 2018 09:52:51 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0

On 9/14/18 1:05 AM, Fam Zheng wrote:
On Fri, 09/14 12:23, lampahome wrote:
Can I convert from internap snapshot to external snapshot?
If there's 3 snapshots in one qcow2, can I convert them all to external
snapshots?

Qcow2 doesn't track internal snapshot dependencies like external snapshot, so
there is no direct way to create the "differentiative" or "delta" images in the
same way as would be with external snapshots. In theory it's possible to convert
all internal snapshots to separate full images then create delta by
sector-by-sector comparison.

In fact, qemu-img documents that you can do:

           You can use "rebase" to perform a "diff" operation on two disk
images. This can be useful when you have copied or cloned a guest,
           and you want to get back to a thin image on top of a template or
           base image.

           Say that "base.img" has been cloned as "modified.img" by copying
it, and that the "modified.img" guest has run so there are now some changes compared to "base.img". To construct a thin image called
           "diff.qcow2" that contains just the differences, do:

                   qemu-img create -f qcow2 -b modified.img diff.qcow2
                   qemu-img rebase -b base.img diff.qcow2

At this point, "modified.img" can be discarded, since "base.img +
           diff.qcow2" contains the same information.


So yes, the process is to first use multiple 'qemu-img convert -l' to extract the separate points in time into separate files, and then 'qemu-img rebase' as above to convert those separate points in time back into differential files.

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



reply via email to

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