[fedora-virt] Internal Snapshots & Used-Space

Kevin Wolf kwolf at redhat.com
Thu Oct 10 11:42:25 UTC 2013


Am 10.10.2013 um 13:26 hat Jorge Fábregas geschrieben:
> On 10/10/2013 04:04 AM, Kevin Wolf wrote:
> > I'm not even sure what the correct result would be. Internal snapshots
> > are independent from each other (i.e. there is no parent-child
> > relationship between them), so for which snapshot would a shared cluster
> > be accounted?
> 
> Hi Kevin,
> 
> I thought they worked like external snapshots (where one file depends on
> its backing file)...but that, for internal snapshots, all the mechanics
> happened within that single image.
> 
> Now that you mention that, I remembered doing some tests where I deleted
> a snapshot (that was the parent of another one conceptually-wise) and
> found out the child still worked afterwards.
> 
> Now I'm wondering what really happens when you take the internal
> snapshot contrary to an external one.  Are internal snaphots less
> efficient storage-wise?

qcow2 has a reference count for each cluster. Taking a snapshot
basically means increasing the refcount of each currently used cluster,
it's not much more. Deleting a snapshot means decreasing the refcount,
and only once the refcount reaches zero, the cluster is freed. (Which
is, by the way, a much cheaper operation than deleting an external
snapshot, which means moving actual user data to a different image.)

So no, it's not less efficient, there is no duplication of data, but
data is kept as long as there is still a snapshot using it.

Kevin


More information about the virt mailing list