Converting the Sparseimage to VMDK format

During this I will be using to Command Line utilities that are installed as part of VMware Fusion.

First off, open ‘Disk Utility’, located at ‘/Applications/Utilities/’, and select the volume called ‘ServerHD’ from the list of disks, as shown in the screenshot below.

Post-370-26-Disk-Utility-Unmount

Now click the button named ‘Unmount’ in the top of the window.
The text ‘ServerHD’ in the list of disks, should now be dimmed slightly.

While the volume ‘ServerHD’ is still selected, click the button named ‘Info’ in the top of the window. This will bring up a information window, containing detailed information about the volume ‘ServerHD’.

Post-370-27-Disk-Utility-Info

In this case we are interested in the information called ‘Disk Identifier’. In my case this is ‘disk2s2′, note down the disk number, in my case ‘disk2′.

Now close the ‘Disk Utility’ application.

Open up ‘Terminal’ located in ‘/Applications/Utilities/’.

Run the following command:

Using the Command Line utility called ‘vmware-rawdiskCreator’, I will create a VMDK, which actually links to the Sparseimage, using the below command.
Please adjust the command with the disk number (‘disk2′), noted down earlier, and with a output path and file name of your choice (‘/Users/mads/Desktop/OS-X-Template-link’).

In my case I now have a VMDK file on my Desktop called ‘OS-X-Template-link.vmdk’. But this is in fact a empty VMDK file, linking to the Sparseimage.

Using the Command Line utility called ‘vmware-vdiskmanager’, I will now convert the VMDK-link file to a actual VMDK file containing the contents of the Sparseimage.
Run the below command, and as before change the input file (‘/Users/mads/Desktop/OS-X-Template-link.vmdk’) and output file (‘/Users/mads/Desktop/OS-X-Template.vmdk’), with the files of your choice.

The ‘4’ option in the above command, specifies that the output file should be in the format ‘preallocated ESX-type virtual disk’, which will generate a preallocated VMDK usable on ESX and ESXi hypervisiors. In my case this will amount to a 30GB VMDK file on my Desktop.
This command takes quite some time to finish, but it displays progress information along the way.

When it is finished, you can delete the Link file (‘/Users/mads/Desktop/OS-X-Template-link.vmdk’), because it is not needed any more.
Also you can open up ‘Disk Utility’ located in ‘/Applications/Utilities/’ and eject the Sparseimage file ‘ServerHD.sparseimage’

I now have two VMDK files on the Desktop:

OS-X-Template.vmdk
OS-X-Template-flat.vmdk

The ‘OS-X-Template.vmdk’ is a descriptive file, containing information about the actual storage VMDK file, called ‘OS-X-Template-flat.vmdk’. They are both relevant, as they together form the VMDK disk I will be uploading to the Datastore in vCenter.