command to get the number cpu exists on vmware

user715274 picture user715274 · Apr 19, 2011 · Viewed 13.9k times · Source

Is there any cli command to know the configuration details of VM like, number of existing cpus, number of network cards etc., in VM.

Answer

Evan Powell picture Evan Powell · Apr 26, 2011

The vSphere PowerCLI can do this for you from powershell. From here:

Get-VM | `
  ForEach-Object {
    $Report = "" | Select-Object -property Name,NumCpu,MemoryMB,Host,IPAddress
    $Report.Name = $_.Name
    $Report.NumCpu = $_.NumCpu
    $Report.MemoryMB = $_.MemoryMB
    $Report.Host = $_.Host
    $Report.IPAddress = $_.Guest.IPAddress
  Write-Output $Report
  } | Export-Csv "C:\VM.csv"