I'm attempting to add a new HardDisk to a VM on an NFS datastore that enforces thin provisioning. Our NFS volumes are set to auto grow if they reach a certain threshold. This normally isn't a problem, and so we over-provision like crazy.
Recently, however, we've run into an issue where the size of a new Harddisk exceeds the free space of the datastore. It responds with the following error (creating a 1.99TB VMDK):
PowerCLI D:\> New-HardDisk -VM $vm -CapacityGB (1.99 * 1024) -Datastore $datastore
New-HardDisk : 4/8/2014 10:44:09 AM New-HardDisk The operation for the entity VirtualMachine-vm-10964 failed with the following message: "Insufficient disk space on datastore 'datastore1'."
Performing the same task in the vSphere Client produces the following warning, which can be bypassed by clicking "OK":
I've attempted to create a smaller disk and increase it, but I get the same error. I don't see a -Force parameter or anything equivalent. Is it possible to overcommit via PowerCLI?
Is the ThinProvisioned switch an option, or does that conflict with the NFS setup ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Is the ThinProvisioned switch an option, or does that conflict with the NFS setup ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
In the client it's not an option, so I didn't even try specifying the Storage Format.
The following command works!:
New-HardDisk -VM $vm -Datastore $datastore -CapacityGB (1.99 * 1024) -StorageFormat Thin
Thanks, Luc!
Edit: By not an option, I mean it's grayed out:
It's indeed grayed out, but I notice that the default is Thin in the client.
It looks like the cmdlet doesn't have this intelligence, so adding it explicitly seems to do the trick.
Perhaps the PowerCLI Dev Team should have a look at this ?
Btw, the ThinProvisioned switch is deprecated, and you should indeed use the StorageFormat parameter like you did.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
That was my thought, too. At some point, the enforcement from the storage controller does come into play. Even without the switch, new harddisks are thinly provisioned on these NFS datastores, but thickly-provisioned on SAN datastores that we have.
I'd be happy to submit this to the Dev Team. I'll look into how to do that.
Thanks again, Luc.
You just did, thanks for letting us know about this.