VMware – Thin Provisioning Woes

Recently I found myself in a situation where someone had deleted the contents of a SAN LUN that was used to host a proportion of virtual machines for a VMware vSphere infrastructure. Thankfully, there was a full backup of all virtual machines at my disposal. After restoring a virtual machine to an alternate location and then uploading it to the datastore, I experienced the following error when attempting to start the VM:

“Failed to open disk scsi0:0: Unsupported and/or invalid disk type 7. Did you forget to import the disk first?Unable to create virtual SCSI device for scsi0:0, ‘/vmfs/volumes/4a8075b3-4e4bf1b8-28e40017a48d6112/VMFolder/VirtualMachine.vmdk’ Module DevicePowerOn power on failed.”

After some research, it emerged that this issue was due to the fact all of the virtual machines were thin provisioned when created. When restoring a backed up virtual machine that has been created using a product such as Symantec Backup Exec 2010, a 2gbsparse disk is created that cannot be used with virtual machines hosted in ESX, which causes the error listed above. To resolve this issue we need to essentially convert the thin provisioned disk to a thick provisioned disk. This can be achieved by performing the following:

1. Log into the root of an ESX host using an SSH client

2. Change directory to the location of the restored virtual machine

3. Run the following command: vmkfstools –i “Thindisk.vmdk” -d zeroedthick “Thickdisk.vmdk” . Please note, replace thindisk with your restored vmdk file name, and replace thickdisk with the new name for the vmdk file.

4. The clone operation will now start and a percentage complete indicator will be displayed. Once this is finished the thick provisioning of the vmdk will be complete and you will now be able to start your virtual machine. Please note that you will need sufficient space on your LUN to allow for the thick provisioning.

For reference, here’s VMware’s slightly unclear article on the procedure: http://kb.vmware.com/kb/1005628

Leave a Reply

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