我该如何找出我的XEN系统有多少个CPU(vCPU)?

4
如果我使用top 或查看/proc/cpuinfo,我只能看到两个CPU。但是,如果我使用virt-manager 工具查看系统显示的值,那么工具会显示给我32个虚拟处理器(vcpu) (这个值是我认为正确的)。
我试图从虚拟化管理程序的脚本级别找到正确的值(32),我一直在查看/proc/cpuinfo/sys/devices/system/cpu/和其他我能想到的东西,但是没有找到该值的任何信息。我也仔细查看了像xenxm这样的shell命令,但是没有找到显示我正在寻找的值的方法。
有人知道如何找出我的 XEN 系统提供了多少个 vcpu 吗?
编辑:lscpu 给出的结果是:
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                2
On-line CPU(s) list:   0,1
Thread(s) per core:    2
Core(s) per socket:    1
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 45
Stepping:              7
CPU MHz:               2900.086
BogoMIPS:              5800.17
Hypervisor vendor:     Xen
Virtualization type:   none
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              20480K
NUMA node0 CPU(s):     0,1

因此,这也没有显示“32”的任何地方。

/proc/cpuinfo的内容:

processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 45
model name  : Intel(R) Xeon(R) CPU E5-2690 0 @ 2.90GHz
stepping    : 7
microcode   : 0x70d
cpu MHz     : 2900.086
cache size  : 20480 KB
physical id : 0
siblings    : 2
core id     : 0
cpu cores   : 1
apicid      : 0
initial apicid  : 0
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu de tsc msr pae cx8 apic sep cmov pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nopl nonstop_tsc pni pclmulqdq est ssse3 cx16 sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes hypervisor lahf_lm ida arat pln pts dtherm
bogomips    : 5800.17
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

processor   : 1
vendor_id   : GenuineIntel
cpu family  : 6
model       : 45
model name  : Intel(R) Xeon(R) CPU E5-2690 0 @ 2.90GHz
stepping    : 7
microcode   : 0x70d
cpu MHz     : 2900.086
cache size  : 20480 KB
physical id : 0
siblings    : 2
core id     : 0
cpu cores   : 1
apicid      : 1
initial apicid  : 1
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu de tsc msr pae cx8 apic sep cmov pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nopl nonstop_tsc pni pclmulqdq est ssse3 cx16 sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes hypervisor lahf_lm ida arat pln pts dtherm
bogomips    : 5800.17
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

1
你是在查看主机(“Domain-0”)还是客户机中的 top/proc/cpuinfoxm 绝对有你想要的选项(新的 xl 也有,libvirtvirsh 也有)- xm info 显示总物理 CPU 数量,xm vcpu-list 显示客户机... - twalberg
2个回答

3
我现在找到了一种方法:
IFS=: read _ nr_cpus < <(xm info | grep ^nr_cpus)
echo "$nr_cpus"

这将(最终)打印出来。

32

在我的系统上。

1
这是一种不错的方式:
cat /proc/cpuinfo | grep "core id"

这是一个输出的例子:
core id     : 0
core id     : 1
core id     : 0
core id     : 1

在我的情况下,系统是双核的,我只有核心ID 0和核心ID 1。

是的,正如我在问题中已经写过的那样,我已经查看了/proc/cpuinfo,但没有成功。它向我显示了两行(都是“core id:0”),但我的系统提供了多达32个vcpu以创建虚拟机。我想找出这个数字32可以在哪里看到。 - Alfe
lscpu给你什么信息?你能发布cat /proc/cpuinfo的整个输出吗? - Federovsky
我已经按照你的要求将内容添加到问题中。不幸的是,没有显示出期望的32。 - Alfe
我猜重点在于XEN环境;似乎我只能获取有关我的XEN托管节点的信息,而不能获取有关虚拟机监视器功能的信息。 - Alfe
看到这个:http://support.citrix.com/servlet/KbServlet/download/38332-102-714736/XenServer-6.5.0-Configuration_Limits.pdf - Federovsky

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接