virsh command that displays the cpu and memory consumption?

The command dommemstat can give you memory stats for a specific domain and with domstats you can get plenty of stats for all domains or just the specified. You can pass the parameter --cpu-total to see the total in the moment.

First get a virsh interactive console by typing virsh on your command line and then, once inside virsh's console, issue the following command:

virsh # domstats --cpu-total

The previous command will give you the CPU stats for all domains. If you have virt-manager you can see live some graphs and other nice stats, and if you want to collect them for a time you would need some other tool, I would recommend collectd and its 'virt' plugin


Nadya Nux: The command 'domstat --cpu-total' is executed within 'virsh' console, not from bash. So you have basicly two ways to do it.

First:

user@yourserver:~# virsh domstats --cpu-total

Second:

user@yourserver:~# virsh
virsh # domstats --cpu-total

Hope it helps better copy&paste to new readers as well :)