Storage

Creating Backups & Clones Of Running Virtual Machines (No Downtime) With LVM Snapshots

use LVM volumes for your VirtualBox VMs This lesson shows using LVM snapshots to create backups and clones of running VirtualBox VMs without downtime

1 Preliminary Note

Installed VirtualBox on a headless server use phpvirtualbox as the VirtualBox GUI here. use the original VirtualBox GUI then only it will be perfect.

Running virtual machine named vm10 located on the LVM volume /dev/vg0/vm10.

logged in as root

sudo su

Should run as root user

2 Create A Backup Of A Running VM With LVM Snapshots

create a backup of the running virtual machine vm10 Snapshots can be smaller than the original volume – 512MB

lvcreate -L5G -s -n vm10_snap /dev/vg0/vm10

use dd to read the contents from the snapshot and pipe it to gzip to create a gzipped backup image in the directory

dd if=/dev/vg0/vm10_snap bs=64k | gzip -c > /backup/vm10.img.gz

your backup of vm10 is now located in /backup/vm10.img.gz.

remove the LVM snapshot

Continue reading “Creating Backups & Clones Of Running Virtual Machines (No Downtime) With LVM Snapshots” »

Be the first to comment - What do you think?  Posted by Aniruddh - August 8, 2012 at 6:09 pm

Categories: Backup, Linux, Storage   Tags: