From: Eric Blake <eblake@redhat.com>
To: Fam Zheng <famz@redhat.com>, lampahome <pahome.chen@mirlab.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Can I convert backing file to internal snapshot?
Date: Fri, 14 Sep 2018 09:52:51 -0500 [thread overview]
Message-ID: <f1681ab9-53a9-989c-b793-1f98ec38c5c7@redhat.com> (raw)
In-Reply-To: <20180914060543.GB3653@lemon.usersys.redhat.com>
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
prev parent reply other threads:[~2018-09-14 14:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-12 7:35 [Qemu-devel] Can I convert backing file to internal snapshot? lampahome
2018-09-12 7:44 ` Fam Zheng
2018-09-14 4:23 ` lampahome
2018-09-14 6:05 ` Fam Zheng
2018-09-14 14:52 ` Eric Blake [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f1681ab9-53a9-989c-b793-1f98ec38c5c7@redhat.com \
--to=eblake@redhat.com \
--cc=famz@redhat.com \
--cc=pahome.chen@mirlab.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).