VMware Cloud Community
simpleme
Contributor
Contributor

export cluster details

Hi,

Im new to PowerCLI, how can i get a report for all the clusters in particular VC, also if possible to get all host list which are on that clusters and which VMs are on each host

basically mapping the VC , to know which vm is belong to which host, and which host is belong to which cluster. 

---cluster

      |--- host

           |--- vm 

           |--- vm

 

thanks in advance.  

0 Kudos
1 Reply
LucD
Leadership
Leadership

You can do that in a pipeline construction.
Something like this for example

Get-Cluster -PipelineVariable cluster |
Get-VMHost -PipelineVariable esx |
Get-VM |
Select @{N='Cluster';E={$cluster.Name}},
  @{N='VMHost';E={$esx.Name}},
  @{N='VM';E={$_.Name}}

 


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