Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
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 1 '11 at 9:28
    
I think that to consolidate a snapshot i've to delete the intermediate snapshots. –  nevios Jun 1 '11 at 14:54
add comment

1 Answer 1

up vote 0 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.