[libvirt-users] Defining VM with snapshots?

Kashyap Chamarthy kchamart at redhat.com
Tue Aug 27 18:36:07 UTC 2013


On 08/27/2013 08:17 PM, Skardal, Harald wrote:
> All,
> 
> Using Centos 6.4 with provided libvirt:
> [root at node1 ~]# rpm -q libvirt
> libvirt-1.0.1-2.el6.x86_64
> 
> 
> Assume a VM with one or more live snapshots.
> In virsh the VM snapshots can be listed.
> 
> With virsh:
> 
> 
> -          Stop and undefine this VM.

If you have snapshots, then just undefining will not work. You also have to undefine the
snapshot-metadata

If you have two snapshots named snap1, snap2 for v1, you also need to do:

  $ virsh snapshot-delete --domain vm1 snap1 --metadata
  $ virsh snapshot-delete --domain vm1 snap2 --metadata

NOTE - The above will only delete the libvirt snapshot metadata, but leaves the content
behind.

> 
> -          Then define (and start) this VM.


Snapshot XMLs are located here (assuming you haven't deleted libvirt metadata already):
/var/lib/libvirt/qemu/snapshot/. You can define these and try?

> 
> The new VM does not have the list of snapshots.

What is your goal? A clone of a VM with its associated snapshots?

> 
> Is there a way with virsh to rebuild the metadata such that libvirt "knows" about the snapshots in the "disk stack"?

Defining the snapshot XMLs should make that possible.

Hope the above gives you some clues.

> 
>         Harald
> 
> 
> 
> _______________________________________________
> libvirt-users mailing list
> libvirt-users at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-users
> 


-- 
/kashyap




More information about the libvirt-users mailing list