0

是否有任何 cli 命令可以了解 VM 中的 VM 配置详细信息,例如现有 CPU 的数量、网卡的数量等。

4

4 回答 4

2

vSphere PowerCLI 可以通过 powershell 为您执行此操作。从这里

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"
于 2011-04-26T15:06:45.353 回答
2

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

于 2011-04-19T14:12:36.730 回答
0

无需使用'foreach-object' powershell 就可以管理它。

获取虚拟机 | Select-Object - 属性名称、NumCpu、MemoryMB、主机、IP 地址 | 导出-Csv "C:\VM.csv"

于 2013-11-12T06:57:39.017 回答
0

lscpu在 Linux 上也很有用。比可读性强cat /proc/cpuinfo

于 2014-03-12T15:00:15.923 回答