Automation

 View Only
  • 1.  CPU, Cores per CPU and Total cores in standalone Host

    Posted Jul 12, 2020 04:58 PM

    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



  • 2.  RE: CPU, Cores per CPU and Total cores in standalone Host

    Posted Jul 12, 2020 05:25 PM

    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