[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.