9 Replies Latest reply on Jan 16, 2018 2:03 PM by chaos007m

    List the CPU model for the first Cluster host of multiple ESXi Clusters on Multiple vCenters (Identify Intel bug Affected Clusters)

    faherne_CTI Novice

      Hi,

       

      With the recent Intel CPU exploits announcement, we are looking to identify the affected clusters. I want to generate a CSV file with the following columns:

       

      vCenterName, DataCenterName, ClusterName, No. of ESXi Cluster Hosts, ESXi Host Hardware Model, ESXi version, ESXi Build No., CPU model

       

      e.g.:

      vCenter1, EMEA, Cluster1, 10, HP DL380 Gen8, ESXi 5.0.0, Build 1234567, Intel Xeon intel X5650 v3

      vCenter1, EMEA, Cluster2, 12, HP DL380 Gen9, ESXi 5.5.0, Build 2345678, Intel Xeon intel X5650 v3

      vCenter2, EMEA, Cluster3, 10, HP DL380 Gen8, ESXi 5.0.0, Build 1234567, Intel Xeon intel X5650 v3

      vCenter2, EMEA, Cluster4, 12, HP DL380 Gen9, ESXi 5.5.0, Build 2345678, Intel Xeon intel X5650 v3

       

       

      Assumptions:

      - We have multiple vCenters each with multiple ESXi clusters

      - Most Clusters have multiple hosts, but some clusters have no hosts (Being built or decommissioned)

      - Each cluster has identical servers with identical CPU models (so I don't need to list all cluster hosts ESXi Host Hardware Model, ESXi version, ESXi Build No., just the first server node)

      - I don't know how to grab the first host of each cluster to pull the ESXi Host Hardware Model, ESXi version, ESXi Build No., CPU Model

      - I don't know how to ignore clusters with no hosts

       

      The script I have so far is:

       

      Connect-viserver -Server (Get-Content C:\Scripts\vCenterList.txt) > $null

      $report = Foreach($vc in $global:DefaultVIServers){

          foreach($dc in Get-Datacenter -Server $vc){

              Get-Cluster -Location $dc -Server $vc |

              Select @{N='VC';E={$vc.Name}},

                  @{N='Datacenter';E={$dc.Name}},

                  @{N='Cluster';E={$_.Name}},

                  @{N='#ESXi';E={$_.ExtensionData.Host.Count}},

          }

      }

      $report | Export-Csv C:\Scripts\vCenterClusterInfo.csv