Bug 1364521

Summary: one-line iops_limit fix / upstream patch backport
Product: Red Hat OpenStack Reporter: Irina Petrova <ipetrova>
Component: python-os-brickAssignee: Jon Schlueter <jschluet>
Status: CLOSED ERRATA QA Contact: Shai Revivo <srevivo>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.0 (Liberty)CC: apevec, dcadzow, eharney, jjoyce, jschluet, lhh, mlopes, nlevinki, sclewis, tbarron, tshefi
Target Milestone: gaKeywords: FeatureBackport, TestOnly, ZStream
Target Release: 9.0 (Mitaka)Flags: tshefi: automate_bug-
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-os-brick-1.1.0-1.el7ost Doc Type: Bug Fix
Doc Text:
Previously, the parameter 'iops_limit' in the ScaleIO connector was incorrectly set, and should have been 'iopsLimit'. Consequently, the IOPS of the volume would stay unlimited, even if the user sets a limit on the IOPS. With this update, the correct parameter name is now set, and the 'iopsLimit' will be followed.
Story Points: ---
Clone Of:
: 1366592 (view as bug list) Environment:
Last Closed: 2016-08-24 12:55:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1366592    

Description Irina Petrova 2016-08-05 15:08:42 UTC
Description of problem:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
             >>>  https://review.openstack.org/#/c/255065/  <<<  still NOT implemented in python-os-brick-0.5.0-1.4.el7ost.noarch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Fix iopsLimit parameter in ScaleIO connector The parameter 'iops_limit' in the ScaleIO connector is wrong. The correct parameter should be 'iopsLimit'. Because of this error, the iops of the volume will stay unlimited even if the user sets a limit on the iops. This patch fixes this error.

>> os_brick/initiator/connector.py
>> os_brick/tests/initiator/test_connector.py

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

--- connector_new-4dc8b36bce12369120df32e2431d8a6b71819fbb.py	2015-12-09 04:42:40.000000000 +0100
+++ connector_old-95f9f80c020c299522a04d6aa142267a724b34b4.py	2015-12-02 10:23:16.000000000 +0100
@@ -2024,7 +2024,7 @@
             if self.bandwidth_limit is not None:
                 params['bandwidthLimitInKbps'] = self.bandwidth_limit
             if self.iops_limit is not None:
-                params['iopsLimit'] = self.iops_limit
+                params['iops_limit'] = self.iops_limit
 
             request = (
                 "https://%(server_ip)s:%(server_port)s/api/instances/"

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

--- test_connector_new-1fad1ee951bc87d40c2dc1111f541aad6c078de3.py	2015-12-09 04:42:40.000000000 +0100
+++ test_connector_old-aa9ea37ae1df29712f9d1a8bd421a60b7a1e8e8d.py	2015-12-02 10:23:16.000000000 +0100
@@ -1970,18 +1970,6 @@
         """Fake REST server"""
         api_call = url.split(':', 2)[2].split('/', 1)[1].replace('api/', '')
 
-        if 'setMappedSdcLimits' in api_call:
-            self.assertNotIn("iops_limit", kwargs['data'])
-            if "iopsLimit" not in kwargs['data']:
-                self.assertIn("bandwidthLimitInKbps",
-                              kwargs['data'])
-            elif "bandwidthLimitInKbps" not in kwargs['data']:
-                self.assertIn("iopsLimit", kwargs['data'])
-            else:
-                self.assertIn("bandwidthLimitInKbps",
-                              kwargs['data'])
-                self.assertIn("iopsLimit", kwargs['data'])
-
         try:
             return self.mock_calls[api_call]
         except KeyError:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

// diff upstream_patch OSP_latest_build (python-os-brick-0.5.0-1.4.el7ost.noarch):

diff -u connector_new-4dc8b36bce12369120df32e2431d8a6b71819fbb.py connector.py |grep iops
             if self.iops_limit is not None:
-                params['iopsLimit'] = self.iops_limit
+                params['iops_limit'] = self.iops_limit

// the same goes for test_connector.py

Comment 2 Jon Schlueter 2016-08-05 15:34:47 UTC
This patch should be present in OSP 9, and patch is already landed on liberty/stable

Comment 3 Irina Petrova 2016-08-08 07:37:55 UTC
(In reply to Jon Schlueter from comment #2)
> This patch should be present in OSP 9, and patch is already landed on
> liberty/stable

Thanks for the info, Jon!

My customer is asking if it will be backported to OSP 8. Any idea what are the chances of that happening?

Best,
Irina

Comment 5 Jon Schlueter 2016-08-12 12:24:56 UTC
(In reply to Irina Petrova from comment #3)
> (In reply to Jon Schlueter from comment #2)
> > This patch should be present in OSP 9, and patch is already landed on
> > liberty/stable
> 
> Thanks for the info, Jon!
> 
> My customer is asking if it will be backported to OSP 8. Any idea what are
> the chances of that happening?
> 
> Best,
> Irina

https://bugzilla.redhat.com/show_bug.cgi?id=1366592 is bug targeted for OSP 8 and yes it will be backported.

Comment 10 errata-xmlrpc 2016-08-24 12:55:34 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHEA-2016-1761.html