Greetings all,
I'm at a complete loss on this and have spent several days trying to figure out what is wrong. I am deploying a new VM from a template using PowerCLI version 5.1 Release 1. The template is thin-provisioned as all of our templates are, but when specifying my "New-VM" command, the resulting VM always deploys as thin-provisioned even though I specify "Thick". Here is the command I am running:
PowerCLI C:\> New-VM -Template $templatename -Datastore $datastoreClustername -DiskStorageFormat EagerZeroedThick -VMHost $hostname -Name $newVMname -Location $foldername
The above command returns the error below stating that "EagerZeroedThick" is not a valid option for the -DiskStorageFormat parameter (even though I clearly see it is via "Get-Help -Detailed New-VM")...:
New-VM : 2/20/2014 12:09:18 PM New-VM Invalid storage format specified. Valid values are 'Thin' and 'Thick'.
At line:1 char:7
+ New-VM <<<< -Template (Get-Template -Id VirtualMachine-vm-1060) -Datastore Orion1_DSCluster -DiskStorageFormat EagerZeroe
dThick -VMHost orion2esx01.cisco.com -Name rcdn6-vm91-8 -Location "Generic User (jstest)"
+ CategoryInfo : InvalidArgument: (:) [New-VM], InvalidArgument
+ FullyQualifiedErrorId : Client20_VMServiceImpl_GetnerateCloneSpec_IvalidStorageFormat,VMware.VimAutomation.ViCore.Cmd
lets.Commands.NewVM
So I try the same command above, only this time using "Thick":
PowerCLI C:\> New-VM -Template $templatename -Datastore $datastoreClustername -DiskStorageFormat Thick -VMHost $hostname -Name $newVMname -Location $foldername
The above command will successfully deploy a new VM from the specified template, however the resulting VM will always be Thin-Provisioned instead of Thick like I specify...
I've Google'd the heck out of this issue and haven't come up with anything that helps me... I've tried every combination of parameters and parameter order hoping that'd be the trick to no avail. As I said, I'm at a complete loss and am hoping someone on here can point me in the right direction.
To SUM up, my 2 issues are:
This is a vCenter/vSphere 5.1 Update 1 environment.
Thanks in advance for your help.
I finally received an answer from Vmware Support concerning this and thought I'd share for anyone else running into this issue:
Vmware Support:
"I confirmed and found out that this is a bug which is already running from our PR Team who fixes it.
And confirmed that this will be fixed in next major release of VMware Power CLI.
And as of now there is no ETA for it but i would expect it be release along with ESXi 5.5 U1 but i cannot confirm it."
I would check which PowerCLI version you are running, and probably just reinstall/upgrade it to see if that helps. I believe for some of the really older version the only valid values were thin and thick.
I've done that, and I am indeed running PowerCLI 5.1 Release 1 as can be seen below:
PowerCLI C:\> Get-PowerCLIVersion
PowerCLI Version
----------------
VMware vSphere PowerCLI 5.1 Release 1 build 793510
---------------
Snapin Versions
---------------
VMWare AutoDeploy PowerCLI Component 5.1 build 768137
VMWare ImageBuilder PowerCLI Component 5.1 build 768137
VMware License PowerCLI Component 5.1 build 669840
VMware vSphere PowerCLI Component 5.1 build 793489
That is weird, maybe just install the PowerCLI 5.5 version, or uninstall reinstall your current version.
I had upgraded from the 5.0 version to 5.1 last night in the hopes that would resolve the issue. The issue with trying 5.5 is two-fold:
So I'd much rather try to figure out what the issue is before attempting PowerCLI 5.5 especially since there are plenty of people using 5.1 with the parameter options I'm trying (according to my Google search results).
You upgraded PowerCLI from 5.0 to 5.1, and you were asked to reboot.
Which you have not done yet. Correct ?
Then it looks as if you are still using some of the PowerCLI 5.0 DLLs.
That's probably why the installation asked for a reboot.
And in PowerCLI 5.0 EagerZeroedThick was not supported.
Can't you install PowerCLI 5.1 on another machine (a PC) and check if the EagerZeroedThick option is accepted.
As a sidenote, I'm not a big fan of installing PowerCLI on your vCenter.
But I understand that in some environments this can't be avoided.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I guess I should have been more elaborative in my last response.
You are correct that I can install PowerCLI on a separate machine. In fact, I do have a main development machine which I've uninstalled PowerCLI 5.0 and then fresh installed PowerCLI 5.1. I am still getting the very same behavior as in my original post. The only reason I mentioned the installation on my vCenter Server was because I was literally grasping at straws trying to figure out what the issue is... The vCenter Server had an installation of PowerCLI 5.0 on it from when we originally installed vCenter Server 5.0. I thought that maybe, somehow, upgrading that would help the situation, so I did that last night, rebooted as it asked, and still the problem persists. Since we have upgraded to vCenter Server 5.1, I was hoping that having the older 5.0 version of PowerCLI was somehow interfering.
Your explanation that PowerCLI 5.0 does not support the EagerZeroedThick option and that somehow, older DLLs are still in use after upgrading to PowerCLI 5.1 would make sense. I've done so much Googling on this issue that maybe the instances I've seen the EagerZeroedThick option used, they were using 5.1. So if that is indeed the case (which would make the most sense), I would think a complete un-install & fresh install of PowerCLI 5.1 would rectify the problem; however as I stated above, I've done that and I still get the same behavior as my original post:
-DiskStorageFormat <VirtualDiskStorageFormat>
Specify the storage format of the disks of the virtual machine. This parameter accepts Thin, Thick, and EagerZeroedThick values.
Strange, perhaps you should make a support call.
PowerCLI is supported after all.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Ok, now for some more WTF to add to the mix... On a whim, I decided to deploy a new "empty" VM using EagerZeroedThick as the -DiskStorageFormat option, and it deployed without errors and was EagerZeroedThick, not Thin (see below)!
PowerCLI C:\> New-VM -Name Test5480 -VMHost orion2esx01.cisco.com -Datastore Orion1_DSCluster -DiskMB 4000 -DiskStorageFormat EagerZeroedThick -MemoryMB 1024 -Location "Generic User (jstest)"
Name PowerState Num CPUs MemoryGB
---- ---------- -------- --------
Test5480 PoweredOff 1 1.000
But as you can see, when trying to deploy from a template, I get the error that only 'Thin' and 'Thick' are valid values (see below)...
PowerCLI C:\> New-VM -Template (Get-Template -Id VirtualMachine-vm-1060) -Datastore Orion1_DSCluster -DiskStorageFormat EagerZeroedThick -VMHost orion2esx01.cisco.com -Name rcdn6-vm91-8 -Location "Generic User (jstest)"
New-VM : 2/20/2014 4:29:41 PM New-VM Invalid storage format specified. Valid values are 'Thin' and 'Thick'.
At line:1 char:1
+ New-VM -Template (Get-Template -Id VirtualMachine-vm-1060) -Datastore Orion1_DSC ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [New-VM], InvalidArgument
+ FullyQualifiedErrorId : Client20_VMServiceImpl_GetnerateCloneSpec_IvalidStorageFormat,VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVM
I'm starting to think there is a bug in the New-VM cmdlet. I took that VM that deployed successfully above (it is EagerZeroedThick) and converted it to a Template to see if maybe it was a problem with the Template I've been trying to use. As you can see below, I got the same error as before stating that only 'Thin' and 'Thick' are supported values for -DiskStorageFormat.
PowerCLI C:\> New-VM -Template Test5480 -Datastore Orion1_DSCluster -DiskStorageFormat EagerZeroedThick -VMHost orion2esx01.cisco.com -Name rcdn6-vm91
-8 -Location "Generic User (jstest)"
New-VM : 2/20/2014 4:42:20 PM New-VM Invalid storage format specified. Valid values are 'Thin' and 'Thick'.
At line:1 char:1
+ New-VM -Template Test5480 -Datastore Orion1_DSCluster -DiskStorageFormat EagerZe ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [New-VM], InvalidArgument
+ FullyQualifiedErrorId : Client20_VMServiceImpl_GetnerateCloneSpec_IvalidStorageFormat,VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVM
So I converted the Template back to a VM, and issued the exact same command, this time instead of specifying -Template, I used -VM to clone it. You can see that there were no errors given and the VM was successfully cloned with EagerZeroedThick disks!
PowerCLI C:\> New-VM -VM Test5480 -Datastore Orion1_DSCluster -DiskStorageFormat EagerZeroedThick -VMHost orion2esx01.cisco.com -Name rcdn6-vm91-8 -Lo
cation "Generic User (jstest)"
Name PowerState Num CPUs MemoryGB
---- ---------- -------- --------
rcdn6-vm91-8 PoweredOff 1 1.000
Seems like you might have found a "feature" :smileygrin:
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I finally received an answer from Vmware Support concerning this and thought I'd share for anyone else running into this issue:
Vmware Support:
"I confirmed and found out that this is a bug which is already running from our PR Team who fixes it.
And confirmed that this will be fixed in next major release of VMware Power CLI.
And as of now there is no ETA for it but i would expect it be release along with ESXi 5.5 U1 but i cannot confirm it."
Thanks for sharing that info
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Edit: Discovered the root cause today. We were using an NFS staging datastore, and thus could not provision Thick Disks. A warning or error might have been helpful, but everything is working!
Thanks for sharing. Just noticed this behavior in a deployment system I'm building with VMware vSphere PowerCLI 5.5 Release 2 build 1649237...
"Correct Answer" was posted March 7th. PowerCLI 5.5 R2 was released March 11th. I suppose they meant two major releases from then...
I assume PowerCLI won't be updated out of band, despite what appears to be a broken feature? Any tips on workaround? Ideally with minimal to no processing, no migration?
Note that this behavior is not from a template. This is a straight up empty VM. Here are the parameters I pass New-VM:
$newVMParams = @{
Name = $Name
VMHost = $vmhost
Location = $folder
Datastore = $datastore
DiskGB = $DiskGB
DiskStorageFormat = 'Thick'
MemoryGB = $MemoryGB
NumCPU = $NumCPU
PortGroup = $virtualPortGroup
GuestID = $GuestID
}