Bug 1464734

Summary: [Host QoS] - vdsm failing to accept higher value then 2147mbps
Product: [oVirt] vdsm Reporter: Michael Burman <mburman>
Component: CoreAssignee: Dan Kenigsberg <danken>
Status: CLOSED DUPLICATE QA Contact: Raz Tamir <ratamir>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.19.20CC: bugs, mburman, ylavi
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-07-05 07:40:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Network RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Logs none

Description Michael Burman 2017-06-25 08:03:36 UTC
Created attachment 1291655 [details]
Logs

Description of problem:
[Host Qos] - vdsm failing to accept higher value then 2147mbps

It is seems that when setting higher value then 2147mbps for host QoS, vdsm failing with error. For some reason it calculated as a negative numbers when setting 2148 and above. 

u'rt', 'm2', '-2146967296bit', u'ul', 'm2', '-2146967296bit'


2017-06-25 10:28:00,693+0300 ERROR (jsonrpc/3) [jsonrpc.JsonRpcServer] Internal server error (__init__:577)
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/yajsonrpc/__init__.py", line 572, in _handle_request
    res = method(**params)
  File "/usr/lib/python2.7/site-packages/vdsm/rpc/Bridge.py", line 202, in _dynamicMethod
    result = fn(*methodArgs)
  File "/usr/share/vdsm/API.py", line 1575, in setupNetworks
    supervdsm.getProxy().setupNetworks(networks, bondings, options)
  File "/usr/lib/python2.7/site-packages/vdsm/supervdsm.py", line 53, in __call__
    return callMethod()
  File "/usr/lib/python2.7/site-packages/vdsm/supervdsm.py", line 51, in <lambda>
    **kwargs)
  File "<string>", line 2, in setupNetworks
  File "/usr/lib64/python2.7/multiprocessing/managers.py", line 773, in _callmethod
    raise convert_to_error(kind, result)
TrafficControlException: (1, 'HFSC: Illegal "m2"\nHFSC: Illegal "rt"\n', ['/sbin/tc', 'class', 'add', 'dev', u'enp6s0', 'parent', '1389:', 'classid', '1389:1388', 'hfsc', u'rt', 'm2', '-2146967296bit', u'ul', 'm2'
, '-2146967296bit', u'ls', 'm2', '400bit'])
2017-06-25 10:28:00,737+0300 INFO  (jsonrpc/3) [jsonrpc.JsonRpcServer] RPC call Host.setupNetworks failed (error -32603) in 9.05 seconds (__init__:539)

2017-06-25 10:39:38,661+03 ERROR [org.ovirt.vdsm.jsonrpc.client.JsonRpcClient] (ResponseWorker) [] Not able to update response for "a63e9aa9-5f8b-4b8b-a275-990265072789"
2017-06-25 10:39:38,677+03 ERROR [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (default task-5) [12aa8def-1ed4-4ea1-8362-e583d5c94400] EVENT_ID: VDS_BROKER_COMMAND_FAILURE(10,802), Correlation ID: null, Call Stack: null, Custom Event ID: -1, Message: VDSM pink-vds2.qa.lab.tlv.redhat.com command HostSetupNetworksVDS failed: (1, 'HFSC: Illegal "m2"\nHFSC: Illegal "rt"\n', ['/sbin/tc', 'class', 'add', 'dev', u'enp6s0', 'parent', '1389:', 'classid', '1389:1388', 'hfsc', u'rt', 'm2', '-2146967296bit', u'ul', 'm2', '-2146967296bit', u'ls', 'm2', '400bit'])
2017-06-25 10:39:38,678+03 ERROR [org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand] (default task-5) [12aa8def-1ed4-4ea1-8362-e583d5c94400] Error: VDSGenericException: VDSErrorException: Failed to HostSetupNetworksVDS, error = (1, 'HFSC: Illegal "m2"\nHFSC: Illegal "rt"\n', ['/sbin/tc', 'class', 'add', 'dev', u'enp6s0', 'parent', '1389:', 'classid', '1389:1388', 'hfsc', u'rt', 'm2', '-2146967296bit', u'ul', 'm2', '-2146967296bit', u'ls', 'm2', '400bit']), code = -32603

Version-Release number of selected component (if applicable):
vdsm-4.19.20-1.el7ev.x86_64
4.1.3.5-0.1.el7
and master

How reproducible:
100%

Steps to Reproduce:
1. Run engine-config -s MaxAverageNetworkQoSValue=5000
2. systemctl restart ovirt-engine
3. Create new Host QoS entity with ls=100, rate limit=2148, committed rate=2148
and add to a network
4. Try to attach the network to the host

5. Attach different network and try to set override host QoS with the same values as step 3^^

6. Override the network with ls=100, rate limit=2147, committed rate=2147

Actual results:
step 4 - failed with error - u'rt', 'm2', '-2146967296bit', u'ul', 'm2', '-2146967296bit'
step 5 - failed with error - u'rt', 'm2', '-2146967296bit', u'ul', 'm2', '-2146967296bit'

rt(rate limit) and ul(upper limit) are negative numbers. 

step - succeed

Expected results:
Should work

Comment 1 Dan Kenigsberg 2017-06-26 06:07:09 UTC
isn't this bug 1316568 ?

Comment 2 Michael Burman 2017-06-26 06:21:12 UTC
(In reply to Dan Kenigsberg from comment #1)
> isn't this bug 1316568 ?

Hmm, maybe it is..you tell me.
I was almost sure that we already had such bug, but i couldn't find it, looks like you found it. If you believe it's the same bug, then feel free to close this one.

Comment 3 Yaniv Kaul 2017-06-26 07:42:27 UTC
(In reply to Michael Burman from comment #2)
> (In reply to Dan Kenigsberg from comment #1)
> > isn't this bug 1316568 ?
> 
> Hmm, maybe it is..you tell me.

Well, a simple Google on the mysterious seemingly random number would bring you to:
"32-bit limit is 2147483647. So it wraps around and becomes -2146967296."

> I was almost sure that we already had such bug, but i couldn't find it,
> looks like you found it. If you believe it's the same bug, then feel free to
> close this one.

Comment 4 Yaniv Lavi 2017-07-05 07:40:47 UTC

*** This bug has been marked as a duplicate of bug 1316568 ***