So, while kvm keeps the xml describing a running domain in
/var/run/libvirt/qemu, it turns out this isn’t exactly the cleanest thing to backup. I HAD been doing this, with a simple rsync, but realizing this I decided we should do it propper, with libvirt runy bindings and all. So, here it is:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Pretty simple. Figure out the hostname (this is deployed to multiple kvm hosts), get the list of domains running here, itterate on each one and get the name and xml, and populate a hash with these. Then, itterate that hash dumping the xml into a file on our shared storage, which is in turn checkpointed and backed up. Ta da.