How to check the number of CPUs and cores available in the host machine using virsh
?
Asked
Active
Viewed 6,775 times
3

Fábio Perez
- 161
- 1
- 7
2 Answers
3
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
Alternatively, you can run the lscpu
command.

Fábio Perez
- 161
- 1
- 7
-
Is there a simple command similar to `virsh nodeinfo` which shows the exact same layout, but currently allocated CPU and memory count? – a coder Jan 26 '23 at 14:43
0
to see the full set of what the host can offer, run virsh capabilities
. The <cpus num...>
field will hold the number, followed by the listing of cores/sockets/threads etc.

dyasny
- 18,802
- 6
- 49
- 64