GovindaG
Contributor
Contributor

resourcepool does not take two words as inputc

Hi,

The resourcepool parameter does not take inputs such as  Business Critical, see my simple code below and error.

New-VM -Name ibgkbapp01 -Template rhel5u5-64-v7 -Datastore vmfs_duprb1_ns960_0650_20 -ResourcePool Business Critical

The Error :

New-VM : 11/8/2011 10:13:10 AM    New-VM        The specified parameter 'ResourcePool' expects a single value, but your name criteria 'Business Critical' corresponds to multiple
values.   
At C:\Documents and Settings\gajulg\Local Settings\Temp\911c0993-9ebb-4433-971a-1040b2f0468d.ps1:2 char:7
+ New-VM <<<<  -Name ibgkbapp01 -Template rhel5u5-64-v7 -Datastore vmfs_duprb1_ns960_0650_20 -ResourcePool 'Business Critical'
    + CategoryInfo          : InvalidResult: (System.Collecti...dObjectInterop]:List`1) [New-VM], VimException
    + FullyQualifiedErrorId : Core_ObnSelector_SelectObjectByNameCore_MoreResultsThanExpected,VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVM
New-VM : 11/8/2011 10:13:10 AM    New-VM        VIContainer parameter: Could not find any of the objects specified by name.   
At C:\Documents and Settings\gajulg\Local Settings\Temp\911c0993-9ebb-4433-971a-1040b2f0468d.ps1:2 char:7
+ New-VM <<<<  -Name ibgkbapp01 -Template rhel5u5-64-v7 -Datastore vmfs_duprb1_ns960_0650_20 -ResourcePool 'Business Critical'
    + CategoryInfo          : ObjectNotFound: (VMware.VimAutom...er ResourcePool:RuntimePropertyInfo) [New-VM], ObnRecordProcessingFailedException
    + FullyQualifiedErrorId : Core_ObnSelector_SetNewParameterValue_ObjectNotFoundCritical,VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVM
0 Kudos
8 Replies
Rubeck
Virtuoso
Virtuoso

And using -ResourcePool "Business Critical" doesn't make a difference.. ?

Im no wiz at it, but it was the first thing that came into mind...

/Rubeck

0 Kudos
vlife201110141
Enthusiast
Enthusiast

Please change -resourcepool parameter like "Business Critical" and give it a try...

0 Kudos
GovindaG
Contributor
Contributor

Tried that, but no user, it still complains of the same error

0 Kudos
GovindaG
Contributor
Contributor

I got something like this and it worked great.

Move-VM -VM (Get-VM -Name ibgkbapp01) -Destination (Get-Cluster duprb1| Get-ResourcePool -Name "Business Critical")

0 Kudos
LucD
Leadership
Leadership

The error message you got is clear, it says "expects a single value".

It looks as if you have at least 2 resource pools with the name "Business Critical" in your vSphere environment.

By passing a specific cluster to the Get-ResourcePool cmdlet, you are in fact providing the Location parameter through the pipeline.

That way the cmdlet could return 1 specific resource pool.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
RvdNieuwendijk
Leadership
Leadership

You probably have more than one cluster with a resourcepool called "Business Critical". The command in your first post returned all these resourcepools and didn't know where to put the new VM. The command in your last post selects the "Business Critical" resourcepool in the right cluster.

(Get-Cluster duprb1| Get-ResourcePool -Name "Business Critical")

returns only one resourcepool and your command is happy.

Regards, Robert

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos
GovindaG
Contributor
Contributor

Right, i got it wrong initially,

thanks all for the replies.

0 Kudos
supraturtle
Contributor
Contributor

Eight years later and the information is still a lifesaver. Thank You Kindly!

0 Kudos