Bug 1142851

Summary: Argument name mismatch when setting CPU limit
Product: [Retired] oVirt Reporter: Juan Hernández <juan.hernandez>
Component: ovirt-engine-coreAssignee: Martin Sivák <msivak>
Status: CLOSED CURRENTRELEASE QA Contact: Pavel Stehlik <pstehlik>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.5CC: bazulay, bugs, ecohen, gklein, iheim, msivak, oourfali, pkliczew, rbalakri, sbonazzo, yeylon
Target Milestone: ---   
Target Release: 3.5.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: sla
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-01-21 16:13:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: SLA RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Juan Hernández 2014-09-17 14:01:04 UTC
Description of problem:

When a CPU limit is set for a VM using the QoS feature the limit is ignored and the VM is started as usual.

Version-Release number of selected component (if applicable):

ovirt-engine-3.5.0-0.0.master.20140911091402.gite1c5ffd.fc20.noarch
vdsm-4.16.4-0.fc20.x86_64

How reproducible:

Always.

Steps to Reproduce:
1. Set up a QoS limit of 50% (the values isn't relevant) for the CPU of a VM.
2. Start the VM.
3. Run the following command in the VM: dd if=/dev/zero of=/dev/null. This should consume 100% of one CPU in the VM.

Actual results:

The 100% of the CPU of the hypervisor is used.

Expected results:

Oonly 50% of the CPU of the hypervisor is used.

Additional info:

The VDSM log shows the following error message:

Thread-142::DEBUG::2014-09-17 15:25:42,175::__init__::467::jsonrpc.JsonRpcServer::(_serveRequest) Calling 'VM.updateVmPolicy' in bridge with {u'params': {u'vmId': u'3b09ff2c-e94f-4fbd-985f-dd6e176008c2', u'vcpuLimit': u'50'}}
Thread-142::ERROR::2014-09-17 15:25:42,176::__init__::491::jsonrpc.JsonRpcServer::(_serveRequest) Internal server error
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/yajsonrpc/__init__.py", line 486, in _serveRequest
    res = method(**params)
  File "/usr/share/vdsm/rpc/Bridge.py", line 256, in _dynamicMethod
    api = self._getApiInstance(className, argobj)
  File "/usr/share/vdsm/rpc/Bridge.py", line 185, in _getApiInstance
    return apiObj(*ctorArgs)
TypeError: __init__() takes exactly 2 arguments (1 given)

Note that the engine is ending a parameter named "vmId" to identify the VM, but according to the code in API.py VDSM it expects "vmID" (note the uppercase D).

The "vmId" parameter is populated in the engine, in class UpdateVmPolicyVDSCommand.

Comment 1 Juan Hernández 2014-09-17 14:05:04 UTC
Note that the line number in the above error message isn't accurate, as in introduced some traces to try to find the issue. The original error happened in line 179 of Bridge.py.

Comment 2 Barak 2014-09-21 12:18:37 UTC
I assume this is a jsonrpc issue,
Piotr reassigning to you , if this is not the case please move back to sla.

Comment 3 Piotr Kliczewski 2014-09-22 07:24:52 UTC
It is marshaling issue but the params are set outside of jsonrpc code. It was developed after the initial jsonrpc implementation. I will fix.

Comment 4 Piotr Kliczewski 2014-09-22 13:17:34 UTC
Marshaling issue fixed and assigning to Martin since there are more issues with
this verb.

Comment 5 Oved Ourfali 2014-09-23 12:33:54 UTC
Martin - please test that with the applied fix, and come back with insights/logs.
Feel free to consult Piotr.
Move it back to infra if needed.

Comment 6 Piotr Kliczewski 2014-09-23 12:42:53 UTC
Here is print out of the response that we get from the method (line 286):

Thread-222::DEBUG::2014-09-23 14:39:54,112::__init__::467::jsonrpc.JsonRpcServer::(_serveRequest) Calling 'VM.updateVmPolicy' in bridge with {u'params': {u'vmId': u'f6d509f6-d141-42d9-82fc-19127f008aeb', u'vcpuLimit': u'50'}, u'vmID': u'f6d509f6-d141-42d9-82fc-19127f008aeb'}
Thread-222::DEBUG::2014-09-23 14:39:54,114::libvirtconnection::143::root::(wrapper) Unknown libvirterror: ecode: 80 edom: 20 level: 2 message: metadata not found: Requested metadata element is not present
Thread-222::DEBUG::2014-09-23 14:39:54,115::Bridge::286::root::(_dynamicMethod) None
Thread-222::ERROR::2014-09-23 14:39:54,115::__init__::491::jsonrpc.JsonRpcServer::(_serveRequest) Internal server error
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/yajsonrpc/__init__.py", line 486, in _serveRequest
    res = method(**params)
  File "/usr/share/vdsm/rpc/Bridge.py", line 287, in _dynamicMethod
    return self._fixupRet(className, methodName, ret)
  File "/usr/share/vdsm/rpc/Bridge.py", line 236, in _fixupRet
    self._typeFixup('return', retType, result)
  File "/usr/share/vdsm/rpc/Bridge.py", line 216, in _typeFixup
    if k in item:
TypeError: argument of type 'NoneType' is not iterable

Comment 7 Martin Sivák 2015-01-14 13:19:47 UTC
The parameter name was fixed and all should be properly bubbling through vdsm now.

Comment 8 Sandro Bonazzola 2015-01-21 16:13:47 UTC
oVirt 3.5.1 has been released and since this bug is targeted 3.5.1 and in modified state, it should be included in this release.
Please re-target and move nack to modified if this assumption is not valid for this bug.