|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
|
|
Replicating a live server on a domUHi, 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@... http://lists.xensource.com/xen-users |
|
|
Re: Replicating a live server on a domUOn Tue, Oct 27, 2009 at 7:25 PM, Alexandru Florescu <alex@...> 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@... http://lists.xensource.com/xen-users |
|
|
RE: Replicating a live server on a domU>
> 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. James _______________________________________________ Xen-users mailing list Xen-users@... http://lists.xensource.com/xen-users |
|
|
|
|
|
Re: Replicating a live server on a domUAlexandru 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@... http://lists.xensource.com/xen-users |
|
|
RE: 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 Hobson Hello. 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@... http://lists.xensource.com/xen-users |
|
|
RE: Replicating a live server on a domUAlexandru 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@... http://lists.xensource.com/xen-users |
| Free embeddable forum powered by Nabble | Forum Help |