Collects per-VM resource stats from virsh over SSH and prints them as a
table, highlighting the top CPU/IO/network consumer in red. Mainly for
OpenStack compute node admins who want a quick answer to "which guest on
this box is hammering the disk right now" without hand-parsing
virsh domstats output.
Formerly published as
domlist— renamed after finding out AIX already ships a system command with that exact name. Same tool, same behavior, just a name that isn't already taken.
- Debian package: https://github.com/wabuntu/virshstat/tree/main/target/debian
- RPM package: https://github.com/wabuntu/virshstat/tree/main/target/release/rpmbuild/RPMS/x86_64
- Single binary: https://github.com/wabuntu/virshstat/tree/main/binaries
- Cargo:
cargo install virshstat
Please have your ssh-agent ready before you run.
$ eval `ssh-agent`
$ ssh-add ~/.ssh/id_rsa
user@desktop:~$ virshstat computenode01.example.com
+--------------------+-----------------+---------+--------+--------+--------+---------+
| Domain | Instance | CPU(G) | MEM(G) | I/O(G) | NET(G) | Disk(G) |
+--------------------+-----------------+---------+--------+--------+--------+---------+
| vmcloud01-aaaaaaaa | aaaaaaaaaaaaaaa | 282606 | 33/33 | 7234 | 26510 | 158/171 |
| vmcloud01-bbbbbbbb | bbbbbbbbbbbbbbb | 128276 | 16/16 | 5323 | 4618 | 334/515 |
| vmcloud01-cccccccc | ccccccccccccccc | 111 | 16/16 | 28 | 0 | 5/171 |
+--------------------+-----------------+---------+--------+--------+--------+---------+
user@computenode01:~$ virshstat
+--------------------+-----------------+---------+--------+--------+--------+---------+
| Domain | Instance | CPU(G) | MEM(G) | I/O(G) | NET(G) | Disk(G) |
+--------------------+-----------------+---------+--------+--------+--------+---------+
| vmcloud01-aaaaaaaa | aaaaaaaaaaaaaaa | 282606 | 33/33 | 7234 | 26510 | 158/171 |
| vmcloud01-bbbbbbbb | bbbbbbbbbbbbbbb | 128276 | 16/16 | 5323 | 4618 | 334/515 |
| vmcloud01-cccccccc | ccccccccccccccc | 111 | 16/16 | 28 | 0 | 5/171 |
+--------------------+-----------------+---------+--------+--------+--------+---------+
Each row is a virsh domain (a VM). The Instance column comes from that
domain's nova:name metadata when present, so OpenStack-booted guests show
their Nova instance name alongside the raw libvirt domain name. Whichever
row has the single highest CPU time, I/O, or network total is highlighted
in red in that column, so the thing worth investigating first is visible
at a glance instead of requiring you to scan every row.