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

Re: [Xen-users] cluster snapshots



On 6/13/2009 4:43 PM, Shirley Robles wrote:
Hi,

I am looking at doing LV cluster snapshots. I want to know if this is possible and what is the procedure.

This has been a topic of discussion on the list multiple times. It seems that the general advice is if you can do backup using software inside of the guest domain, you should go that route and not try LVM. If you are using a LV as a physical device for a guest domain, you can do a snapshot of it in the host and take a backup of it. The problem is that if the device is mounted read-write in the guest domain, when you create the snapshot, you get a snapshot of a mounted volume. It would be in a state similar to if you had just destroyed the guest causing an unclean shutdown. In some cases, this state might still be useful. But in others, it would yield a backup that isn't usable as not all of the data has been written to the volume. So if you have something that is critical or easily prone to data loss, I would recommend going another route.

That all being said, if you still want to try doing this, you can use a procedure similar to this to do it.

xm sysrq <guest> s    # send a sysrq to the guest telling it to sync its disks. hopefully reducing problems on unclean volumes
lvcreate -s -L 10GB -n guest-backup /path/to/guest/lv    # create a snapshot
mount /path/to/guest-backup /tmp/directory    # mount the snapshot to a temporary directory. Some will say you should fsck before doing this.
cd /tmp/directory
tar jcvf /path/to/backup.tar.bz2 *    # this is how I do a backup on mine, you can us other methods like rsync if you want
cd    # get out of the mounted volume
umount /tmp/directory    # unmountt the temporary snapshot
lvremove -f /path/to/guest-backup    # destroy the LV snapshot

Hope that helps you out on this. Again, I recommend either using a method of backup from inside the guest or shutting down the guest during the backup. If you try this way, make sure you test restoring from backup on to another vm to make sure your data is intact. And I provide no warranty or guarantee on these direction. :)

Good Luck
_______________________________________________
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®.