Browse Source

Merge "PowerMax Driver - QoS calculation failure"

changes/60/694460/2
Zuul 3 weeks ago
parent
commit
53ab7749a3
2 changed files with 26 additions and 1 deletions
  1. +24
    -0
      cinder/tests/unit/volume/drivers/dell_emc/powermax/test_powermax_utils.py
  2. +2
    -1
      cinder/volume/drivers/dell_emc/powermax/utils.py

+ 24
- 0
cinder/tests/unit/volume/drivers/dell_emc/powermax/test_powermax_utils.py View File

@@ -531,6 +531,30 @@ class PowerMaxUtilsTest(test.TestCase):
sg_value, qos_extra_spec, input_prop_dict)
self.assertEqual(input_prop_dict, ret_prop_dict)

def test_validate_qos_cast_to_int(self):
qos_extra_spec = {'total_iops_sec': '500',
'total_bytes_sec': '104857600',
'DistributionType': 'Always'}
property_dict = {'host_io_limit_io_sec': 500}
input_prop_dict = {'host_io_limit_io_sec': 500,
'host_io_limit_mb_sec': 100}
input_key = 'total_bytes_sec'
ret_prop_dict = self.utils.validate_qos_input(
input_key, None, qos_extra_spec, property_dict)
self.assertEqual(input_prop_dict, ret_prop_dict)

def test_validate_qos_cast_to_int_drop_fraction(self):
qos_extra_spec = {'total_iops_sec': '500',
'total_bytes_sec': '105000000',
'DistributionType': 'Always'}
property_dict = {'host_io_limit_io_sec': 500}
input_prop_dict = {'host_io_limit_io_sec': 500,
'host_io_limit_mb_sec': 100}
input_key = 'total_bytes_sec'
ret_prop_dict = self.utils.validate_qos_input(
input_key, None, qos_extra_spec, property_dict)
self.assertEqual(input_prop_dict, ret_prop_dict)

def test_compare_cylinders(self):
source_cylinders = '12345'
target_cylinders = '12345'

+ 2
- 1
cinder/volume/drivers/dell_emc/powermax/utils.py View File

@@ -918,7 +918,8 @@ class PowerMaxUtils(object):
else:
qos_unit = "MB/sec"
min_value = 1
input_value = int(qos_extra_spec['total_bytes_sec']) / units.Mi
input_value = int(
int(qos_extra_spec['total_bytes_sec']) / units.Mi)
sg_key = 'host_io_limit_mb_sec'
if min_value <= input_value <= max_value:
if sg_value is None or input_value != int(sg_value):

Loading…
Cancel
Save