All, Using Centos 6.4 with provided libvirt: [root@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. - Then define (and start) this VM. The new VM does not have the list of snapshots. Is there a way with virsh to rebuild the metadata such that libvirt "knows" about the snapshots in the "disk stack"? Harald
On 08/27/2013 08:17 PM, Skardal, Harald wrote:> All, > > Using Centos 6.4 with provided libvirt: > [root@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@redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-users >-- /kashyap
On 08/27/2013 08:47 AM, Skardal, Harald wrote:> All, > > Using Centos 6.4 with provided libvirt: > [root@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. > > - Then define (and start) this VM. > > The new VM does not have the list of snapshots. > > Is there a way with virsh to rebuild the metadata such that libvirt "knows" about the snapshots in the "disk stack"?If you saved off the snapshot XML ('virsh snapshot-dumpxml $dom $name' for each name in 'virsh snapshot-list $dom', and paying attention to which one (if any) was the current snapshot with 'virsh snapshot-current --name $dom'), then recreating that stack can be done with 'virsh snapshot-create --redefine $dom $file [--current]' for each file of your saved stack. When it comes to migrating a domain with snapshots, this process of defining the snapshots manually on the destination then undefining them on the source, is still the only currently supported way (as actually migrating snapshots requires a change to the RPC protocol used to drive migration, as it requires passing potentially large amounts of data that will not fit in a single migration cookie). -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org