3

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

2 Answers 2

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

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.

1
  • 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, 2023 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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .