How to check the number of CPUs and cores from host with virsh

virshvirtualhostvirtualization

How to check the number of CPUs and cores available in the host machine using virsh?

Best Answer

Use virsh nodeinfo. The output will be something like:

CPU model                    x86_64
CPU (s)                      8
CPU frequency                2895 Mhz
CPU socket(s)                2      
Core(s) per socket           2
Threads per core:            2
Numa cell(s)                 1
Memory size:                 1046528 kb

Source: https://www.centos.org/docs/5/html/5.2/Virtualization/chap-Virtualization-Managing_guests_with_virsh.html

Alternatively, you can run the lscpu command.