Any idea why this command doesn't work?
PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> New-Cluster -location 'Natio
nal Can Industry' -Name Cluster1
PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> New-Cluster -location 'Natio
nal Can Industry' -Name Cluster1
New-Cluster : 7/03/2013 3:45:03 PM New-Cluster The specified parameter 'Location' expects
a single value, but your name criteria 'National Can Industry' corresponds to multiple values.
At line:1 char:12
+ New-Cluster <<<< -location 'National Can Industry' -Name Cluster1
+ CategoryInfo : InvalidResult: (System.Collecti...dObjectInterop]:List`1) [New-Clust
er], VimException
+ FullyQualifiedErrorId : Core_ObnSelector_SelectObjectByNameCore_MoreResultsThanExpected,VMwa
re.VimAutomation.ViCore.Cmdlets.Commands.NewCluster
New-Cluster : 7/03/2013 3:45:03 PM New-Cluster VIContainer parameter: Could not find any
of the objects specified by name.
At line:1 char:12
+ New-Cluster <<<< -location 'National Can Industry' -Name Cluster1
+ CategoryInfo : ObjectNotFound: (VMware.VimAutom...tainer Location:RuntimePropertyIn
fo) [New-Cluster], ObnRecordProcessingFailedException
+ FullyQualifiedErrorId : Core_ObnSelector_SetNewParameterValue_ObjectNotFoundCritical,VMware.
VimAutomation.ViCore.Cmdlets.Commands.NewCluster
The location "National Can Industry" seems to be returned more than once.
This can be caused by 2 folders of the same name by multiple vCenter connections while configured in multi mode.
To check the first option do:
Get-Folder -Name "National Can Industry'
and check if you see more than 1 object returned.
The 2nd possibility can be investigated by doing
Get-PowerCLIConfiguration
and verifying if DefaultVIServerMode says Multiple ?
If it does, display the open connections by
$defaultviservers
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You are trying to create a cluster under a blue folder, that is not allowed.
The blue folders are from the VMs and Templates inventory view, and you can only store VMs, vApps or other blue folders under such a folder.
Take a folder or datacenter from the yellow folders (the Hosts and Cluster inventory view).
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I figure it out. The reason it doesn work is because the blue folder has the same name as datacenter. Thank you for your help 🙂