Recently I upgraded my home server from a multi-purpose Ubuntu box to a Joyent SmartOS hypervisor. This server acted as a file server for my home LAN, an apache httpd web server, and an HTPC. Of course, this required some juggling to keep functionality and data. Fortunately, I had built a VMWare ESXi environment in VMware Workstation 9 for some prior projects, so I had a place to recreate the web server functionality. Spare hard drives took the data off the RAID.

Migrating from ESXi to SmartOS was unexpectedly painless. I'll walk through the install and setup process and speed bumps as I go through them.

There are a couple of prerequisite steps before starting up SmartOS and migrating. First off, the ovftool command-line utility is the tool of choice for getting the vmdk files out of ESX or ESXi. The vmdk files must be accessible on the file system for SmartOS to be able to import them and ovftool makes vmdk files that are of minimum size, instead of the total reserved size.

I ran ovftool on a Windows 7 system. The command should be run similar to this:
C:\>ovftool\ovftool.exe vi://username:password@ESXI_HOST_IP/VM_NAME 
/ outputdir\OUTPUT_VM_NAME.vmx

A working example:
C:\>ovftool\ovftool.exe "vi://user:password@192.168.1.5/CentOS DB01" extracted\DB01.vmx

If you are unsure what the VMs are named in the datastore, running the previous tool without VM_NAME and OUTPUT arguments will list the available names. Note: while this lists the output file as a .vmx, it also extracts the vmdk.

Once all of your VMs are extracted, they need to be somewhere that can be mounted by SmartOS. As it boots off a USB stick into RAM, it does not have enough available storage to hold the vmdk files. The best bet is NFS or Samba. Dead easy on a Linux system, but also possible on Windows 7 ultimate or enterprise! Enable the "Services for NFS" and its sub-services to share a folder through NFS.

The last prerequisite is to prepare the USB boot stick. SmartOS runs entirely in RAM, so all disk space is available to the virtualized systems. Thus, USB boot. The documentation's instructions are easy to follow. Ubuntu project's Win32DiskImager utility is perfect for the job, but make sure to be careful to select the right USB device.

In the next entry, I'll cover initial setup, the migration process with qemu-img, and the few gotchas in migrating running systems, especially Windows Server 2012.