[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-users] Perfectly consistent zero-downtime backup

As far as I know the only way to get a *fully consistent* backup of a xen VM is shutting down the virtual machine, creating an LVM snapshot and starting the VM again. Unfortunately the downtime is non-trivial and you need to shutdown the machine (which may not be a desired behaviour).

Another alternative is saving the machine state, creating an LVM snapshot and restoring the machine. You can get a fully consistent backup saving the machine state (basically the ram dump) alongside with the disk image. Saving and restoring the vm takes a while, but if you use ramfs to store the dump you can get nearly-zero down time. Unfortunately this kind of backup is far from perfect because you will still need to restore the machine to get a consistent state and it may be non-trivial if you have to do it in another machine (for example because of a dom0 failure).

I thought a third, better way which has the benefits of both previous options:
- save the machine state in ramfs
- create a read/*write* LVM snapshot
- restore the machine state from ramfs
- you have a copy of the machine state in ramfs and a vm snapshot thanks to LVM, so you can strip attached networks from the config in the head of the state dump, change the vm name and point the vm disk to the read/*write* LVM snapshot - xm restore the backup using the machine state you just edited (you can run the backup alongside with the original machine because you changed the name, stripped the networks and pointed the disk to the read/*write* snapshot)
- shutdown the backup VM
- do a fully consistent backup from the lvm snapshot
- remove the lvm snapshot

What do you think about it? Is it feasible?


Xen-users mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.