Exporting VMware Workstation VMDK to ESXi

In the quest to find the most difficult and convoluted way of doing things.  I feel I really outdid myself this week.  What should have been an easy task of creating an OVF on Vmware Workstation 8 and deploying it into a vSphere environment turned out to be much more.

The night before I created an OVF of a Workstation VM.  The next morning  I went to copy the files to a USB stick prior to work.  Still half asleep I only copied the compressed VMDK file and not the actual OVF or MF files.  Imagine my surprise when I got into work with only a single compressed VMDK file.

No worries, I’ll just upload it to a datastore and attach it.  Yeah no.  You need the VMDK descriptor file that points to the -flat.vmdk file.  vCenter won’t find any disks to attached to a VM.

So after some cursing, hopeful optimism, then some more cursing I found a workable solution.

Virtual Disk Development Kit 5.1 is a collect of tools to help you work with virtual disks.  Inside this kit is a util called vmware-vdiskmanager.exe.  The util actually comes with VMware Workstation but not having it with me required the download of this devel kit to acquire the util.  The util is similar to the ESXi shell command vmkfstools but can be run on a Windows box.  It has the ability to expand / convert a VMDK file out to an ESX-type virtual disk.

The command  I ran was

vmware-vdiskmanager.exe -r <original_source.vmdk> -t 4 <new_destination.vmdk>

Once complete two files are created.  A .vmdk descriptor file and a -flat.vmdk thick virtual disk.

I was now able to upload the two files to a datastore.  You have to upload both of them to the same location.  You won’t see the -flat.vmdk file once uploaded but it will be there.

exporting_vmdk01

Then I went into the Edit Settings of my pre-created vSphere VM.  I clicked on New Device and selected Existing Hard Disk and Add.

exporting_vmdk02

vmware-vdiskmanager.exe is quite a useful little util to help move Workstation VMDK files over to ESXi.  Prior to Workstation 8 this is probably your best way to get a VM’s virtual disk into ESXi.  With the introduction of Workstation 8 and above you can now Export to OVF.  This is no doubt the recommended way but if you just want an individual disk vmware-vdiskmanager is a decent option.

Reference:

VDDK Documentation

Download VMware vSphere 5.1 Virtual Disk Development Kit (login required)

Leave a Reply

Your email address will not be published. Required fields are marked *