Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 252940

Re: Cluster name,Total ESX in cluster,each ESX name, cpu socket & cores for each ESX

$
0
0

Provided your CSV file looks something like this

"vmName"
"VM1"
"VM2"

you can do something like this

 

$csvName="C:\vmnames.csv"
Get-VM
-Name (Import-Csv-Path$csvName-UseCulture|Select-ExpandPropertyvmname) |%$cluster=Get-Cluster-VMHost$_.Host
  $esx=Get-VMHost-Location$cluster
 
$numcpu=$esx|%{$_.ExtensionData.Hardware.CpuInfo.NumCpuPackages} |Measure-Object-Sum|
   
Select-ExpandPropertySum
 
$numcores=$esx|%{$_.ExtensionData.Hardware.CpuInfo.NumCpuCores} |Measure-Object-Sum|
   
Select-ExpandPropertySum
 
$_|  SelectName,
   
@{N="Host";E={$_.Host.Name}},
   
@{N="Cluster";E={$cluster.Name}},
    @{N="Total Hosts/Cluster";E={$esx.Count}},
   
@{N="Total CPU/Cluster";E={$numcpu}},
   
@{N="Total Cores/Cluster";E={$numcores}} }

Viewing all articles
Browse latest Browse all 252940

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>