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?

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).

  • thanks, yes I'm using rsnaphot for files and rsync for the VMs themselves. I hadn't thought of just freezing them for the duration - that may well be possible. – user83664 Oct 16 '11 at 19:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy