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

Re: [Xen-users] Re: FW: Xen Backups



On Sunday 01 June 2008 15:33:32 Christian Tramnitz wrote:
> I guess most people would like to avoid the necessary downtime.
> On the other hand, when doing live-snapshots (i.e. LVM snapshot target),
> live-data may be corrupt (open file handles, databases)...

I actually run a script on the host that does the following:
All activities on the guest are done using SSH and shared key authentication

1) Stop the service(s) on the guest
2) Unmount the filesystem(s) on the guest to be backed up
3) detach the filesystems (xm block-detach <domain> <hd??/sd??>)
4) create snapshots
5) reattach the filesystems (xm block-attach <domain> <device> <hd??/sd??> w)
6) remount the filesystems on the guest
7) Restart the service(s) on the guest

I can then backup the filesystems using the snapshots and remove the snapshots 
when the backups are finished.
Using this, the total 'downtime' is around 40 seconds (on my system) to:
- stop and start 3 services
- backup OpenLDAP and PostgreSQL
- unmount / mount 6 filesystems
- detach / attach 6 filesystems
- create 6 snapshots

The script I use also has error-handling implemented in case any action fails. 
This will prevent, for example, a detach-attempt to take place on still 
mounted filesystems.

HTH,

Joost Roeleveld

>
> Best regards,
>     Christian
>
> James Alspach wrote:
> > How do most people backup their VM’s?  I understand that the suggested
> > method right now is to install your backup client just as you would if
> > you were backing up a physical server.  It just feels like you should be
> > able to snapshot the entire VM instead of worrying about just the data.
> >
> > For instance, how difficult it would be to script taking a VM offline,
> > exporting it and then bringing it back online.  To me this sounds like a
> > good way to backup your VM’s  (as long as you can stand them being
> > offline for some amount of time while they export).  If you could back
> > up this way recovering from a disaster should be fairly painless. Just
> > reinstall Xensource, hook it back up to the SAN and import the
> > VM’s…done.  What am I missing? Is it the size of the VM’s that keeps
> > this from being viable?
> >
> >
> >
> > Thanks for your help;
> >
> > James
>
> _______________________________________________
> Xen-users mailing list
> Xen-users@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-users



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


 


Rackspace

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