The Linux P2V into Hyper-V Conundrum

Background:

A linux server is running on a physical box (little Dell Zino HD box). It is used to cache content for a website (Eduss Cache Server). The 320GB hard drive has 5 partitions – 4 of the partitions being for home folders, swap, OS files (9GB) and the rest to store the cache for the website. It needs to be virtualised into Hyper-V for all sorts of benefits (more availability and reliability).

The company who maintains the distro wouldn’t provide support for p2ving the OS into hyper-v, nor provide an ISO or disc to install the OS if the physical box failed or install the OS on another machine.

Method:

Some steps outlined in a technet blog were attempted first

DD seemed to work and the OS booted under Hyper-V, however hyper-v only recognised the hard drive being 127GB in size, instead of 320GB. The OS showed lots of errors on boot. Tried to load sysrescuecd to resize partitions, but couldn’t do it since the VHD was still seen as 127GB and the partition table didn’t load. I discarded the vhd.

Used clonezilla and backed up the physical hard drive on the Zino HD ( only 9GB in size :/ ). After the backup was done, I booted systemrescuecd on the Zino HD and resized the huge cache 200+GB partition to 30GB. Booted clonezilla after this was complete again and imaged the drive. Tried to place the image onto a 100GB hyper-v vhd (not fixed, dynamically allocated space) but clonezilla didn’t like putting images on smaller physical disks.

I took the hard drive out of the Zino HD and placed it in a Dell Optiplex 755 PC as a slave (primary was a 80GB disk). I downloaded EaseUs cloning utility and imaged linux distro onto 80GB disk. After this was done, I booted clonezilla on the PC and took an image of partitions for the 80GB hard drive. I then restored the image onto a hyper-v machine. The OS booted without issues.

The OS didn’t have an IP and didn’t recognise that it had a NIC. The distro was locked down and wouldn’t let you access the bash terminal (couldn’t login as root – somehow enduring this task of p2ving the cache server). Contacted support and they wouldn’t give out the password or allow any other access to the terminal to perform tasks such as installing drivers and adding the NIC/IP information.

Booted sysrescuecd in the newly created hyper-v machine, mounted the cache server vhd and followed some steps from a website to install hyper-v drivers, activate the nic, and give the host and IP address. Booted the hyper-v machine normally and the machine had an IP address. I couldn’t believe everything was working pristine.

Lessons Learned and “gotchas”:

  1. Linux distributions generally need to be under 127GB on VHD files to function properly
  2. Clonezilla doesn’t allow you to place images onto physical disks with less size than the physical disk you took the image on
  3. Buy Norton Ghost. Would have saved tones of time and money from my labor costs (only about $100 for ghost, as opposed to 5-6 hours at my hourly rate). It allows you to place images onto smaller disks.
  4. If it’s possible, install the linux OS from scratch. P2Ving linux sux
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: