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
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: oVirt
Classification: Retired
Component: vdsm
Version: 3.4
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 3.4.0
Assignee: Dan Kenigsberg
QA Contact: Martin Pavlik
URL:
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
Clone Of: 1047459
: 1064489 (view as bug list)
Environment:
Last Closed: 2014-03-31 12:26:37 UTC
oVirt Team: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 24152 0 None None None Never
oVirt gerrit 24322 0 None None None Never
oVirt gerrit 25960 0 None MERGED vm iface stats: fix arithmetic Never
oVirt gerrit 26088 0 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
Dan,

I followed your advice and changed vdsm as follows

--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -557,7 +557,7 @@ class VmStatsThread(sampling.AdvancedStatsThread):
     def _sampleNet(self):
         netSamples = {}
         for nic in self._vm._devices[NIC_DEVICES]:
-            netSamples[nic.name] = self._vm._dom.interfaceStats(nic.name)
+            netSamples[nic.name] = 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 vm.py ?

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 vm.py ?

yes

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 http://libvirt.org/html/libvirt-libvirt.html#virDomainInterfaceStatsStruct

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.