Real time network usages and IO usages of VM

Hi All, Is there any api methods to get the real time network usages and IO usages os of each vm ? I tried it by using api/vms/$id/statistics but its not getting the network and IO usages. Is it possible to get these details using the api calls ? -- Regards Shanil

On 08/29/2014 07:08 AM, Shanil S wrote:
Hi All,
Is there any api methods to get the real time network usages and IO usages os of each vm ? I tried it by using api/vms/$id/statistics but its not getting the network and IO usages. Is it possible to get these details using the api calls ? -- Regards Shanil
Did you try with vms/{vm:id}/nics/{nic:id}/statistics? Note that currently we have the following statistics available there: data.current.rx Receive data rate data.current.tx Transmit data rate errors.total.rx Total transmit errors errors.total.tx Total transmit errors I guess that this isn't what you are looking for, but we don't have anything else at the moment. For disk IO you should take a look at vms/{vm:id}/disks/{disk:id}/statistics. The collection of statistics available there is the following: data.current.read Read data rate data.current.write Write data rate disk.read.latency Read latency disk.write.latency Write latency disk.flush.latency Flush latency Does this cover your needs? If it doesn't I'd suggest that you open a RFE to request adding additional statistics. Meanwhile you will have to use other mechanisms to find the statistics that you need. -- Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta 3ºD, 28016 Madrid, Spain Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat S.L.

This is a multi-part message in MIME format. --------------030905030805070904060801 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Dn(a 29.08.2014 07:08, Shanil S wrote / napísal(a):
Hi All,
Is there any api methods to get the real time network usages and IO usages os of each vm ? I tried it by using api/vms/$id/statistics but its not getting the network and IO usages. Is it possible to get these details using the api calls ?
I had to make my own based on the hosts cgroups info. I feed the data to mrtg to plot cpu and IO graphs. No network though. I run something like this on each hypervisor periodically via mrtg: vms=`find /cgroup/blkio/libvirt/qemu/ -maxdepth 1 -mindepth 1 -type d -printf "%f\n"` IGNORED_REGEX="ignore" for vm in $vms do ( echo -n "$HOST:$vm:" egrep -v "$IGNORED_REGEX" /cgroup/blkio/libvirt/qemu/$vm/blkio.throttle.io_serviced | grep ^253:.*Read | cut -f3 -d " " | paste -sd+ | bc echo -n ":" egrep -v "$IGNORED_REGEX" /cgroup/blkio/libvirt/qemu/$vm/blkio.throttle.io_serviced | grep ^253:.*Write | cut -f3 -d " " | paste -sd+ | bc echo -n ":" egrep -v "$IGNORED_REGEX" /cgroup/blkio/libvirt/qemu/$vm/blkio.throttle.io_service_bytes | grep ^253:.*Read | cut -f3 -d " " | paste -sd+ | bc echo -n ":" egrep -v "$IGNORED_REGEX" /cgroup/blkio/libvirt/qemu/$vm/blkio.throttle.io_service_bytes | grep ^253:.*Write | cut -f3 -d " " | paste -sd+ | bc echo -n ":" cat /cgroup/cpuacct/libvirt/qemu/$vm/cpuacct.usage ) | tr -d '\n' echo "" done -- Ernest Beinrohr, AXON PRO Ing <http://www.beinrohr.sk/ing.php>, RHCE <http://www.beinrohr.sk/rhce.php>, RHCVA <http://www.beinrohr.sk/rhce.php>, LPIC <http://www.beinrohr.sk/lpic.php>, VCA <http://www.beinrohr.sk/vca.php>, +421-2-62410360 +421-903-482603 --------------030905030805070904060801 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 8bit <html> <head> <meta content="text/html; charset=windows-1252" http-equiv="Content-Type"> </head> <body bgcolor="#FFFFFF" text="#000000"> <div class="moz-cite-prefix">Dňa 29.08.2014 07:08, Shanil S wrote / napísal(a):<br> </div> <blockquote cite="mid:CAHqyWQN639wzdWqBYc+uH10cDLZb_QnDOSk-9f7T07XcUyMFpQ@mail.gmail.com" type="cite"> <div dir="ltr">Hi All,<br> <br> Is there any api methods to get the real time network usages and IO usages os of each vm ? I tried it by using api/vms/$id/statistics but its not getting the network and IO usages. Is it possible to get these details using the api calls ?<br> </div> </blockquote> <br> I had to make my own based on the hosts cgroups info. I feed the data to mrtg to plot cpu and IO graphs. No network though.<br> <br> I run something like this on each hypervisor periodically via mrtg:<br> <br> <tt><tt>vms=`find /cgroup/blkio/libvirt/qemu/ -maxdepth 1 -mindepth 1 -type d -printf "%f\n"`<br> IGNORED_REGEX="ignore"<br> </tt>for vm in $vms</tt><tt><br> </tt><tt>do</tt><tt><br> </tt><tt> (</tt><tt><br> </tt><tt> echo -n "$HOST:$vm:"</tt><tt><br> </tt><tt> egrep -v "$IGNORED_REGEX" /cgroup/blkio/libvirt/qemu/$vm/blkio.throttle.io_serviced | grep ^253:.*Read | cut -f3 -d " " | paste -sd+ | bc</tt><tt><br> </tt><tt> echo -n ":"</tt><tt><br> </tt><tt> egrep -v "$IGNORED_REGEX" /cgroup/blkio/libvirt/qemu/$vm/blkio.throttle.io_serviced | grep ^253:.*Write | cut -f3 -d " " | paste -sd+ | bc</tt><tt><br> </tt><tt> echo -n ":"</tt><tt><br> </tt><tt> egrep -v "$IGNORED_REGEX" /cgroup/blkio/libvirt/qemu/$vm/blkio.throttle.io_service_bytes | grep ^253:.*Read | cut -f3 -d " " | paste -sd+ | bc</tt><tt><br> </tt><tt> echo -n ":"</tt><tt><br> </tt><tt> egrep -v "$IGNORED_REGEX" /cgroup/blkio/libvirt/qemu/$vm/blkio.throttle.io_service_bytes | grep ^253:.*Write | cut -f3 -d " " | paste -sd+ | bc</tt><tt><br> </tt><tt> echo -n ":"</tt><tt><br> </tt><tt> cat /cgroup/cpuacct/libvirt/qemu/$vm/cpuacct.usage</tt><tt><br> </tt><tt> ) | tr -d '\n'</tt><tt><br> </tt><tt> echo ""</tt><tt><br> </tt><tt>done</tt><br> <br> <div class="moz-signature">-- <br> <div id="oernii_footer" style="color: gray;"> <span style="font-family: Lucida Console, Luxi Mono, Courier, monospace; font-size: 90%;"> Ernest Beinrohr, AXON PRO<br> <a style="text-decoration: none; color: gray;" href="http://www.beinrohr.sk/ing.php">Ing</a>, <a style="text-decoration: none; color: gray;" href="http://www.beinrohr.sk/rhce.php">RHCE</a>, <a style="text-decoration: none; color: gray;" href="http://www.beinrohr.sk/rhce.php">RHCVA</a>, <a style="text-decoration: none; color: gray;" href="http://www.beinrohr.sk/lpic.php">LPIC</a>, <a style="text-decoration: none; color: gray;" href="http://www.beinrohr.sk/vca.php">VCA</a>, <br> +421-2-62410360 +421-903-482603 <br> </span> </div> <img src="http://nojsstats.appspot.com/UA-44497096-1/email.beinrohr.sk" moz-do-not-send="true" border="0" width="1" height="1"> </div> </body> </html> --------------030905030805070904060801--

----- Original Message -----
From: "Ernest Beinrohr" <Ernest.Beinrohr@axonpro.sk> To: "Shanil S" <xielesshanil@gmail.com>, users@ovirt.org Sent: Tuesday, September 2, 2014 11:24:13 AM Subject: Re: [ovirt-users] Real time network usages and IO usages of VM
Dňa 29.08.2014 07:08, Shanil S wrote / napísal(a):
Hi All,
Is there any api methods to get the real time network usages and IO usages os of each vm ? I tried it by using api/vms/$id/statistics but its not getting the network and IO usages. Is it possible to get these details using the api calls ?
I had to make my own based on the hosts cgroups info. I feed the data to mrtg to plot cpu and IO graphs. No network though.
I run something like this on each hypervisor periodically via mrtg:
vms=`find /cgroup/blkio/libvirt/qemu/ -maxdepth 1 -mindepth 1 -type d -printf "%f\n"` IGNORED_REGEX="ignore" for vm in $vms do ( echo -n "$HOST:$vm:" egrep -v "$IGNORED_REGEX" /cgroup/blkio/libvirt/qemu/$vm/blkio.throttle.io_serviced | grep ^253:.*Read | cut -f3 -d " " | paste -sd+ | bc echo -n ":" egrep -v "$IGNORED_REGEX" /cgroup/blkio/libvirt/qemu/$vm/blkio.throttle.io_serviced | grep ^253:.*Write | cut -f3 -d " " | paste -sd+ | bc echo -n ":" egrep -v "$IGNORED_REGEX" /cgroup/blkio/libvirt/qemu/$vm/blkio.throttle.io_service_bytes | grep ^253:.*Read | cut -f3 -d " " | paste -sd+ | bc echo -n ":" egrep -v "$IGNORED_REGEX" /cgroup/blkio/libvirt/qemu/$vm/blkio.throttle.io_service_bytes | grep ^253:.*Write | cut -f3 -d " " | paste -sd+ | bc echo -n ":" cat /cgroup/cpuacct/libvirt/qemu/$vm/cpuacct.usage ) | tr -d '\n' echo "" done
-- Ernest Beinrohr, AXON PRO Ing , RHCE , RHCVA , LPIC , VCA , +421-2-62410360 +421-903-482603
Hi Ernest Did you check vms/{vm:id}/disks/{disk:id}/statistics and vms/{vm:id}/nics/{nic:id}/statitics ? See more info here: http://www.ovirt.org/REST-Api#Where_can_I_find_network_and_IO_statiscs_for_v...
participants (4)
-
Doron Fediuck
-
Ernest Beinrohr
-
Juan Hernandez
-
Shanil S