Running 11.1 of PowerCLI
vCenter cluster is 6.5
I can create VMs with GUI without fail
I am connected to my vcenter server as evident from using $global:defaultviserver
My Get-Datastore and Get-VMHost return valid entries and the store I want to use and host I want to use
This is all you get when PowerCLI does not like your command or it fails:
New-VM : 4/24/2019 7:48:23 AM New-VM
At D:\git\moe\build\testVMCreate.ps1:14 char:1
+ New-VM -Name $targetvm1 -Datastore $datastore -VMHost $VMHost -Locati ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-VM], VimException
+ FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVM
Not much to go on (hint PowerCLI developers, can we enhance this to give more feedback please?)
This is the command I am using with obvious variables
Get-Folder returns the location I have unfocused in command above
I have tried stripping out many arguments and parameters to get to basic command and nothing works.
The odd thing is the New-VM command documentation says -Template is required. Can't I simply create a new VM from raw parameters?
Creating a new template requires a VM to create it from. See the issue there? New-VM needs a template, New-Template needs a VM, according to the docs.
You do realize that your link is simply pointing to the beginning of this thread right?
Does 11.2 fix this thread?
Afaik, no, the problem was reported in 11.2.
You'll have to wait for the next release I'm afraid.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
When is 11.4 releasing so I can see if the new-vm works?
I don't think the roadmap is made public.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I see 11.4 is available.
Did this issue get fixed?
It is not explicitly listed in the 11.4.0 release notes, but you can give it a try.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Tried 11.4, same thing
Useless
So, 28 months goes by, I try to use 12.3 of PowerCLI with a vcenter running 6.7 and I get:
+ New-VM -Name $targetvm1 -Datastore $datastore -VMHost $VMHost -Locati ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-VM], VimException
+ FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVM
Same response, over 2 years go by and zero done to this command to raise more diagnostic information.
Went back to 12.2 and it works.
Not much to go on (hint PowerCLI developers, can we enhance this to give more feedback please?)