Comments on VirtualBox: Creating Backups & Clones Of Running Virtual Machines (No Downtime) With LVM Snapshots
VirtualBox: Creating Backups & Clones Of Running Virtual Machines (No Downtime) With LVM Snapshots If you use LVM volumes for your VirtualBox VMs, you can create backups and clones of a running VM without shutting it down. This tutorial shows just that: using LVM snapshots to create backups and clones of running VirtualBox VMs without downtime.
4 Comment(s)
Comments
With the same LVM concepts in mind I wrote BDsync (bdsync.rolf-fokkens.nl) to make a network backup, so BDsync may be useful for VirtualBox users.
For application software it's like the server rebooted after an unexpected crash (e.g. powerfailure). If the software cannot survive such a crash, this way to make a backup may not be useful for the software.
One detail I'm not sure of: as a KVM user I make sure that all caching is 'writethrough' to make sure that the data the guest writes to (virtual) disk is actually written to disk. I'm not an expert VirtualBox user, but I'm sure this kind of caching is important for VirtualBox guests as well.
You need to understand how databases work, they operate with on disk data as well as in memory data (data not yet written to disk); also, you cannot rely on file systems to write everything to disk. A cleanup shutdown, snapshot and startup is much safer.
The above is all well and good, so long as the backup / restore can survive running processes during the backup -- particularly database processes.
I prefer to create a snapshot immediately after shutting down the VM and then once the snapshot has been created, to restart the VM and backup using rsync via the snapshot. Then with a fully consistent backup, I also dump the filesystem (unmounted of course).