[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] What kind of situation to use internal or external snap
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] What kind of situation to use internal or external snapshot? |
Date: |
Fri, 14 Sep 2018 09:22:23 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 |
On 9/13/18 10:58 PM, lampahome wrote:
In general case, what's difference between internal and external snapshot?
You may find my KVM forum presentation from 2015 useful:
http://events17.linuxfoundation.org/sites/events/files/slides/2015-qcow2-expanded.pdf
Internal snapshots use reference counting to share clusters between the
snapshot and the live image; reads are always from a cluster in the
current image, and writing to a shared cluster decreases the refcount on
the existing cluster and writes the new data to a new cluster (using
copy-on-write to widen any short writes up to cluster boundaries with
the rest of the cluster populated from the shared cluster). External
snapshots use sparse allocation, where writes always go to the current
image (using copy-on-write to widen any short writes up to cluster
boundaries with the rest of the cluster populated from the backing
file), and reads defer to the backing image if the cluster is not
present in the current image. There are slight differences in the
amount of overall qcow2 metadata stored for the two approaches, but in
general, if your original image has 1G data allocated, then you create
the snapshot (either internally or externally), then the guest writes
512M more all to regions of the storage that were used prior to the
snapshot, then the overall storage used by either approach is
approximately 1.5G. Reverting to an internal snapshot is a matter of
switching which L1/L2 tables are active. Reverting to an external
snapshot is going back to the file that became the backing file at the
time you created the new overlay.
I mean in some user situation.
There a pros and cons to both approaches, but my personal take is that
there are more benefits for using external snapshots, especially if you
want quick answers from the list in supporting particular issues you
might encounter.
Ex: If I want to all snapshots in only one qcow2, I should use internal
snapshot.
If your file is big enough for that, then yes, that's one reason to use
internal snapshots. But in your other email, you're already mentioning
that you are already having issues with trying to host a 32T guest image
in a single file - if you add internal snapshots to that file, the host
storage consumption by that file can easily exceed the amount of storage
visible to the guest through any one of those snapshots.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org