Automation

 View Only
  • 1.  resourcepool does not take two words as inputc

    Posted Nov 08, 2011 03:19 PM

    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


  • 2.  RE: resourcepool does not take two words as inputc

    Posted Nov 08, 2011 04:23 PM

    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



  • 3.  RE: resourcepool does not take two words as inputc

    Posted Nov 08, 2011 04:23 PM

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



  • 4.  RE: resourcepool does not take two words as inputc

    Posted Nov 08, 2011 05:30 PM

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



  • 5.  RE: resourcepool does not take two words as inputc

    Posted Nov 08, 2011 05:39 PM

    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")



  • 6.  RE: resourcepool does not take two words as inputc

    Posted Nov 08, 2011 05:52 PM

    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.



  • 7.  RE: resourcepool does not take two words as inputc

    Posted Nov 08, 2011 05:56 PM

    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



  • 8.  RE: resourcepool does not take two words as inputc

    Posted Apr 01, 2019 10:26 PM

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



  • 9.  RE: resourcepool does not take two words as inputc

    Posted Nov 08, 2011 06:09 PM

    Right, i got it wrong initially,

    thanks all for the replies.