Sep 29, 2006 - Virtualization    Comments Off on Convert a VMware Virtual Machine from GSX/Workstation to ESX

Convert a VMware Virtual Machine from GSX/Workstation to ESX

Written by Damian Murdoch
Friday, 29 September 2006

Lots of people have asked what ways there are to convert a virtual machine from one VMware product to another. The most common one is from GSX server or Workstation to ESX server. There are many ways to do this, but here are the two most common.

The first way to import a virtual machine from one product to another and likely the easiest way is to use VMware’s Virtual Machine Importer which is currently in Relase Candidate stage. You can download it here. The Virtual Machine importer allows you not only to convert between VMware products but even allows you to import Virtual Machines from products such as Microsofts Virtual Server and other third party system images. It has great documentation and is really easy to use. This is the recommended way to perform the task.

If you are a bit more adventurous then you can manually perform the import. The first thing that you need to do is to copy the virtual machines files to the shared storage location on ESX server. Lets use an example of an ESX server that has access to a LUN called LUN1A. I find the easiest way to copy a file from a windows computer to the ESX server is with the use of a program called winscp. Connect to the ESX server via winscp, browse to the location of the LUN where you are copying the data, in this case /vmfs/volumes/LUN1A/

Once you have reached the location, create a directory for the virtual machine to be stored in. This can be done via a right click in winscp. If you are at the command line in the service console, the command would be “mkdir /vmfs/volumes/LUN1A/yourvmname

Then proceed to copy the files to this location. In winscp, you can just drag and drop the files from one location to the other and you get a nice progress bar at this point. Once the copy has completed, you will need to run vmkfstools at the command line over the copied file to convert it to ESX format. The switch is -i and you will need to be logged in to the service console at this point to run the command.

An example of the command is “vmkfstools –

i /vmfs/volumes/LUN1A/yourvmname/oldvmfile.vmdk /vmfs/volumes/LUN1A/yourvmname/newvmfile.vmdk"

Once the convert has finished, you can delete the old vmfile. Now you have the data file copied across and converted to ESX format. Now you need to create a virtual machine and assign it to the new virtual machine. In the Virtual Infrastructure client select the custom option and you will be prompted to use existing vmdk file. Browse to the location and select your newly converted vmdk file.

If you have gotten this far on the manual process then well done! You should now have a VM that is booting on ESX server. If you are getting bluescreens on a windows VM after the convert, check that you havent created a VM with a different SCSI format. By this I mean the old vm was using LSILogic and your new vm is using Buslogic.

That’s it for this one! Time to get some sleep.

vmkfstools -i oldvm-vmdk newvm.vmdk

Then you can delete the old vmdks after migration.