Automation

 View Only
  • 1.  cluster name of a resource pool

    Posted Aug 16, 2016 12:23 PM

    I am trying to find the name of the Cluster of a Resource Pool in vCenter. Tried running Get-ResourcePool, but couldn't find cluster info.

    My input would be -

    > name of ResourcePool

    > name of vCenter and credentials

    and get the name of cluster where the resource pool is created. Could someone help please?



  • 2.  RE: cluster name of a resource pool
    Best Answer

    Posted Aug 16, 2016 03:32 PM

    Try like this

    $vCenter = 'MyVC'

    $rPool = 'MyRP'

    $rp = Get-ResourcePool -Name $rPool

    $cluster = $rp.Parent

    while($cluster -isnot [VMware.VimAutomation.ViCore.Types.V1.Inventory.Cluster]){

        $cluster = $cluster.Parent

    }

    $cluster.Name