KVM Hosting: How to efficiently replicate guests

Posted by javano on Server Fault See other posts from Server Fault or by javano
Published on 2012-08-21T10:10:44Z Indexed on 2012/10/18 11:03 UTC
Read the original article Hit count: 245

I have three KVM servers each with 1 guest VM, running directly on it's local storage, (so they are essentially getting a dedicated box worth of computing power each). In the event of a host failure I would like the guests replicated to at least one of the other hosts so I can spin it up there, until the failing host is fixed.

I am curious about KVM cloning. I can clone a VM live or when it's suspended/shutdown. Obivously suspended VMs will naturally be quicker to clone but these three VMs comprise three parts of a single solution, so I don't want to ever have any one of them shutdown.

How can I efficiently clone these VMs between servers?

I have had a couple of ideas, but are these insane or, is there a better method I have missed for my scenario?

  1. Set up a DRDB partition between box 1 and 2 where VM 1 runs from, and so is replicated between box1 and box 2, repeat between box 2 & 3, and box 3 & 1 (This could be insane, I have never used DRDB only read about it)

  2. Just use standard KVM CLI clone options to perform live clones (I'm dubious about this because I don't know how long it will take and what the performance impact will be during)

  3. Run a copy of each VM on at least one other host, and have the guest on one host export it's data to the matching guest on another host where it can import that data, scripting this on the guest)

  4. Some of other way? Ideas welcome!

Side Note

These servers have 4x15k SAS drives in a RAID 10 so they aren't rocketing fast, and as I mentioned, each VM runs from the host's local storage, no NAS or SAN etc. So that is why I am asking this question about guest replication. Also, this isn't about disaster recovery. Guests will be exporting their data to a NAS over a VPN, so I am looking at how I can have them quickly spun up in a host failure situation.

© Server Fault or respective owner

Related posts about virtual-machines

Related posts about kvm-virtualization