VirTips wind between the clouds

Getting disk space usage from running VM.

There is amazing tool which may help in many administrative tasks. It is called libguestfs. To get information about disk space usage you can use program virt-df.
To get disks stats from all running vms just run(libvirt required):

To get disks stats from specific vm:

If you do not have libvirt, you can manually specify disk

Libguestfs is mainly written in C, but it provides bindings for other languages : C++, Erlang, Java, OCaml, Perl, Python, Ruby.
For example to get  disk stats in python you can use this code:

 

Post Navigation

Follow

Get every new post delivered to your Inbox

Join other followers