diff --git a/cinder/tests/unit/volume/drivers/hpe/test_hpe3par.py b/cinder/tests/unit/volume/drivers/hpe/test_hpe3par.py index 018d93694d3..be0195c2ebd 100644 --- a/cinder/tests/unit/volume/drivers/hpe/test_hpe3par.py +++ b/cinder/tests/unit/volume/drivers/hpe/test_hpe3par.py @@ -1107,19 +1107,26 @@ class TestHPE3PARDriverBase(HPE3PARBaseDriver): self.assertEqual(expected_cpg, result['snap_cpg']) + # (i) normal value; eg. 7, 10, etc + # (ii) small value less than 1; eg. 0.1, 0.02, etc + @ddt.data({'latency': 25}, {'latency': 0.2}) + @ddt.unpack @mock.patch.object(volume_types, 'get_volume_type') - def test_create_volume_qos(self, _mock_volume_types): + def test_create_volume_qos(self, _mock_volume_types, latency): # setup_mock_client drive with default configuration # and return the mock HTTP 3PAR client mock_client = self.setup_driver() + QOS = self.QOS.copy() + QOS['qos:latency'] = latency + _mock_volume_types.return_value = { 'name': 'gold', 'extra_specs': { 'cpg': HPE3PAR_CPG_QOS, 'snap_cpg': HPE3PAR_CPG_SNAP, 'vvs_name': self.VVS_NAME, - 'qos': self.QOS, + 'qos': QOS, 'tpvv': True, 'tdvv': False, 'volume_type': self.volume_type}} diff --git a/cinder/volume/drivers/hpe/hpe_3par_common.py b/cinder/volume/drivers/hpe/hpe_3par_common.py index 2d9534a16f6..c503aa1db0f 100644 --- a/cinder/volume/drivers/hpe/hpe_3par_common.py +++ b/cinder/volume/drivers/hpe/hpe_3par_common.py @@ -304,11 +304,12 @@ class HPE3PARCommon(object): 4.0.18 - During conversion of volume to base volume, error out if it has child snapshot(s). Bug #1994521 4.0.19 - Update code to work with new WSAPI (of 2023). Bug #2015746 + 4.0.20 - Use small QoS Latency value. Bug #2018994 """ - VERSION = "4.0.19" + VERSION = "4.0.20" stats = {} @@ -2051,7 +2052,17 @@ class HPE3PARCommon(object): if min_bw is None: qosRule['bwMinGoalKB'] = int(max_bw) * units.Ki if latency: - qosRule['latencyGoal'] = int(latency) + # latency could be values like 2, 5, etc or + # small values like 0.1, 0.02, etc. + # we are converting to float so that 0.1 doesn't become 0 + latency = float(latency) + if latency >= 1: + # by default, latency in millisecs + qosRule['latencyGoal'] = int(latency) + else: + # latency < 1 Eg. 0.1, 0.02, etc + # convert latency to microsecs + qosRule['latencyGoaluSecs'] = int(latency * 1000) if priority: qosRule['priority'] = self.qos_priority_level.get(priority.lower()) diff --git a/releasenotes/notes/hpe-3par-small-qos-latency-values-d5fa70a605b04335.yaml b/releasenotes/notes/hpe-3par-small-qos-latency-values-d5fa70a605b04335.yaml new file mode 100644 index 00000000000..176804b6287 --- /dev/null +++ b/releasenotes/notes/hpe-3par-small-qos-latency-values-d5fa70a605b04335.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + HPE 3PAR driver `bug #2018994 + `_: + Fixed: use small QoS Latency value (less than 1)