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

Re: [Xen-users] Backup domU

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



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