Hi all I''d like to know if it''s possible to clone a running domU. I need to make an exact copy of an existing CentOS xen domU, but without taking it offline. I''m using LVM, so I don''t know if it will help. I have tried doing it with dd, after shutting down the domU, but it takes ages. The LVM image is 30GB. I can''t really afford to have the running one off line that long, so if possible I''d like todo it while it''s running. -- Kind Regards Rudi Ahlers Check out my technical blog, http://blog.softdux.com for Linux or other technical stuff _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> Hi all > > I''d like to know if it''s possible to clone a running domU. I need to > make an exact copy of an existing CentOS xen domU, but without takingit> offline. I''m using LVM, so I don''t know if it will help. > > I have tried doing it with dd, after shutting down the domU, but it > takes ages. The LVM image is 30GB. I can''t really afford to have the > running one off line that long, so if possible I''d like todo it while > it''s running.dd almost certainly won''t give you a usable filesystem in your copy. Using LVM you should be able to make a snapshot of the filesystem which should be at least as consistent (integrity wise) as if you''d done an ''xm destroy'' on the domain. Some filesystems can put themselves into snapshot mode, which would ensure that the filesystem was completely consistent. This may not be required for what you want. When you create a snapshot you specify a size for the snapshot. The size can be much less than the original filesystem if you want, but any changes you make to the original filesystem or to the snapshot consume space in the snapshot, and if the snapshot runs out of space then bad things will happen. James _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Don''t forget to specify block size (bs=x) in your DD command. I''ve had good luck with 2-4M block sizes; by default, I think the BS=256k. I''ve seen it cut copy time by 75% ~Nathan -----Original Message----- From: xen-users-bounces@lists.xensource.com [mailto:xen-users-bounces@lists.xensource.com] On Behalf Of Rudi Ahlers Sent: Thursday, July 31, 2008 11:23 PM To: xen-users Subject: [Xen-users] can I clone a runiung domU? Hi all I''d like to know if it''s possible to clone a running domU. I need to make an exact copy of an existing CentOS xen domU, but without taking it offline. I''m using LVM, so I don''t know if it will help. I have tried doing it with dd, after shutting down the domU, but it takes ages. The LVM image is 30GB. I can''t really afford to have the running one off line that long, so if possible I''d like todo it while it''s running. -- Kind Regards Rudi Ahlers Check out my technical blog, http://blog.softdux.com for Linux or other technical stuff _______________________________________________ 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
> >> I''d like to know if it''s possible to clone a running domU. >> The LVM image is 30GB. I can''t really afford to have the >> running one off line that long, so if possible I''d like todo it while >> it''s running. >> > > dd almost certainly won''t give you a usable filesystem in your copy. > > Using LVM you should be able to make a snapshot of the filesystem which > should be at least as consistent (integrity wise) as if you''d done an > ''xm destroy'' on the domain. > >A neat way to do that is if you use zfs-backed storage, either directly (using Sun''s xVM) or having solaris export the volume over iscsi to linux box. The "clone" process for zfs is two simple commands : "zfs snanpshot" and "zfs clone", which is almost instaneous. Regards, Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Nathan Eisenberg wrote:> Don''t forget to specify block size (bs=x) in your DD command. I''ve had good luck with 2-4M block sizes; by default, I think the BS=256k. I''ve seen it cut copy time by 75% > > ~Nathan > > -----Original Message----- > From: xen-users-bounces@lists.xensource.com [mailto:xen-users-bounces@lists.xensource.com] On Behalf Of Rudi Ahlers > Sent: Thursday, July 31, 2008 11:23 PM > To: xen-users > Subject: [Xen-users] can I clone a runiung domU? > > Hi all > > I''d like to know if it''s possible to clone a running domU. I need to > make an exact copy of an existing CentOS xen domU, but without taking it > offline. I''m using LVM, so I don''t know if it will help. > > I have tried doing it with dd, after shutting down the domU, but it > takes ages. The LVM image is 30GB. I can''t really afford to have the > running one off line that long, so if possible I''d like todo it while > it''s running. > >Thanx for the tip :) -- Kind Regards Rudi Ahlers Check out my technical blog, http://blog.softdux.com for Linux or other technical stuff _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Fajar A. Nugraha wrote:>> >>> I''d like to know if it''s possible to clone a running domU. The LVM >>> image is 30GB. I can''t really afford to have the >>> running one off line that long, so if possible I''d like todo it while >>> it''s running. >>> >> >> dd almost certainly won''t give you a usable filesystem in your copy. >> >> Using LVM you should be able to make a snapshot of the filesystem which >> should be at least as consistent (integrity wise) as if you''d done an >> ''xm destroy'' on the domain. >> >> > > A neat way to do that is if you use zfs-backed storage, either > directly (using Sun''s xVM) or having solaris export the volume over > iscsi to linux box. The "clone" process for zfs is two simple commands > : "zfs snanpshot" and "zfs clone", which is almost instaneous. > > Regards, > > Fajar > ------------------------------------------------------------------------ > > _______________________________________________Sure, but I don''t. I''m using CentOS as OS, with ext3 :) So, I need to work with what I have -- Kind Regards Rudi Ahlers Check out my technical blog, http://blog.softdux.com for Linux or other technical stuff _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Rudi Ahlers wrote:> Fajar A. Nugraha wrote: >>> >>> Using LVM you should be able to make a snapshot of the filesystem which >>> should be at least as consistent (integrity wise) as if you''d done an >>> ''xm destroy'' on the domain. >>> >>> >> >> A neat way to do that is if you use zfs-backed storage, either >> directly (using Sun''s xVM) or having solaris export the volume over >> iscsi to linux box. The "clone" process for zfs is two simple >> commands : "zfs snanpshot" and "zfs clone", which is almost instaneous. >> > Sure, but I don''t. I''m using CentOS as OS, with ext3 :) So, I need to > work with what I have >In that case James'' suggestion is probably your best bet. If you use lvm-backed storage for domU : - lvm snapshot on running domU''s LVM, to get a consistent state. - dd from the snapshot to a new LV - destroy snapshot As for optimum block size for dd, I think the default PE size for linux LVM is 4MB, so you might want to try that. Regards, Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Fajar A. Nugraha wrote:> Rudi Ahlers wrote: >> Fajar A. Nugraha wrote: >>>> >>>> Using LVM you should be able to make a snapshot of the filesystem >>>> which >>>> should be at least as consistent (integrity wise) as if you''d done an >>>> ''xm destroy'' on the domain. >>>> >>>> >>> >>> A neat way to do that is if you use zfs-backed storage, either >>> directly (using Sun''s xVM) or having solaris export the volume over >>> iscsi to linux box. The "clone" process for zfs is two simple >>> commands : "zfs snanpshot" and "zfs clone", which is almost instaneous. >>> >> Sure, but I don''t. I''m using CentOS as OS, with ext3 :) So, I need to >> work with what I have >> > > In that case James'' suggestion is probably your best bet. If you use > lvm-backed storage for domU : > - lvm snapshot on running domU''s LVM, to get a consistent state. > - dd from the snapshot to a new LV > - destroy snapshot > > As for optimum block size for dd, I think the default PE size for linux > LVM is 4MB, so you might want to try that. > > Regards, > > Fajar > ------------------------------------------------------------------------ > > _______________________________________________How do I destroy the snapshot when the main LVM is being used by the domU VM? Can I just run lvremove /dev/data/pluto_s ? -- Kind Regards Rudi Ahlers Check out my technical blog, http://blog.softdux.com for Linux or other technical stuff _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Rudi Ahlers wrote:> Fajar A. Nugraha wrote: >> If you use >> lvm-backed storage for domU : >> - lvm snapshot on running domU''s LVM, to get a consistent state. >> - dd from the snapshot to a new LV >> - destroy snapshot >> > How do I destroy the snapshot when the main LVM is being used by the > domU VM? > > Can I just run lvremove /dev/data/pluto_s ? >In short, yes. The snapshot is treated as a separate entity from the main LVM. As long as you''re not using (e.g. mounting, dd-ing) the snapshot (/dev/data/plato_s), you can safely remove it. Regards, Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Jett wrote:> >> Jett wrote: >>> You can make use of the LVM snapshot. >>> >>> Ref: >>> http://momotonic.com/2008/03/23/migrating-lvm-volumes-over-network-using-snapshots/ >>> >>> >>> Jett >>> >>>> Hi all >>>> >>>> I''d like to know if it''s possible to clone a running domU. I need >>>> to make an exact copy of an existing CentOS xen domU, but without >>>> taking it offline. I''m using LVM, so I don''t know if it will help. >>>> >>>> I have tried doing it with dd, after shutting down the domU, but it >>>> takes ages. The LVM image is 30GB. I can''t really afford to have >>>> the running one off line that long, so if possible I''d like todo it >>>> while it''s running. >>>> >>> >>> >> Hi Jett, >> >> I have though of LVM snapshots, but I need to move the LVM image to >> another server - will this be a problem if I make a snapshot of it? >> > Hi, > > You may dd the snapshot and copy the image to other server. Use dd to > restore the partition after moving. > The link I have gave you is exactly for migrating LVM volumes. > > Hope this help. > > Nice Day, > Jett > > >Once I made a snapshot, should I be able to mount it, or not? Cause it doesn''t seem to work then? lvcreate -L30G -s -n pluto_s /dev/data/hfserver2 Logical volume "pluto_s" created [root@HF-LINSRV01 ~]# lvscan ACTIVE ''/dev/data/cpanel002'' [100.00 GB] inherit ACTIVE ''/dev/data/windows2003_web'' [30.00 GB] inherit ACTIVE ''/dev/data/storage'' [50.00 GB] inherit ACTIVE Original ''/dev/data/hfserver2'' [30.00 GB] inherit ACTIVE ''/dev/data/windows2008'' [30.00 GB] inherit ACTIVE ''/dev/data/hfdns02'' [30.00 GB] inherit ACTIVE ''/dev/data/pluto'' [30.00 GB] inherit ACTIVE Snapshot ''/dev/data/pluto_s'' [30.00 GB] inherit ACTIVE ''/dev/system/root'' [39.06 GB] inherit ACTIVE ''/dev/system/swap'' [9.75 GB] inherit [root@HF-LINSRV01 ~]# mount /dev/data/pluto_s /mnt/pluto_s/ mount: you must specify the filesystem type -- Kind Regards Rudi Ahlers Check out my technical blog, http://blog.softdux.com for Linux or other technical stuff _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On 01/08/2008 10:45, Rudi Ahlers wrote:> Once I made a snapshot, should I be able to mount it, or not? > > Cause it doesn''t seem to work then? > > lvcreate -L30G -s -n pluto_s /dev/data/hfserver2 > Logical volume "pluto_s" created > > [root@HF-LINSRV01 ~]# lvscan > ACTIVE Original ''/dev/data/hfserver2'' [30.00 GB] inherit > ACTIVE Snapshot ''/dev/data/pluto_s'' [30.00 GB] inherit > > [root@HF-LINSRV01 ~]# mount /dev/data/pluto_s /mnt/pluto_s/ > mount: you must specify the filesystem typeAre there partitions inside hfserver2? If so they will also exist inside pluto_s, you can use kpartx to make them visible via mapper, then you may need to vgscan and lvchange -ay before you''ll be able to mount them. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Possibly Parallel Threads
- domU corrupt after server crash, help needed trying to recover domU LVM
- what''s correct way of shrinking LVM based domU?
- Xen3.2 documentation?
- how to boot domU XEN guest in safe mode?
- Re: unable to access Linux HVM via xm console - Couldnot read tty from store: No such file or directory