Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1062166 - do not report negative rx/tx rate when Linux counters wrap
Summary: do not report negative rx/tx rate when Linux counters wrap
Alias: None
Product: oVirt
Classification: Retired
Component: vdsm
Version: 3.4
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 3.4.0
Assignee: Dan Kenigsberg
QA Contact: Martin Pavlik
Whiteboard: network
Depends On: 1080494
Blocks: 1047459 1064489
TreeView+ depends on / blocked
Reported: 2014-02-06 11:40 UTC by Dan Kenigsberg
Modified: 2014-04-01 04:57 UTC (History)
15 users (show)

Fixed In Version: ovirt-3.4.0 beta3
Doc Type: Bug Fix
Doc Text:
Clone Of: 1047459
: 1064489 (view as bug list)
Last Closed: 2014-03-31 12:26:37 UTC
oVirt Team: ---

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
oVirt gerrit 24152 None None None Never
oVirt gerrit 24322 None None None Never
oVirt gerrit 25960 None MERGED vm iface stats: fix arithmetic Never
oVirt gerrit 26088 None MERGED vm iface stats: fix arithmetic Never

Description Dan Kenigsberg 2014-02-06 11:40:14 UTC
+++ This bug was initially created as a clone of Bug #1047459 +++

When /sys/class/net/vnet0/statistics/tx_bytes reaches its 32 bit maximum value, it wraps back to 0. Vdsm must take this into account when calculating the txRate of vnics. Otherwise, a negative value may pollute the data warehouse.

Comment 1 Martin Pavlik 2014-03-05 12:14:56 UTC

I followed your advice and changed vdsm as follows

--- a/vdsm/
+++ b/vdsm/
@@ -557,7 +557,7 @@ class VmStatsThread(sampling.AdvancedStatsThread):
     def _sampleNet(self):
         netSamples = {}
         for nic in self._vm._devices[NIC_DEVICES]:
-            netSamples[] = self._vm._dom.interfaceStats(
+            netSamples[] = random.randint(-100,100)
         return netSamples
     def _diff(self, prev, curr, val):

but that results in 

GuestMonitor-VM1::DEBUG::2014-03-05 13:12:26,105::vm::625::vm.Vm::(_getNetworkStats) vmId=`e2e2b3ed-7864-46d4-8466-15c5eb2eaaf6`::Network stats not available

can you please advise how to proceed with testing?

Comment 2 Dan Kenigsberg 2014-03-05 13:58:36 UTC
Have you added `import random` at the top of ?

Comment 3 Martin Pavlik 2014-03-05 14:18:19 UTC
(In reply to Dan Kenigsberg from comment #2)
> Have you added `import random` at the top of ?


Comment 4 Dan Kenigsberg 2014-03-19 15:20:16 UTC
Oh sorry for my laziness: self._vm._dom.interfaceStats should be replaced with 8 integers, not just one

8 * [random.randint(-100,100)] would do the trick.

Comment 5 Martin Pavlik 2014-03-25 14:42:39 UTC
verification is blocked by bug 1080494 which prevents vdsm from providing correct data

Comment 6 Sandro Bonazzola 2014-03-31 12:26:37 UTC
this is an automated message: moving to Closed CURRENT RELEASE since oVirt 3.4.0 has been released

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