[virt-tools-list] Best way to backup my VMs

Daniel Berteaud dani at firewall-services.com
Tue Apr 12 16:17:28 UTC 2011


Le mardi 12 avril 2011 à 11:10 -0300, Bruno Lamps a écrit :
> Hi,

Hi

> 
> I'm slowly upgrading the virtualization infrastructure in the company
> I work for (a local SMB, in Brazil's northeast), from old Xen vms to
> upgraded KVM machines. At this moment, we already have important
> systems, like our proxy and our credit-card processing machine,
> running in production with KVM for about 60 days. We are just a few
> weeks away to delete our last xen machine, and be running only KVM
> guests in our servers.
> 
> Our old backup solution - not implemented by me - consists in rsync
> the xen VM disk images every night in other servers, while the zen VMs
> still running. I don't think it's a safe backup, and the only time I
> needed to restore a backup made this way, the restored machine
> suffered data corruption, mailboxes were lost (!!!).
> 
> So I see this migration from xen to KVM as an opportunity to put some
> decent backup running here. And I need suggestions. =]

You can take a look at this script:
http://repo.firewall-services.com/misc/virt/virt-backup.pl

I wrote it to backup my KVM guests in a clean way. It's better if you
use LVM volume for guest disks, as the script can suspend the guest,
take a LVM snapshot of every disk, resume the guest (so the downtime is
really minimal), then, dump the snapshot in the background, and remove
the snapshot at the end. It'll still work for image based disks, but the
guest will need to be suspended during the backup.

There's also some options, like on-the-fly compression of the disk
dumps, and state backup (equivalent of virsh save), so you can restore
your guests at the exact state it was when you made the backup
(including running programs, and not yet written on disk data), the
possibility to exclude some disks, or backup several VM in one run.

I'm using it for about 2 years now to take daily backups of all my
guests.

Regards, Daniel

> 
> Is it possible to "pause" a machine with a simple command, rsync the
> machine's HD image in other computer and then safelly resume the
> machine? Is it necessary to shut down the virtual machine, in order to
> make this backup?
> 
> Thanks in advance for any suggestion, and sorry about my broken
> english. ;D
> 
> -----
> Att,
> Bruno Menezes
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list

-- 
Daniel Berteaud
FIREWALL-SERVICES SARL.
Société de Services en Logiciels Libres
Technopôle Montesquieu
33650 MARTILLAC
Tel : 05 56 64 15 32
Fax : 05 56 64 15 32
Mail: daniel at firewall-services.com
Web : http://www.firewall-services.com




More information about the virt-tools-list mailing list