VMware Cloud Community
vTrack
Contributor
Contributor
Jump to solution

cluster name of a resource pool

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?

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos
1 Reply
LucD
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos