Contributor
Contributor

cluster name of a resource pool

Jump to solution

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?

0 Kudos
1 Solution

Accepted Solutions
Leadership
Leadership

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


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

View solution in original post

0 Kudos
1 Reply
Leadership
Leadership

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


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

View solution in original post

0 Kudos