Greetings!
EDIT: This was our own doing. It turns out our staging datastore was on NFS storage. My apologies for any confusion. Leaving this post for the record in case any other misguided souls come across the issue. Thanks!
I'm working on a PowerCLI based deployment system in an environment that requires using Thick storage format disks. All is going well. Everything works. Until I started digging into properties of the resulting VMs. That's odd, they're thin disks. Even though I hard code DiskStorageFormat = 'Thick'
Quick google search, turns out this is a (now) known issue with PowerCLI. The correct answer states that this might be fixed in the next major release. When that major release came a few days later, it was not included.
Here's my environment:
PowerCLI Version
----------------
VMware vSphere PowerCLI 5.5 Release 2 build 1649237
---------------
Snapin Versions
---------------
VMWare AutoDeploy PowerCLI Component 5.5 build 1598391
VMWare ImageBuilder PowerCLI Component 5.5 build 1598391
VMware License PowerCLI Component 5.5 build 1265954
VMware VDS PowerCLI Component 5.5 build 1648910
VMware vSphere PowerCLI Component 5.5 build 1648910
#vCenter 5.0.0 Build 913577
#ESXi 5.0.0 build 914586
Any tips on a workaround? I would really like to avoid spending time working around a known bug.
Here's the code I use to provision a VM:
$newVMParams = @{
Name = $Name
VMHost = $vmhost
Datastore = $datastore
DiskGB = $DiskGB
DiskStorageFormat = 'Thick'
MemoryGB = $MemoryGB
NumCPU = $NumCPU
PortGroup = $virtualPortGroup
GuestID = $GuestID
Location = $folder
}
#Create the VM
Try
{
$status = "Creating VM"
Write-SQL -SQLParams @{ Status = $status}
Write-Verbose $status
$vm = New-VM @newVMParams -ErrorAction stop
}
Thin disk every time. Okay, maybe I can remove the hard disk and add a new one. Simple operation, should be fast, I can deal with this until a fix is released.
$vm | get-harddisk | remove-harddisk -DeletePermanently
$vm | new-harddisk -DiskType Flat -CapacityGB 40 -StorageFormat Thick -Persistence Persistent
$vm | get-harddisk | Select StorageFormat
#Thin. Again.
Even more interesting? The option for Thick Provision Lazy or Eager is greyed out in the vSphere client for this VM.
PowerCLI experts! Any tips on working around this? I want a thick disk. As long as there is no room for error, performance impact, or significant delay, I don't care how I get it. Please help!
VMware - Please fix this bug. I'm assuming both New-VM and New-HardDisk share some underlying call to the API or something else that is causing this. This is literally putting a stop to rolling out our new deployment solution....
Cheers!