Skip to content

Repository files navigation

virshstat

Crates.io CI

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.

Install

Run

Please have your ssh-agent ready before you run.

$ eval `ssh-agent`
$ ssh-add ~/.ssh/id_rsa

Run against remote compute node

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 |
+--------------------+-----------------+---------+--------+--------+--------+---------+

Run in local

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.

About

No description or website provided.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages