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] snapshot backup at iscsi or dom0, which one is better?

Subject: Re: [Xen-users] snapshot backup at iscsi or dom0, which one is better?
From: Valtteri Kiviniemi <valtteri.kiviniemi@xxxxxxxxxxxx>
Date: Mon, 17 Aug 2009 14:41:33 +0300
Cc: xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 17 Aug 2009 04:42:19 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <16535698.581250504529539.JavaMail.root@akira>
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>
Organization: Dataproof
References: <16535698.581250504529539.JavaMail.root@akira>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.22 (Windows/20090605)
Hi,

This could also work:

Do a xm save <domU> /some/path/to/domU.save, then do the lvm-snapshot and then restore the domU with xm restore <domU> /some/path/to/domU.save.

Then just mount the snapshot-lv and backup it. You can also backup the file containing the domU memory (domU.save) so if the fs is inconsistent you could always make a new lv-device, extract the backup and start the domU again with xm restore <domU> /some/path/to/domU.save and in theory your fs would become consistent because you have the memory containing the unwritten changes to the fs.

I have used this method with my domU running MySQL-databases, and this has worked nicely.

- Valtteri Kiviniemi

xensource@xxxxxxxxxx kirjoitti:
Hi, I do not fully agree : In short - imagine pulling the power cord. You backup will be the equivalent of what's on the disk at the point you kill the power. Because when you issue a backup of your VM, you will always issue a sync in the VM just before. I had a script that for every vm listed in a file (ie /etc/xen/vm_to_backup), and issue : 1. xm sysrq <domUname> s && xm pause <domUname> (to sync the domU fs and pause it) 2. take the snapshot of the domU volume (every domU was on a dedicated lv, using linux lvm) 3. xm unpause <domUname> 4. mount the snapshot filsystem in readonly, backup the filesystem (ie using tar), unmount the snapshot and delete it. for every backup the domU was paused for less than 1 second, and this is not "equivalent of what's on the disk at the point you kill the power" as you do not sync the fs before killing the power. Killing the power is even worst because if you do not have a battery on your raid controller, you also loose all the datas in controller cache. This backup method is definitely not the best, and it's highly recommended to use it only journalised FS, however it's easier and far better than issuing a filesystem backup within the domU. If you have applications that manage their own cache such as DB, you cannot rely on any filesystem backup, except if you us a sync to flush the cache also in the application. With db, you should always read the recommendations from the provider : ie : use rman with oracle, put your tablespaces in backup mode with postgresql, ...

Regards, ----- Original Message ----- From: "Simon Hobson" <linux@xxxxxxxxxxxxxxxx> To: xen-users@xxxxxxxxxxxxxxxxxxx Sent: Saturday, 15 August, 2009 21:29:44 GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna Subject: Re: [Xen-users] snapshot backup at iscsi or dom0, which one is better? Aclhk Aclhk wrote:
dom0 mounts disk from iscsi server lvm. domU mounts dom0 lvm. pls kindly advise which one is better.

Neither can give you a clean backup - period. But beyond that, both will achieve the same effect - an image of a dirty disk that will need to be restored in it's entirety even if you only need on file from the backup. Either way will give you an image of a dirty disk partition, missing anything in the guests cache waiting to be written. And that's also ignoring applications (particularly databases) that have dirty data in their own cache. In short - imagine pulling the power cord. You backup will be the equivalent of what's on the disk at the point you kill the power. If you want a usable and clean backup - do it from within the guest (so it will include any dirty cache) and don't forget applications like databases that typically have to be shut down, put into some sort of backup mode, or perform a data dump in order to get a clean backup.


------------------------------------------------------------------------

_______________________________________________
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