Techtips Vol1 – Xen on CentOS – Migrating a Legacy Server
Xen on Centos – Migrating a legacy server
Do you have a legacy server, running legacy software, still used by your company or worse a client? Are the developers and engineers who set it up long gone, do you have documentation on the design, anything? No worries… I recently ran into this situation and I’ve found a very nice solution. I have a client who was running a client facing software package on a Fedora Core 3 server. The power supply had recently died, fortunately we had a spare, the hardware was over 5 years old, and it was not RAID. We were backing up what we could, but had little confidence on rebuilding it perfect if we had to.
I found using XEN via Centos 5 solved our immediate concerns, and bought us an infinite amount of time to plan for a more permanent solution.
Situation
We have legacy software running on legacy hardware. OS was Fedora Core 3, which we can agree is legacy, and hardware was home customization.
We have a Dell server running Centos 5, which RAID 5, multi core’s, etc. 64 bit OS.
Process
- Downloaded http://et.redhat.com/~rjones/tmp/virt-p2v-0.9.9.iso and burned it to a CD
- You will need to know the IP of the newer server
- The newer server will need to allow SSH
- Note the MAC address of the legacy server’s NIC
- Boot the legacy hardware off the CD
- For network configuration choose automatic
- When it comes to the device screen, the default is typically your primary HD. Confirm and hit ok. If not select your primary /dev/sd device
- The next screen should be your primary root directory. Confirm or change and hit ok.
- Choose XEN for the hypervisor
- When prompted for the MAC address of your new image, enter your legacy server’s MAC address (if this matters to you, i.e. reserved dhcp addresses)
- Now wait as the p2v software scp’s your legacy hardware to a virtual image on your new server.
- It will copy the image to /var/lib/xen/images/ on your new server. It will create two files, a .conf file and a .img file
- On your newer CentOS5 server (after the copy is finished)
- Yum install kernel-xen xen xen-libs virt-manager
- edit /etc/grub.conf so the server boots off the xen kernel
- Make sure the BIOS of the server has virtualization enabled on the processor
- Reboot
- After reboot go into /var/lib/xen/images and type virsh define p2v-foo-2008MMDDHHMM.conf, where p2v-foo etc is your new conf file.
- Go into /etc/xen and edit foo
- Where you see the MAC address add an entry for bridging ethernet i.e. [ “mac=00:02:B3:5D:E6:CF,bridge=xenbr0” ]
- If your new OS is 64 bit and you installed 64 bit XEN change the line device_model = “/usr/lib64/xen/bin/qemu-dm” to reflect lib64 instead of just lib.
- Now type virsh start foo
- You can use virt-manager to see if the new Xen-VM booted properly and get to its console.
- To have the new Virtual Server start on Hardware reboot move the /etc/xen/foo file into /etc/xen/auto/.
references: http://et.redhat.com/~rjones/virt-p2v/ Google XM commands, Virsh Commands, Xen Centos for more.