Bug 597690 - Not showing disk and network stats
Summary: Not showing disk and network stats
Keywords:
Status: NEW
Alias: None
Product: Virtualization Tools
Classification: Community
Component: virt-top
Version: unspecified
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
: 487533 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-05-30 04:56 UTC by Neil Aggarwal
Modified: 2011-10-16 19:05 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)
Log with libvirt debugging (23.40 KB, text/plain)
2010-06-01 13:47 UTC, Neil Aggarwal
no flags Details
Patch to compile ocaml-libvirt with -Wno-deprecated-declarations (557 bytes, patch)
2010-10-26 19:17 UTC, Ben Slusky
no flags Details | Diff

Description Neil Aggarwal 2010-05-30 04:56:06 UTC
Description of problem:
I have a CentOS server.  It was originally installed with CentOS 5.4 and I did a yum update when CentOS 5.5 came out.
When I run virt-top, the disk and network stats columns are empty.
According to Richard Jones, the stats should be there if the virsh domain stat commands work correctly.  They seem to be working fine on my system.

When I run this command:
virsh domblkstat v1059 hda

I get this output:
hda rd_req 24855
hda rd_bytes 374052352
hda wr_req 413829
hda wr_bytes 4122740736

When I run this command:
virsh domifstat v1059 v1059

I get this output:
v1059 rx_bytes 142375408
v1059 rx_packets 1780860
v1059 rx_errs 0
v1059 rx_drop 0
v1059 tx_bytes 43514726
v1059 tx_packets 340412
v1059 tx_errs 0
v1059 tx_drop 0

I tried to generate a debug log by running this command:
virt-top --debug virt-top.log

When I do that, virt-top runs normally.
After exiting virt-top, the debug file is empty.  It is created
by the program so it is doing something. 

Version-Release number of selected component:
virt-top 0.4.1.1
libvirt 0.6.3
kvm 83-164.el5

How reproducible:
This always happens on my system.

Steps to Reproduce:
1. Add EPEL repo
2. Install virt-top
3. Run virt-top
  
Actual results:

The virt-top screen looks like this:

virt-top 23:54:05 - x86_64 6/6CPU 2211MHz 7990MB 1.8%
9 domains, 9 active, 9 running, 0 sleeping, 0 paused, 0 inactive D:0 O:0 X:0
CPU: 2.3%  Mem: 9216 MB (9216 MB by guests)

   ID S RDRQ WRRQ RXBY TXBY %CPU %MEM    TIME   NAME
   11 R                      1.4  6.0 117:29.25 v1158
    3 R                      0.7 25.0 297:10.49 nickVPS
    4 R                      0.2  6.0 201:54.18 v1154
    8 R                      0.1 25.0 381:31.97 v1059
    9 R                      0.0 25.0 384:11.68 v1060
    1 R                      0.0  6.0 175:53.02 v1062
    7 R                      0.0  6.0  59:21.77 v1103
    2 R                      0.0  6.0  21:20.85 v1157
   14 R                      0.0  6.0  58:49.60 v1159

Expected results:
The disk and network stats columns should be filled in.

Comment 1 Richard W.M. Jones 2010-06-01 10:23:24 UTC
(In reply to comment #0)
> I tried to generate a debug log by running this command:
> virt-top --debug virt-top.log
> 
> When I do that, virt-top runs normally.
> After exiting virt-top, the debug file is empty.  It is created
> by the program so it is doing something. 

That's good, because it means nothing is writing errors to stderr
which are being lost.

However for this I'd also like to see libvirt debugging, so can
you do:

export LIBVIRT_DEBUG=1
virt-top --debug virt-top.log

and append the log file here.

Comment 2 Neil Aggarwal 2010-06-01 13:47:40 UTC
Created attachment 418641 [details]
Log with libvirt debugging

Comment 3 Wolfram Schlich (LVM) 2010-09-08 17:13:00 UTC
Same here, RDRQ WRRQ RXBY TXBY empty with 1.0.4 (not empty with 0.3.3.1).

Comment 4 Richard W.M. Jones 2010-09-08 17:16:01 UTC
What's the output of virsh *stat commands, and virt-top --debug?  (see
comment 0 and comment 1).

Comment 5 Julio Entrena Perez 2010-10-04 16:43:18 UTC
Same problem here.

[root@r210xen ~]# virsh dumpxml rhel55pv
<domain type='xen' id='3'>
  <name>rhel55pv</name>
  <uuid>2a616433-9be9-6a0b-8bb4-af780570b41f</uuid>
  <memory>524288</memory>
  <currentMemory>524288</currentMemory>
  <vcpu>1</vcpu>
  <bootloader>/usr/bin/pygrub</bootloader>
  <os>
    <type>linux</type>
    <kernel>/var/lib/xen/boot_kernel.E1DT0X</kernel>
    <initrd>/var/lib/xen/boot_ramdisk.kFPrQz</initrd>
    <cmdline>ro root=/dev/VolGroup00/LogVol00</cmdline>
  </os>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <disk type='block' device='disk'>
      <driver name='phy'/>
      <source dev='/dev/VolGroup01/rhel55pv'/>
      <target dev='xvda' bus='xen'/>
    </disk>
    <interface type='bridge'>
      <mac address='00:16:36:65:e2:2f'/>
      <source bridge='xenbr0'/>
      <script path='vif-bridge'/>
      <target dev='vif3.0'/>
    </interface>
    <console type='pty' tty='/dev/pts/1'>
      <source path='/dev/pts/1'/>
      <target port='0'/>
    </console>
    <input type='mouse' bus='xen'/>
    <graphics type='vnc' port='5900' autoport='yes' keymap='en-gb'/>
  </devices>
</domain>

[root@r210xen ~]# virsh domifstat rhel55pv vif3.0
vif3.0 rx_bytes 21124047
vif3.0 rx_packets 45256
vif3.0 rx_errs 0
vif3.0 rx_drop 3703
vif3.0 tx_bytes 482084
vif3.0 tx_packets 1884
vif3.0 tx_errs 0
vif3.0 tx_drop 0

[root@r210xen ~]# virsh domblkstat rhel55pv xvda
xvda rd_req 13822
xvda rd_bytes 229754368
xvda wr_req 7523
xvda wr_bytes 64865280
xvda errs 0

virt-top --debug creates an empty debug file.

I've setup a reproducer, please contact me if you need to access it.

Comment 6 Richard W.M. Jones 2010-10-04 16:46:42 UTC
Julio, do the stats change over time, eg. if you run the domifstat
command, wait a minute, then run it again?

Comment 7 Julio Entrena Perez 2010-10-04 16:51:15 UTC
Yes, they do:

[root@r210xen ~]# virsh domifstat rhel55pv vif3.0
vif3.0 rx_bytes 25297484
vif3.0 rx_packets 49236
vif3.0 rx_errs 0
vif3.0 rx_drop 3703
vif3.0 tx_bytes 557224
vif3.0 tx_packets 3055
vif3.0 tx_errs 0
vif3.0 tx_drop 0

[root@r210xen ~]# virsh domblkstat rhel55pv xvda
xvda rd_req 19453
xvda rd_bytes 259163648
xvda wr_req 42542
xvda wr_bytes 227656704
xvda errs 0

Comment 8 Richard W.M. Jones 2010-10-04 17:16:06 UTC
OK I have a theory about why this is happening now.

If you have EPEL 5, you could try this test ...

# yum install ocaml ocaml-findlib-devel ocaml-libvirt-devel

Copy the following into a file, change the guest and device
if necessary, and make sure the file is chmod +x (executable):

-----------------------
#!/usr/bin/ocamlrun /usr/bin/ocaml
#use "topfind";;
#require "libvirt";;
let guest = "rhel55pv"
let device = "xvda"
open Printf
let conn = Libvirt.Connect.connect_readonly ()
module D = Libvirt.Domain
let dom = D.lookup_by_name conn guest
let { D.rd_req = rd_req; rd_bytes = rd_bytes;
      wr_req = wr_req; wr_bytes = wr_bytes } = D.block_stats dom device
let () =
  printf "rd_req = %Ld  rd_bytes = %Ld\n" rd_req rd_bytes;
  printf "wr_req = %Ld  wr_bytes = %Ld\n" wr_req wr_bytes
-----------------------

sudo /tmp/test.ml

For me, on Fedora, this prints stats, eg:

rd_req = 120013  rd_bytes = 4103219200
wr_req = 37548  wr_bytes = 5163249664

but on RHEL 5 this prints an error:

Exception: Libvirt.Not_supported "virDomainBlockStats".

The good news is that if you can reproduce the same error,
then it's very easy to fix -- just need a simple recompile
against the updated libvirt.

Comment 9 Julio Entrena Perez 2010-10-05 09:10:29 UTC
Richard, I can reproduce the same error:

[root@r210xen ~]# /tmp/test.ml 
Exception: Libvirt.Not_supported "virDomainBlockStats".

Comment 10 Julio Entrena Perez 2010-10-26 13:16:07 UTC
Richard, this BZ seems to be a duplicate of bz#487533.

Comment 11 Richard W.M. Jones 2010-10-26 14:02:00 UTC
*** Bug 487533 has been marked as a duplicate of this bug. ***

Comment 12 Richard W.M. Jones 2010-10-26 14:02:45 UTC
I agree.  BTW someone with some spare time can just go ahead
and fix this by rebuilding ocaml-libvirt and virt-top packages.

Comment 13 Ben Slusky 2010-10-26 19:13:06 UTC
I can confirm that this works, except that ocaml-libvirt-0.4.1.1 uses bits of libvirt that are deprecated in recent releases, and so can't be compiled with -Wall -Werror. Adding -Wno-deprecated-declarations fixes this.

Comment 14 Ben Slusky 2010-10-26 19:17:45 UTC
Created attachment 455851 [details]
Patch to compile ocaml-libvirt with -Wno-deprecated-declarations


Note You need to log in before you can comment on or make changes to this bug.