command to get the number cpu exists on vmware
Is there any cli command to know the configura开发者_运维技巧tion details of VM like, number of existing cpus, number of network cards etc., in VM.
Linux
cat /proc/cpuinfo
for processor info.
cat /proc/meminfo
for memory info
df -H
for partition info in human readable size format
lspci
for pci device info (such as network card)
ifconfig
or ip addr sh
for enabled network interfaces (virtual and physical)
Windows
msinfo32 /report c:\sysinfo.txt
and type c:\sysinfo.txt
should get you all you could want
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"
No need to use 'foreach-object' powershell can manage it.
Get-VM | Select-Object -property Name,NumCpu,MemoryMB,Host,IPAddress | Export-Csv "C:\VM.csv"
lscpu
is also useful on Linux. More readable than cat /proc/cpuinfo
精彩评论