VMware Cloud Community
tdubb123
Expert
Expert

getting vmhosts inventory

can i get some help on the following

trying to find all vmhoss and get some information

HOST, DATACENTER, Cluster, #CPUS, #CORES/CPU, #NICS, $HBAS

0 Kudos
3 Replies
kunaludapi
Expert
Expert

Get-VMHost | Select Name, @{N="Datacenter"; e={($_ | Get-Datacenter).name}}, @{N="Cluster"; e={($_ | Get-Cluster).name}}, @{N="Datacenter"; e={($_ | Get-Datacenter).name}}, @{N="CPU"; e={$_.ExtensionData.Summary.Hardware.NumCpuPkgs}},@{N="CPUcore"; e={$_.ExtensionData.Summary.Hardware.NumCpuCores/$_.ExtensionData.Summary.Hardware.NumCpuPkgs}},@{N="NICs"; e={$_.ExtensionData.summary.hardware.NumNics}}, @{N="HBAs"; e={($_ | Get-VMHostHba).count}}

--------------------------------------------------------------- Kunal Udapi Sr. System Architect (Virtualization, Networking And Storage) http://vcloud-lab.com http://kunaludapi.blogspot.com VMWare vExpert 2014, 2015, 2016 If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".
0 Kudos
tdubb123
Expert
Expert

hi

when I go

Get-VMHost | Select Name, @{N="Datacenter"; e={($_ | Get-Datacenter).name}}


It only shows the hosts but not the DC Name.

0 Kudos
Wh33ly
Hot Shot
Hot Shot

Try this

Get-VMHost | Select Name, @{N="Datacenter"; e={(Get-Datacenter -vmhost $_).name}}

*removed select -first 1 (used it for testing)

0 Kudos