ESXi5: Call fails for “HostDatastoreSystem.QueryVmfsDatastore- CreateOptions” for object “ha-datastoresystem”

VMwareAddStorage2 When trying to format my local disk on my new ESXi5 host I recieved the error captured in the screenshot. The error give is: Call fails for “HostDatastoreSystem.QueryVmfsDatastore- CreateOptions” for object “ha-datastoresystem” 

I did a quick bit of Googling and I found this article which talks you through the steps required to fix this issue with ESX4.1. Part of the process uses fdisk. Fdisk is not available with ESXi5, you are forced to use partedUtil


I tried various commands to try and fix the problem, but most of the commands returned me the following error:

/dev # partedUtil fix /vmfs/devices/disks/t10.ATA_____VB0250EAVER_____________________________9VMTB7GC____________
Error: The primary GPT table states that the backup GPT is located beyond the end of disk. This may happen if the disk has shrunk or partition table is corrupted. Fix, by writing backup table at the end? diskPath (/dev/disks/t10.ATA_____VB0250EAVER_____________________________9VMTB7GC____________) disk->dev->length (488397168) gpt->AlternateLBA (1465191167)
Error: Can't have a partition outside the disk!
Error: Can't have a partition outside the disk!

The command you need to use to fix this problem is mklabel, for example:

/dev # partedUtil mklabel /vmfs/devices/disks/t10.ATA_____VB0250EAVER_____________________________9VMTB7GC____________ gpt

After you have run this command, head back into the vSphere client and try and format the disk again. Hopefully you should now be successful.