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] cluster snapshots

To: Shirley Robles <shirleyroblesmax@xxxxxxxxxxx>
Subject: Re: [Xen-users] cluster snapshots
From: Mike Lovell <mike@xxxxxxxxxxxx>
Date: Sun, 14 Jun 2009 22:30:20 -0600
Cc: xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Sun, 14 Jun 2009 21:31:14 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <BAY139-W142A1669901A285EC83230CE400@xxxxxxx>
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: <BAY139-W142A1669901A285EC83230CE400@xxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1b3pre) Gecko/20090223 Thunderbird/3.0b2
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
<Prev in Thread] Current Thread [Next in Thread>