2

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?

nevios
  • 120
  • 1
  • 1
  • 7
  • Are you saying that the snapshot file isn't being duplicated in the first place? Is that /var/lib/etc.... directory on the DRBD volume? – Bart Silverstrim May 31 '11 at 11:51
  • no the directory is not on the DRBD volume, and so i must copy it unless i link the directory on a folder on the DRBD volume. But I don't know if this is a good way to do it. – nevios Jun 01 '11 at 09:28
  • I think that to consolidate a snapshot i've to delete the intermediate snapshots. – nevios Jun 01 '11 at 14:54

1 Answers1

1

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.

the-wabbit
  • 40,319
  • 13
  • 105
  • 169