4

If I start top or look into /proc/cpuinfo, I see only two CPUs. If I view the values displayed for my system with virt-manager, that tool shows me 32 vcpus (which is the value I think is correct).

I failed (yet) to find out on a script-level on the hypervisor that correct value (32). I have been looking into /proc/cpuinfo and /sys/devices/system/cpu/ and other things I could think of, but found that value nowhere. Also the shell commands like xen or xm I examined closely, but found no way to display the value I'm looking for.

Does anybody know how I can find out how many vcpus my XEN system provides?

EDIT: lscpu gives me:

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

So, this also does not show the "32" anywhere.

The contents of /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:
Alfe
  • 56,346
  • 20
  • 107
  • 159
  • 1
    Are you looking at `top` and `/proc/cpuinfo` in the host ("Domain-0"), or in the guest? `xm` definitely have options for what you want (the newer `xl` does, too, as does `libvirt`s `virsh`) - `xm info` shows total physical CPU count, `xm vcpu-list` for guests... – twalberg Jul 20 '15 at 15:45

2 Answers2

3

I found a way now:

IFS=: read _ nr_cpus < <(xm info | grep ^nr_cpus)
echo "$nr_cpus"

This will (finally) print

32

on my system.

Alfe
  • 56,346
  • 20
  • 107
  • 159
1

This is a nice way:

cat /proc/cpuinfo | grep "core id"

This is an example of the output:

core id     : 0
core id     : 1
core id     : 0
core id     : 1

In my case, the system is dual-core, I have only core-id 0 and core-id 1.

Federovsky
  • 74
  • 5
  • Yeah, right, and as I already wrote in my question, I already looked at `/proc/cpuinfo` without success. It shows me two lines (both `core id : 0`), but my system offers up to 32 vcpus to created VMs. I'd like to figure out where this number of 32 can be seen. – Alfe Jul 21 '15 at 14:04
  • What does lscpu give you? Can you post the entire output of cat /proc/cpuinfo? – Federovsky Jul 21 '15 at 15:21
  • I added what you asked for to the question. Unfortunately, nothing shows the desired 32. – Alfe Jul 21 '15 at 15:29
  • I guess the point is the XEN environment; it seems I only get information about my XEN-hosted node, not about the hypervisor's capabilities. – Alfe Jul 21 '15 at 15:33
  • Came across this: http://support.citrix.com/servlet/KbServlet/download/38332-102-714736/XenServer-6.5.0-Configuration_Limits.pdf – Federovsky Jul 21 '15 at 16:40