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

Re: [Xen-users] Backup domU

To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-users] Backup domU
From: Simon Hobson <linux@xxxxxxxxxxxxxxxx>
Date: Sat, 9 Jul 2011 08:54:32 +0100
Delivery-date: Sat, 09 Jul 2011 01:15:17 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4E1764C7.3080900@xxxxxxxxxxxxxxxxx>
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/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <4E1764C7.3080900@xxxxxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
Kalil Costa - Brasilsite wrote:

I need to know which way to backup domU to restore these to another server if i've problem with this machine.

There are many ways, all with their pros and cons.

One suggestion given here in the past was to send a signal (with an xm command IIRC) to the guest (assuming guest with Xen support included) to tell the guest to sync it's unwritten buffers to disk. He then did a snapshot live via LVM.

Upside - no downtime on guest. Downside, your backups are of a mounted filesystem with open files, partially written files, whatever. Getting the guest to sync first reduces the impact so it's not quite the same as the backup being analogous to what you'd find on disk after pulling the power cord on a real machine.
The backup is also on the same disks as the live system.

You've just had a suggestion of stopping the guest before the LVM snapshot.
Upside - it's a 'clean' backup. Downsides - downtime for guest, backup still on the same disks.

As a variation, you could pause the guest and snapshot the LVM volumes **PLUS** save the guest saved state file. If you need to restore then the guest would unpause in the same state as when it was paused.


Personally I backup my guests as though they were real (non virtualised) machines. There are many options for this - both free and commercial.

At work I've setup a system where I have a VM dedicated just to holding backups of the other machines - each of which uses rsync to update a backup copy of itself on the backup server (the server runs rsync in server mode). Thus I have a server holding a complete image of each of my servers at the point they last backed up. Should a host go down, I can move the guests to another host by creating volumes for them and using rsync to pull their files back (mount the guest filesystems on the host, use rsync on the host to pull the files, unmount the filesystems and start the guest). Of course, once you are using rsync, then it doesnt' matter whether the destination is on the same host, another host in the same rack, or half way round the world - as long as you have enough bandwidth.

On my backup machine I then copy the copies to create various levels of historical backups. Again there are various ways of doing this, I settled on StoreBackup which if you disable compression creates full copies which you can just navigate into and use your normal unix/linux tools to access files*. It saves space by hard-linking identical files so it's fairly efficient. You can do something similar with rsync and some scripting. Another tool I looked at was rdiff-backup - but I didn't like the way you can't thin out your backups, and they aren't readable without going through the restore process.

* Just the other day I found this useful as I wanted to find out when a DNS record had changed. I was able to grep <something>/*/var/named/zones/<somezonefile> for the name in question and find out that it changed about a month ago - yes no-one had noticed a service was broken !
--
Simon Hobson

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.

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

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