VMware Cloud Community
vmk2014
Expert
Expert

CPU, Cores per CPU and Total cores in standalone Host

Hello Experts,

we have a stand alone ESXi hosts 600 spread across globally, but we want to fetch CPU for Host/cores per CPU and Total cores in the below format. Is it possible to fetch this value from power Cli for Stand alone host ?

Note :- ESXi Host list we have. E.g. C:\temp\lists

   

Hostname# CPUCores per CPU# Total Cores
Host141560
Host241560
Host341560
Host441560
Host541560
Host641560
Host741560
Host841560

Thanks

Vk

Tags (1)
Reply
0 Kudos
1 Reply
LucD
Leadership
Leadership

Do you have the credentials for all these ESXi nodes?

I assume they are in $user and $pswd

Get-Content -Path 'C:\temp\lists' -PipelineVariable esxName |

ForEach-Object -Process {

    Connect-VIServer -Server $esxName -User $user -Password $pswd


    Get-VMHost |

    Select Name,

        @{N='NumberCPU';E={$_.ExtensionData.Summary.Hardware.numCpuPkgs}},

        @{N='CorePerCPU';E={$_.ExtensionData.Summary.Hardware.numCpuCores}},

        @{N='CoreTotal';E={$_.ExtensionData.Summary.Hardware.numCpuPkgs*$_.ExtensionData.Summary.Hardware.numCpuCores}}


    Disconnect-VIServer -Server $esxName -Confirm:$false

} | Export-Csv -Path .\report.csv -NoTypeInformation -UseCulture


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

Reply
0 Kudos