PowerCLI: Processor Types

Ever wanted to check the hosts in your vCenter to make sure they are all the same type, you can use the following one liner to do this:

Get-VMHost | Sort Name | Get-View | Select Name, @{N=CPU;E={$_.Hardware.CpuPkg[0].Description}} | Export-Csv c:\cpuinfo.csv

Sample Output:

Name CPU
tesesx01.mydomain.com Intel(R) Xeon(R) CPU 5160 @ 3.00GHz
tesesx02.mydomain.com Intel(R) Xeon(R) CPU 5160 @ 3.00GHz
tesesx03.mydomain.com Intel(R) Xeon(R) CPU E5450 @ 3.00GHz
tesesx04.mydomain.com Intel(R) Xeon(R) CPU E5450 @ 3.00GHz
tesesx05.mydomain.com Intel(R) Xeon(R) CPU E5450 @ 3.00GHz
tesesx06.mydomain.com Intel(R) Xeon(R) CPU E5450 @ 3.00GHz
tesesx07.mydomain.com Intel(R) Xeon(R) CPU E5450 @ 3.00GHz

Or if you want to add the cluster name in there as well:

Get-VMHost | Sort Name | Get-View | Select Name, @{N=Cluster;E={Get-Cluster -VMHost (Get-VMHost $_.Name)}},@{N=CPU;E={$_.Hardware.CpuPkg[0].Description}} | Export-Csv c:\cpuinfo.csv

Sample Output:

Name Cluster CPU
tesesx01.mydomain.com Test Intel(R) Xeon(R) CPU 5160 @ 3.00GHz
tesesx02.mydomain.com Test Intel(R) Xeon(R) CPU 5160 @ 3.00GHz
tesesx03.mydomain.com Production Intel(R) Xeon(R) CPU E5450 @ 3.00GHz
tesesx04.mydomain.com Production Intel(R) Xeon(R) CPU E5450 @ 3.00GHz
tesesx05.mydomain.com Production Intel(R) Xeon(R) CPU E5450 @ 3.00GHz
tesesx06.mydomain.com Production Intel(R) Xeon(R) CPU E5450 @ 3.00GHz
tesesx07.mydomain.com Production Intel(R) Xeon(R) CPU E5450 @ 3.00GHz

3 thoughts on “PowerCLI: Processor Types

  1. Ronald Kabelich

    We have some new Dell ESX-Hosts and the type of the CPU hardware does not match the shown type of the VMs.
    Is there any way to get the CPU-type reported to the VM via PowerCLI to Review all VMs?

  2. Daniel Hernandez

    Do you know how to also extract the CPU stepping ?
    When you cat /proc/cpuinfo
    The stepping value is what am looking for.

    I know on some HP BL460c G1 the 5420 processors have different stepping and dont work in the same cluster unless you have the option to turn on EVC.
    So extracting the stepping value in a report would be nice.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.