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] Re: migrate existing non-xen system to a VM? - SUCCESS!

To: Miles Fidelman <mfidelman@xxxxxxxxxxxxxxxx>, "xen-users@xxxxxxxxxxxxxxxxxxx" <xen-users@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-users] Re: migrate existing non-xen system to a VM? - SUCCESS! (and report)
From: Matej Zary <zary@xxxxxxxxx>
Date: Tue, 18 May 2010 18:26:36 +0200
Accept-language: en-US
Acceptlanguage: en-US
Cc:
Delivery-date: Tue, 18 May 2010 09:28:33 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4BF29F77.90207@xxxxxxxxxxxxxxxx>
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>
References: <4BF1156E02000099000576D8@xxxxxxxxxxxxxxxxxxxxx> <4BF29F77.90207@xxxxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acr2lAoJDpUtrHgATh2tP0gkTnwY2wAEgCBA
Thread-topic: [Xen-users] Re: migrate existing non-xen system to a VM? - SUCCESS! (and report)
Hello,


regarding the number 6.:

>6. start it up
>
>xm create -c newserver1.cfg
>
>and it ran - the first time!!!!
>
>note: for some reason, the console stops responding after boot, but I 
>can log in via ssh, and all the processes run, mail flows, web sites are 
>up, etc. - the console reports messages on shutdown


this one might help:

DomU /etc/inittab:

Replace  1:2345:respawn:/sbin/getty 38400 tty1
with 1:2345:respawn:/sbin/getty 38400 hvc0


Regards

Matej


-----Original Message-----
From: xen-users-bounces@xxxxxxxxxxxxxxxxxxx 
[mailto:xen-users-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Miles Fidelman
Sent: Tuesday, May 18, 2010 4:09 PM
To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-users] Re: migrate existing non-xen system to a VM? - SUCCESS! 
(and report)

xen.independent_wallclock=1 Hi Folks,

Well, last night, I transitioned my production system from physical 
(running directly on Debian Lenny on bare metal) to running inside a VM 
on Xen.  And it went incredibly smoothly.

First off - thanks to those of you who sent advice.  You saved me a lot 
of headaches.

Second, here's a summary of what I did - in case it might be useful to 
others:

1. Set up my target machine:
- starting condition: Dom0 = Debian Lenny, 
xen-linux-system-2.6.26-2-xen-686, plus a few tweaks
- create three logical volumes:  root, swap, backup ("backup" is another 
volume I use for backups and things)
- set these up as DRBD devices (not really relevant to this discussion)
- make filesystems on root and backup
- mkswap on swap

2. Bring down production server, reboot with a rescue CD (SysRescueCD)
- assign an unused IP
- set up to allow root login via ssh

3. Transfer Data
- mount the original root and backup volumes
- move data (took a LONG time) - thanks to whomever sent this recipe! - 
typed these on the target (new) machine

rsync -avzH --numeric-ids -e ssh root@<IP>:/mnt/mydir/backup/* /mnt/backup

rsync -avzH --numeric-ids -e ssh root@<IP>:/mnt/mydir/root/* /mnt/root


4. Set up <server>.cfg file:
# notes: this is based on an earlier file generated by xen-tools

kernel = '/boot/vmlinuz-2.6.26-2-xen-686'

ramdisk = '/boot/initrd.img-2.6.26-2-xen-686'

memory = '1024'

disk = [

'drbd:root,xvda1,w',

'drbd:swap,xvda2,w',

'drbd:backup,xvda3,w'

]

root = '/dev/xvda1 ro'

vif = [ 'ip=xx.xx.xx.xx,mac=00:16:3E:BE:68:F5' ]

#where xx.xx.xx.xx = primary address of the original system

name        = 'server1'

on_poweroff = 'destroy'
on_reboot   = 'restart'
on_crash    = 'restart'

#this is to fix a bug in clock sync, per advice at
#http://wiki.debian.org/Xen#A.27clocksource.2BAC8-0.3ATimewentbackwards.27
extra="clocksource=jiffies"

4. while still mounted, edit /mnt/root/etc/fstab to read:

proc /proc proc defaults 0 0

/dev/xvda1 / ext3 errors=remount-ro 0 1

/dev/xvda2 none swap sw 0 0

/dev/xvda3 /backup ext3 defaults 0 2


5. umount the two newly initialized volumes

6. start it up

xm create -c newserver1.cfg


and it ran - the first time!!!!

note: for some reason, the console stops responding after boot, but I 
can log in via ssh, and all the processes run, mail flows, web sites are 
up, etc. - the console reports messages on shutdown


7. log into the VM and clean a few things up


- turn off some services that are not relevant inside a VM (e.g, acpi, 
hwclock)
- add " xen.independent_wallclock=1" to /etc/sysctl.conf; sysctl -p
#see above note re. time bug, note that NTP is running inside the VM


8. a few things I need to track down and fix
- getting this entry in the bootlog (doesn't seem to be effecting 
anything, though)

Mon May 17 22:25:22 2010: modprobe: FATAL: Could not load 
/lib/modules/2.6.26-2-xen-686/modules.dep: No such file or directory
- get the console to respond


Again, thanks to all who provided advice.


Miles Fidelman



-- 
In theory, there is no difference between theory and practice.
In<fnord>  practice, there is.   .... Yogi Berra



_______________________________________________
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