Convert a Version 7 vmdk Disk to Version 4

This post is to highlight how you can convert a Version 7 vmdk disk to version 4.  Basically the background is that since Vsphere 4.0 the default Virtual Machine Hardware Version is version 7, under Esx or Esxi 3.5 it was virual machine version 5 (I think versions 5 and 6 are under VMWare workstation), so if you have any need to take a virtual machine from 4.0 / 4.1 / 5.0 etc backwards to a 3.5 host you’re (by default), knackered.
The easiest solution by the way is to use VMware convert, point at source and destination and it will sort it out, but sometimes this isn’t an option.  In my case I had the vmdk file (the small 1kb descriptor file and the 20GB *-flat.vmdk disk image it references), and nothing else.  Except that I knew my source was a version 7 vmware disk image.   I had copied the vmdk image files to the esxi 3.5 host but on creating a new virtual machine it basically pretended it couldn’t see the disk image, browsing the datastore to add the virtual disk showed nothing, no clue it even existed.  As always, this is what I did, take a backup first, your fault if you screw it up, etc, etc.

Using vi, or any other text editor, open up the vmdk file (the small one, *NOT* the big one), eg in my case I had;

/vmfs/volumes/49b13e24-6619f880-49fd-00151798cc79/Linuxx64 # ls -hlat
-rw------- 1 root root 20.0G Jan 9 16:11 Linux x64 Clone-flat.vmdk
-rw------- 1 root root 486 Jan 9 16:09 Linux x64 Clone.vmdk
drwxr-xr-t 1 root root 2.9k Jan 9 15:58 ..
drwxr-xr-x 1 root root 560 Jan 9 15:45 .
/vmfs/volumes/49b13e24-6619f880-49fd-00151798cc79/Linuxx64 #

It’s the highlighted orange one we want, the *-flat.vmsk is the actual disk image data.  Once opened you will have something like;

# Disk DescriptorFile
version=3
CID=7d8e12e8
parentCID=ffffffff
createType="vmfs"
# Extent description
RW 524288000 VMFS "Linux x64 Clone-flat.vmdk"
# The Disk Data Base
#DDB
ddb.toolsVersion = "7458"
ddb.adapterType = "lsilogic"
ddb.geometry.sectors = "63"
ddb.geometry.heads = "255"
ddb.geometry.cylinders = "32635"
ddb.uuid = "60 00 C2 93 7a c9 31 2b-8d 11 61 d1 30 66 5c 41"
ddb.virtualHWVersion = "7"

Note the highlighted values simply change to;

# Disk DescriptorFile
version=1
CID=7d8e12e8
parentCID=ffffffff
createType="vmfs"
# Extent description
RW 524288000 VMFS "Linux x64 Clone-flat.vmdk"
# The Disk Data Base
#DDB
ddb.toolsVersion = "7458"
ddb.adapterType = "lsilogic"
ddb.geometry.sectors = "63"
ddb.geometry.heads = "255"
ddb.geometry.cylinders = "32635"
ddb.uuid = "60 00 C2 93 7a c9 31 2b-8d 11 61 d1 30 66 5c 41"
ddb.virtualHWVersion = "4"

That simple, honest, edit in a text file and you’d done.  If you try and and this to Virtual Machine under Esx or Esxi 3.5 it will now see the vmdk and work just fine, in my case at least

Andy Flisher is a Software Developer based in the North East of England specialising in cross platform development. Mobile Development experience includes Windows Phone, Android, and iPhone Apps. Desktop Software Development includes bespoke Windows, Linux, and Mac Applications. Web Development Skills include PHP, Perl, Python, ASP (Classic and .NET) – Andy Flisher on Google+