Hi, Has anybody ever stumbled upon the need to replicate a live and in production server to a virtual machine? I''m trying to virtualize a bunch of servers but I can''t figure out how can I mirror the file system. I do not want to start from scratch with them. The whole idea is to transfer them to the virtual side as they currently are. Any advice is welcome. Thank you. Alex F. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Fajar A. Nugraha
2009-Oct-28 06:13 UTC
Re: [Xen-users] Replicating a live server on a domU
On Tue, Oct 27, 2009 at 7:25 PM, Alexandru Florescu <alex@acasa.ro> wrote:> Hi, > > Has anybody ever stumbled upon the need to replicate a live and in > production server to a virtual machine?There''s no way to do it that I know of. Not live anyway. There are p2v solutions though. Google is your friend. -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> > Hi, > > Has anybody ever stumbled upon the need to replicate a live and inproduction> server to a virtual machine? > > I''m trying to virtualize a bunch of servers but I can''t figure out howcan I> mirror the file system. I do not want to start from scratch with them. > > The whole idea is to transfer them to the virtual side as theycurrently are.>I do this on a semi-regular basis as part of backup testing for clients (eg to make sure that their backups are good). In theory you can just clone the disk and possibly fiddle with the CriticalDeviceDatabase and Services/xxx keys to ensure that the IDE driver can be used for booting. James _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
>>> On 2009/10/28 at 18:27, "James Harper" <james.harper@bendigoit.com.au> wrote: >> >> Hi, >> >> Has anybody ever stumbled upon the need to replicate a live and in > production >> server to a virtual machine? >> >> I''m trying to virtualize a bunch of servers but I can''t figure out how > can I >> mirror the file system. I do not want to start from scratch with them. >> >> The whole idea is to transfer them to the virtual side as they > currently are. >> > > I do this on a semi-regular basis as part of backup testing for clients > (eg to make sure that their backups are good). In theory you can just > clone the disk and possibly fiddle with the CriticalDeviceDatabase and > Services/xxx keys to ensure that the IDE driver can be used for booting. > > JamesNovell recently acquired a company called PlateSpin that does exactly this - currently the "live" functionality only works for Windows operating systems, but they''re promising a version that will do Linux, soon, as well. Linux can be done in the current version, but you have to bring the Linux system down - you can''t do it on the fly. -Nick -------- This e-mail may contain confidential and privileged material for the sole use of the intended recipient. If this email is not intended for you, or you are not responsible for the delivery of this message to the intended recipient, please note that this message may contain SEAKR Engineering (SEAKR) Privileged/Proprietary Information. In such a case, you are strictly prohibited from downloading, photocopying, distributing or otherwise using this message, its contents or attachments in any way. If you have received this message in error, please notify us immediately by replying to this e-mail and delete the message from your mailbox. Information contained in this message that does not relate to the business of SEAKR is neither endorsed by nor attributable to SEAKR. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Alexandru Florescu wrote:>Has anybody ever stumbled upon the need to replicate a live and in >production server to a virtual machine? >I''m trying to virtualize a bunch of servers but I can''t figure out >how can I mirror the file system. I do not want to start from >scratch with them. >The whole idea is to transfer them to the virtual side as they currently are.Yes, I''ve done it several times - all Debian GNU/Linux systems of various vintages. If you are prepared to modify the system, then install a Xen-ified kernel environment first - it makes things simpler. I just install a -xen kernel and let that take care of things like modules etc, but I dare say there are more efficient ways to do it if you aren''t using pygrub. Create new device files/volumes/whatever on the Dom0, mount them on Dom0 (eg you might have /mnt /mnt/var /mnt/home etc), and copy the filesystem across. Personally I normally use Rsync for this - but don''t forget to use the "--numeric-ids" option to avoid ownerships getting mangled. Before you unmount the volumes, go in and change things like fstab and network settings. Also, if you didn''t do it earlier, chroot to the mountpoint (/mnt in the above example) and install the Xen-ified environment. Unmount the volumes, setup the guest config file, boot guest (use -c option to attqch to console) and see what''s broken. -- 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
Alexandru Florescu
2009-Nov-02 10:57 UTC
RE: [Xen-users] Replicating a live server on a domU
>Yes, I''ve done it several times - all Debian GNU/Linux systems of >various vintages. > >If you are prepared to modify the system, then install a Xen-ified >kernel environment first - it makes things simpler. I just install a >-xen kernel and let that take care of things like modules etc, but I >dare say there are more efficient ways to do it if you aren''t using >pygrub. > >Create new device files/volumes/whatever on the Dom0, mount them on >Dom0 (eg you might have /mnt /mnt/var /mnt/home etc), and copy the >filesystem across. Personally I normally use Rsync for this - but >don''t forget to use the "--numeric-ids" option to avoid ownerships >getting mangled. > >Before you unmount the volumes, go in and change things like fstab >and network settings. Also, if you didn''t do it earlier, chroot to >the mountpoint (/mnt in the above example) and install the Xen-ified >environment. > >Unmount the volumes, setup the guest config file, boot guest (use -c >option to attqch to console) and see what''s broken. > >-- >Simon HobsonHello. Nice one Simon, that''s the exact thing that I''ve done so far. I went to stacklet.com and grabbed a xen-ready image for centos 5.3, unpacked it, mounted it and then "rsync -e ssh -avz --exclude=/proc --exclude=/lost+found --exclude=/boot / xenserver:/mnt/centosimg" from the live server. It copied pretty much everything but it also errored some stuff. Now I can boot the machine, I can login, pretty much everything looks ok, but it doesn''t load any modules, and lsmod is empty. The config file includes the following: kernel = "/boot/vmlinuz-2.6.18.8-xenU" memory = 256 name = "centos.5-3.x86" vif = [ '''' ] disk = [''file:/vserver/images/centos/centos.5-3.x86.img,sda1,w''] root = "/dev/sda1" extra ="fastboot" My rsyncd centos was 2.6.18-164.el5. The xen-ready centos, on stacklet it says that it''s 2.6.18.8, but when I boot it up it says that it''s 2.6.18-128.1.6.el5xen. Anyway, the error is: FATAL: Could not open ''/lib/modules/2.6.18-128.1.6.el5xen/kernel/drivers/block/aoe/aoe.ko'': No such file or directory A ls /lib/modules reveals that I only have 2.6.18.8.xenU in there. so I just rename the original 2.6.18.8.xenU to 2.6.18-128.1.6.el5xen and do another modprobe aoe and I get: FATAL: Error inserting aoe (/lib/modules/2.6.18-128.1.6.el5xen/kernel/drivers/block/aoe/aoe.ko): Invalid module format I also rename the original 2.6.18-164.el5 to 2.6.18-128.1.6.el5xen and get the same Invalid module format. How did you get around this problem? Thanks. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Alexandru Florescu wrote:>I went to stacklet.com and grabbed a xen-ready image for centos 5.3,Why ? You''ve grabbed a Xen ready image, then the first thing you''ve done is overwrite it with your live server config.>unpacked it, mounted it and then >"rsync -e ssh -avz --exclude=/proc --exclude=/lost+found --exclude=/boot / >xenserver:/mnt/centosimg" from the live server. >It copied pretty much everything but it also errored some stuff. >Now I can boot the machine, I can login, pretty much everything looks ok, >but it doesn''t load any modules, and lsmod is empty.You might not have any modules to match the kernel - note below the mismatch between kernel versions.>The config file includes the following: >kernel = "/boot/vmlinuz-2.6.18.8-xenU" >memory = 256 >name = "centos.5-3.x86" >vif = [ '''' ] >disk = [''file:/vserver/images/centos/centos.5-3.x86.img,sda1,w''] >root = "/dev/sda1" >extra ="fastboot" > >My rsyncd centos was 2.6.18-164.el5. >The xen-ready centos, on stacklet it says that it''s 2.6.18.8, but when I >boot it up it says that it''s 2.6.18-128.1.6.el5xen.You''ve got a mismatch between the kernel image you are booting from, and what''s in your image. I''m no expert, but I''d suggest your method is far from ideal. Essentially your system is now a hybrid made by overwriting parts of the filesystem, while leaving other bits intact. I''d suggest you would be better making an EXACT clone of your live server into a blank volume, and then adding a Xen kernel. When using rsync, you''ve missed off two important switches. Firstly, you''ve missed -H (--hard-links) so you''ll have copied any hard linked files as separate files. Secondly, you''ve missed --numeric-ids which is essential when copying between systems (unless you are 100% certain they both have the same users and groups) - without it, you''ll find your file ownerships mangled. Once you''ve done it a few times, you tend not to forget :-/ -- 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