WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

[Xen-users] Re: 100% safe way to backup domU: (was Yet another backup)

To: Ligesh <myself@xxxxxxxxxx>
Subject: [Xen-users] Re: 100% safe way to backup domU: (was Yet another backup)
From: Mark Williamson <mark.williamson@xxxxxxxxxxxx>
Date: Fri, 12 Jan 2007 15:52:18 +0000
Cc: Ulrich Windl <ulrich.windl@xxxxxxxxxxxxxxxxxxxx>, Roger Lucas <roger@xxxxxxxxxxxxx>, xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 12 Jan 2007 07:49:33 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20070112101127.GA23576@xxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <200610210406.25460.mark.williamson@xxxxxxxxxxxx> <200701120328.15461.mark.williamson@xxxxxxxxxxxx> <20070112101127.GA23576@xxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.9.5
>  Is there a way to get a complete image out of an LVM? The only way I found
> to extract files from an LVM snapshot was to mount it, but when you do that
> you are mounting a badly corrupted file system, and trying to take backup
> from it.

I think you should just be able to backup the device file that you'd usually 
mount.  Just treat the snapshot's device file as *the* file to backup.

> Of course, mounted incremental backups leads to greater 
> flexibility, much faster storage etc, but if you can tell me a way to get
> the image out of an LVM, then that would suffice for now, and considering
> that rsync has a nice protocol, it might even be faster, since it doesn't
> have to check so many files. We have to keep taking binary diffs to have
> multiple incremental copies.

Take a look at: http://www.nongnu.org/rdiff-backup/

If you can find a configuration that works for you, rdiff-backup will do 
point-in-time backups for you.  You'll want the device file name for the LVM 
snapshot to be the same each time so it knows it needs to do a binary diff of 
the contents.

The simple way to do this would be to dd the data from the LVM device (a bit 
slow, but it's not on the critical path):

rm /backup/temp/*
xm save guest /backup/temp/gueststate.save
do LVM snapshot
xm restore /backup/temp/gueststate.save
dd if=/dev/thelvmsnapshotdevice of=/backup/temp/guestdisk
rdiff-backup /backup/temp/ /backup/my-vm-history/
destroy LVM snapshot device
repeat for next VM

This will create a historical record of guest memory and disk states 
in /backup/my-vm-history, which will allow you to check out a consistent 
guest memory / disk state from the most recent backup from any point in time.

This is just an example.  Obviously the dd stage copies the entire contents of 
the device file, which is not ideal - it's time consuming and wasteful in 
storage bandwidth.  A more clever setup would seek to eliminate this and do 
the binary diffing directly as the data is pulled off the snapshot device.

Might be possible to do that by clever configuration, and certainly would be 
possible with a little hacking of rdiff-backup itself.  The resulting 
software would be ideal for maintaining point-in-time guest checkpoints - 
very cool.

Btw, another checkpointing patch has been posted on xen-devel (eliminating the 
need to do a restore of the guest after the snapshot)

Cheers,
Mark

-- 
Dave: Just a question. What use is a unicyle with no seat?  And no pedals!
Mark: To answer a question with a question: What use is a skateboard?
Dave: Skateboards have wheels.
Mark: My wheel has a wheel!

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users

<Prev in Thread] Current Thread [Next in Thread>