Snapshot/rollback in Kvm using DRBD

drbdhigh-availabilitykvm-virtualizationlibvirt

I want to use the HA on a virtual machine on two server using KVM/libvirt.

I placed the image on a partition using DRBD.

I'm using the qcow2 format and i'm taking the snapshot, using virsh snapshot-create vm

I think that it saves it in the qcow2 image. But it creates the xml doc in the /var/lib/libvirt/qemu/snapshot/vm/1306756846.xml. When an host crushes, the other server is not able to see the snapshot unless i copy the snapshot file.

It is also possible to consolidate snapshot?

Best Answer

I believe the XML file is just something virsh creates for the own bookkeeping and thus redundant.

You should be able to see the snapshot information in the qcow2 file using the qemu-img info <filename> command and revert to them using qemu-img snapshot -a <snapshot-name> <filename>.

Edit: according to the docs, a memory snapshot should have been created as well when using virsh create-snapshot. I have no idea where this one is going, but if you want more than just disk states, you should take care of the XML file to be copied as well - maybe by creating a symlink for /var/lib/libvirt/qemu/snapshot/vm/ to point at a directory in your DRBD-replicated volume.