Tuesday, October 6, 2009

Migrating Redhat Linux 4 VM from Virtual Server 2005 to Hyper-V R2

The release of Hyper-V R2 prompted me to plan for upgrades of my virtual servers. Now upgrading from Hyper-V to Hyper-V R2 is no big feat. However, if you have Linux virtual machines on Virtual Server 2005 running on Windows 2003 Server, then inplace upgrade is not an option.

So my plan was to move my virtual machines from Virtual Server 2005 to another Hyper-V R2 server then upgrade my existing Windows 2003 Server to Windows 2008 R2. With the help of my UNIX guru, Mr Aw GuanBee, we managed to get this completed! Thank you GuanBee for your help.

Here we go, I will explain the steps as I go through them. Hopefully, it will be helpful to you.

The picture below shows my Redhat Linux 4 virtual machine running on Virtual Server 2005. The first step is to shutdown your Linux virtual machine then copy the VHD file over to your Hyper-V R2 server.

image

Next, create a New Virtual Machine on your Hyper-V R2 host.

image

No need to connect it to your virtual network yet as we will be adding a Legacy Network Adaptor later.

image

Assign the VHD file that you copied from your Windows 2003 Virtual Server 2005 to this new Virtual Machine.

image

Once you created the VM, let’s add a Legacy Network Adapter to it. This is to ensure that your system can detect and be connected to network.

image

Boot up the VM and you will be prompted with new hardware detection, configure the network adapter to have a static IP or DHCP and you are good to boot up.

image

Because Hyper-V R2 and Linux IC v2 RC2 only officially supports RHEL 5.2 and above. It is recommended to upgrade to RHEL 5.

To upgrade RHEL 4 to RHEL 5, first update your RHEL 4 to the latest update level. RHEL 4 uses up2date –u to update your system.

After your RHEL 4 is updated, insert RHEL 5 disc or ISO and bootup your VM. At the installation prompt, type linux upgradeany. This will give you an upgrade option during RHEL installation.

image

It might take a few hours to complete the upgrade. We are still not done as we still need to load the Linux Integration Components.

image

Once you completed the upgrade, run yum update to bring your system up-to-date.

image

Because the RHEL 5 is upgrade from RHEL 4, the kernel will be kernel-PAE. So you have to do a yum install kernel-PAE-{your kernel version}. For example, for my kernel version, I will run yum install kernel-PAE-2.6.18-164.2.1.el5.i686 and yum install kernel-PAE-devel-2.6.18-164.2.1.el5.i686.

Run yum install kernel-devel and yum install gcc.

Now we are ready to install the Linux IC. Insert the LinuxIC iso into the DVD drive and copy the contents to /opt/linuxic directory. You can issue the commands below.

mkdir /mnt/cdrom

mount /dev/cdrom /mnt/cdrom

mkdir /opt/linuxic

cp /mnt/cdrom/* /opt/linuxic/ –R

cd /opt/linuxic

Having copy the content to /opt/linuxic, issue the command “./setup.pl drivers to install the Linux Integration Components. Please do a reboot once installation completes.

Done!! We have successfully migrated the Linux VM from Microsoft Virtual Server 2005 to Hyper-V and did an upgrade from Redhat Linux 4 to Redhat Linux 5.

No comments: