Linux – Backup Xen domU machines while running

backupcentoslinuxlvmxen

The host machine is running CentOS 5.3 and using LVM to create Logical Volumes (LVs) and to allow live snapshots to be taken of those LVs. My thought was to store all of the image files for the Xen underpriviledged domains (domU) in a single LV and periodically take a snapshot of that LV and copy the disk images out of the snapshot in order to make a live backup of these systems. Is this doable? Is there a better way?

Thanks!

Best Answer

Real "live" backups aren't exactly doable.

In theory, the best you can get - when using LVM - is a few seconds of "pause" time, which should be fine: a domU would need to - sync it's disks, pause/suspend, backup data, and resume.

However, there are a few "gotchas" with this approach (as opposed to just shutting down the machine) that need to be addressed.

The main issue is the consistency of the domU filesystem - have a look at thoughts-xen-filesystem-configuration-regard-backups for a more complete explanation.