Aclhk Aclhk
2009-Aug-15 15:47 UTC
[Xen-users] snapshot backup at iscsi or dom0, which one is better?
dom0 mounts disk from iscsi server lvm. domU mounts dom0 lvm. pls kindly advise which one is better. Yahoo!香港提供網上安全攻略,教你如何防範黑客! 請前往 http://hk.promo.yahoo.com/security/ 了解更多! _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Simon Hobson
2009-Aug-15 19:29 UTC
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. -- 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 Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
xensource@pivert.org
2009-Aug-17 10:22 UTC
Re: [Xen-users] snapshot backup at iscsi or dom0, which one is better?
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@thehobsons.co.uk> To: xen-users@lists.xensource.com 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. -- 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 Xen-users@lists.xensource.com http://lists.xensource.com/xen-users _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Valtteri Kiviniemi
2009-Aug-17 11:41 UTC
Re: [Xen-users] snapshot backup at iscsi or dom0, which one is better?
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@pivert.org 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@thehobsons.co.uk> > To: xen-users@lists.xensource.com > 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@lists.xensource.com > http://lists.xensource.com/xen-users_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Fajar A. Nugraha
2009-Aug-18 02:45 UTC
Re: [Xen-users] snapshot backup at iscsi or dom0, which one is better?
On Sun, Aug 16, 2009 at 2:29 AM, Simon Hobson<linux@thehobsons.co.uk> wrote:> 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.Correct> 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.Depending on how you use it, it might not be the same. If you do LVM on dom0 and want to create backups on iscsi server, you need to snapshot all PVs exported on iscsi server that belongs to the same VG at the SAME TIME. On zfs this can be achieved using "zfs snapshot -r". Another way to work around this is to have each dom0''s VG using only one PV.> > 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.Correct. But most some applications have some sort of journaling method, plus disk flushes at critical times, that allows them to cleanly recover from "pulling-the-power-plug" type of failures. Some example of those applications : Oracle database (when using archive log), MySQL database (when using Innodb and configured correctly), Lotus Domino. If you''re using these kind of applications then snapshot backup is a good strategy. -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users