[Cialug] VMs & Replication

Matthew Steven matthew at geniusweb.com
Fri Mar 18 12:19:46 CDT 2011


Lee,

I set up a number of HA hosting environment with geographically 
separated machines using VMs, trying to keep it as simple/cheap as possible.

My VM software choice has been xen, with VMs on LVM2 volumes. Good 
performance, though you may need to do some hacking to set xen up in 
some distros nowadays. Linux kvm may also work for this strategy- using 
the virt-manager program is very similar to virtualbox in practice. 
Convirt/Convirt2 also is supposed to work with either xen or kvm and is 
pretty nice looking.

The main thing that applies to off-site replication is this: Since every 
VM's storage is on LVM, I simply use the snapshot feature of LVM (copy 
on write, not a big burden to io) on the host system (aka dom0) to get a 
safe copy of the VM's drive contents to another host regularly. Set up 
snapshot, rsync to standby, destroy snapshot. Easy and fast.

Since my main concern is backups, I use a combination of rsync and 
rdiff-backup for this because it is pretty efficient and does 
incrementals back as far as the disk space allows. I can't count the 
number of times I've saved my customer's bacon by having a few weeks of 
increments: people have lousy backup habits. Very little extra effort 
for a lot of gratitude.

If you're only concerned with having a backup, you could stop there. But 
if you wanted to have a second VM on standby, you could easily copy your 
virtual machine config files to the standby host and use rsync to keep 
things synced pretty close with a minimum of overhead.

You can keep the switchover config file changes minimized by using 
sensible naming conventions and having scripts pre-written to do the 
switch for anything that will be different (like IP addresses, or 
possibly storage device/network interface names on udev).

Always do a dry run to make sure it's going to work smoothly. It's very 
easy to miss something and do a lot of sweating when it's time to bring 
the standby host online.

Good luck,
Matt


On 01/-10/-28163 01:59 PM, L. V. Lammert wrote:
> Have a project to setup some VMs at a site, and have them replicated
> offsite on a regular basis using OS tools.
>
> I know that VirtualBox has snapshot capability and now migration, has
> anyone tried it in this type of environment? Is there another OS solution
> to consider?
>
> 	Lee
>

-- 
Matthew Steven
http://www.geniusweb.com/
(515) 999 0842



More information about the Cialug mailing list