How to take periodic snapshots of VMs and efficiently transport them off-site

disaster-recoverykvm-virtualizationrsyncsnapshot

I'm running KVM on Debian Squeeze and have VMs ranging from Debian to Windows Server 2003 to XP and W7

My plan is to move these VMs to qcow2 and use libvirt's snapshot-create to take periodic snapshots and rsync to copy the images to a remote site. I am happy to lose the running state and all changes since the last snapshot – this is only part of the overall backup strategy.

  • Am I right to assume I need to take an underlying LVM snapshot and run rsync from that to avoid corruption?
  • Will rsync efficiently copy only the tail-end of the image file that has changed since the previous rsync?

Best Answer

LVM snapshot are required if you can't pause for a few minutes running VMs during the backup procedure. If isn't critical for your applications, for every VM, you can freeze it when the backup procedure starts, rsync its virtual disk where you like, and finally resume it.

Rsync is a great tool, but keep in consideration that keeping incremental backups is generally more "secure" than keeping a daily rsynced copy: I use a combo of a shell script to rsync disk images, and a centralized backuppc server that acquire incremental backups of VM files (internal, not the disk images).

Related Topic