[libvirt-users] Create qcow2 v3 volumes via libvirt

Kashyap Chamarthy kchamart at redhat.com
Fri May 4 08:26:46 UTC 2018


On Wed, May 02, 2018 at 02:45:05PM +0200, Gionatan Danti wrote:
> On 01/05/2018 22:49, Gionatan Danti wrote:
> > Ok, I think I'll continue to use RAW images + filesystem snapshots +
> > external snapshot when required.
> > It is unfortunate that we have no GUI to manage external snapshots. I
> > even remember that external snapshot remove was not supported - I had to
> > use the --metadata flag and a plain "rm" to remove them (or using
> > --no-metadata in the first place)[1]. Does it remain the current
> > behavior?

Yes, you still have to clean up external snapshot metadata manually, as
the link below indicates.  Deleting external snapshots is a non-trivial
problem.  For example, if you have a disk image chain like:

    [A] <-- [B] <-- [C] <-- [D]
    
Now if you no longer need image [B], what is the most efficient way to
get rid of it?  Three possibilities:

  - Merge [B] into [A], and rewrite the backing chain of [C]
    to point to [A].  Now can you discard image [B].
  - Merge [A] into [B], call the new image [AB].  Now you can
    discard [A].  
  - Merge [B] into [C], and rewrite the backing chain of [C] to point to
    [A].  Now you can discard image [B].
    
It depends on how large each of the disk images are, and based on the
size, merge / coalesce them accordingly, to arrive at the quickest
solution.

Note that existing commands (`virsh blockpull` and `virsh blockcommit`,
which is relatively faster) will allow you handle it manually or script
it -- which many people already do it.

A couple of references (that are also easily scriptable):

    http://wiki.libvirt.org/page/Live-merge-an-entire-disk-image-chain-including-current-active-disk
    https://wiki.libvirt.org/page/Live-disk-backup-with-active-blockcommit

> > [1]
> > https://www.redhat.com/archives/libvirt-users/2015-September/msg00037.html
> 
> Any hope to get virsh external snapshot creation/deletion fixed?

I don't see any problem creation external snapshots (or more correctly:
"overlays").  Deletion of external snapshots involves a bit more work,
but it is scriptable as well.


[...]

-- 
/kashyap




More information about the libvirt-users mailing list