Friday, October 3, 2008

Moving an Ubuntu virtual machine from VMware Server to ESXi (on a PE1950)

Wednesday I migrated my PE1950 from VMware Server (1.0.2!) to ESXi 3.5 Update 2. During the process I ran into some issues moving my Ubuntu 6.06 LTS VM to ESXi. Here's the play-by-play (including my hardware upgrade).

  1. Copy the VM's off of the VMware Server.
  2. Verify the copied VM's work ok, and that you have valid backups.
  3. Shutdown the PE1950.
  4. Update the BIOS on the PE1950. Without a BIOS update, ESXi will not run correctly.
    - Can you believe I was running 1.x, when we're now at 2.3.x! This box has been very, very reliable.
  5. Unrack the PE1950, and replace the SAS 5/iR (no RAID) controller with a PERC 6/i controller.
    - ESXi needs a hardware RAID controller.
    - I was previously running software RAID-1 on the Ubuntu LTS host. We needed a reliable system, since this box had become mission-critical.
  6. Install ESXi onto a USB flash drive (>=1GB).
  7. Boot the PE1950, and setup the RAID array (2x300GB 7200RPM SATA in RAID-1).
  8. After the array has initialized, reboot with the USB Flash drive plugged in (preferably to one of the rear USB ports).
  9. Enter the BIOS (F2), and modify the boot order.
    - I set the USB Flash Drive's mode to "Hard disk"
    - Modify the boot order to include the USB flash drive as taking higher priority than the PERC array.
    - Save and exit the BIOS.
  10. Setup ESXi.
    - ESXi will give you the IP you need for setting up the Virtual Infrastructure client, etc.
    - Your RAID-1 array will be setup as your primary datastore (datastore1).
  11. Use VMware Converter to move the vm's to the new ESXi box.
  12. Boot up the Ubuntu guest OS.


Upon boot, you'll notice that the Ubuntu machine has no network connectivity. Here's how you fix it (commands you need to type are in bold):

  1. Install VMware tools on the guest os (it's probably outdated)
    • In the VMware Infrastructure Client, choose the VM, and then go to Inventory->Virtual Machine->Install/Upgrade VMware Tools
    • log into the ubuntu console
    • elevate your privileges to root level by running sudo su
    • mount the cd-rom drive: mount /media/cdrom0
    • change directories to the cdrom drive: cd /media/cdrom0
    • copy the vmware tools tar archive to your tmp directory (making sure you pay attention to the name of your archive, including case):
      cp VMwareTools-3.5.0-110271.tar.gz /tmp/
    • change to the tmp directory: cd /tmp
    • extract the tar file: tar -xvf VMwareTools-3.5.0-110271.tar.gz
    • change directories to the vmware-tools installer: cd vmware-tools-distrib
    • run the vmware tools installer script: ./
  2. Restart your networking: /etc/init.d/networking restart
  3. Check to see if your NIC is now working properly. You can check your interfaces using the following command: ifconfig -a
    If you are receiving an IP properly, you're probably OK. This didn't work for me.
    DO NOT complete the following steps unless you have no network connectivity
  4. Shut down the VM: shutdown -h now (remember, we elevated our privileges earlier to root)
  5. Remove any NIC's that are currently in the VM.
  6. After removing any NIC's that are currently in the VM, add a new NIC.
  7. Boot the VM
  8. I now had a NIC that my system recognized, but I wasn't getting an IP. The issue was with my interfaces file.
    • Contents of /etc/network/interfaces:
      # The loopback network interface
      auto lo
      iface lo inet loopback

      # The primary network interface
      auto eth0
      iface eth0 inet dhcp
    • Notice how it lists "eth0" When I ran "ifconfig -a" earlier, I received eth1 as an interface, not eth0
  9. Change eth0 to eth1 in my interfaces file: vi /etc/network/interfaces (replacing eth0 with eth1)
  10. Restart networking: /etc/init.d/networking restart

At this point, everything was working well.

Thursday, October 2, 2008

VMware ESXi (bootable) USB flash creation tip

Yesterday I went to install VMware ESXi on a Poweredge 1950. All along I wanted to get the system setup with a USB flash drive (and not use the onboard storage as my boot disk).

I did some research, and this blog post seemed to be the most complete posting on creating your own ESXi bootable flash drive.

So, I downloaded the ESXi installable ISO, opened up 7-Zip, and went for it.
I was very surprised that every time I tried to image the flash drive, I got an error in WinImage. Now, this was running on my Vista x64 box, so I went ahead and fired up a VM w/ XP Pro 32-bit. At that point, I attempted to re-image the USB flash drive, and things worked as planned

Moral of the story: Don't try and create a bootable USB flash drive using Winimage on Vista x64, it won't work! Use VMware (or another computer) to create the flash drive's ESXi install (apparently on a 32-bit OS).