VMAX driver - QoS key fix
QoS key value was changed from 'qos_specs' to 'qos_spec' in a feedback comment in _initial_setup. The side effect of this was QoS was never enabled. Please refer to https://review.openstack.org/#/c/307502/ Change-Id: I32a203c1a29e214656f6684268266df589db67bd Closes-Bug: #1656029
This commit is contained in:
parent
d063ed99e5
commit
d4d88f31c6
|
@ -30,6 +30,7 @@ from cinder import exception
|
|||
from cinder.i18n import _
|
||||
from cinder.objects import consistencygroup
|
||||
from cinder.objects import fields
|
||||
from cinder.objects import qos_specs
|
||||
from cinder import test
|
||||
from cinder.tests.unit import utils as unit_utils
|
||||
from cinder import utils as cinder_utils
|
||||
|
@ -486,6 +487,12 @@ class VMAXCommonData(object):
|
|||
display_description='test volume in Consistency group',
|
||||
host=fake_host_v3, provider_location=six.text_type(provider_location))
|
||||
|
||||
test_volume_type_QOS = qos_specs.QualityOfServiceSpecs(
|
||||
id='qosId', name='qosName', consumer=fields.QoSConsumerValues.BACK_END,
|
||||
specs={'maxIOPS': '6000', 'maxMBPS': '6000',
|
||||
'DistributionType': 'Always'}
|
||||
)
|
||||
|
||||
test_failed_volume = {'name': 'failed_vol',
|
||||
'size': 1,
|
||||
'volume_name': 'failed_vol',
|
||||
|
@ -9038,6 +9045,49 @@ class VMAXCommonTest(test.TestCase):
|
|||
'OS-fakehost-SRP_1-Diamond-DSS-I-CD-MV',
|
||||
maskingViewDict['maskingViewName'])
|
||||
|
||||
@mock.patch.object(
|
||||
volume_types,
|
||||
'get_volume_type_extra_specs',
|
||||
return_value={'volume_backend_name': 'ISCSINoFAST'})
|
||||
@mock.patch.object(
|
||||
volume_types,
|
||||
'get_volume_type_qos_specs',
|
||||
return_value={'qos_specs': VMAXCommonData.test_volume_type_QOS})
|
||||
@mock.patch.object(
|
||||
common.VMAXCommon,
|
||||
'_register_config_file_from_config_group',
|
||||
return_value=None)
|
||||
@mock.patch.object(
|
||||
utils.VMAXUtils,
|
||||
'isArrayV3',
|
||||
return_value=True)
|
||||
@mock.patch.object(
|
||||
common.VMAXCommon,
|
||||
'_get_ecom_connection',
|
||||
return_value=FakeEcomConnection())
|
||||
def test_initial_setup_qos(self, mock_conn, mock_isArrayV3,
|
||||
mock_register, mock_volumetype_qos,
|
||||
mock_volumetype_extra):
|
||||
array_map = [
|
||||
{'EcomCACert': None, 'Workload': None, 'EcomServerIp': u'1.1.1.1',
|
||||
'PoolName': u'SRP_1', 'EcomPassword': u'pass',
|
||||
'SerialNumber': u'1234567891011', 'EcomServerPort': u'10',
|
||||
'PortGroup': u'OS-portgroup-PG', 'EcomUserName': u'user',
|
||||
'EcomUseSSL': False, 'EcomNoVerification': False,
|
||||
'FastPolicy': None, 'SLO': 'Bronze'}]
|
||||
with mock.patch.object(
|
||||
self.driver.common.utils, 'parse_file_to_get_array_map',
|
||||
return_value=array_map):
|
||||
with mock.patch.object(
|
||||
self.driver.common.utils, 'extract_record',
|
||||
return_value=array_map[0]):
|
||||
extraSpecs = self.driver.common._initial_setup(
|
||||
VMAXCommonData.test_volume_v3)
|
||||
self.assertIsNotNone(extraSpecs)
|
||||
self.assertEqual(
|
||||
VMAXCommonData.test_volume_type_QOS.get('specs'), extraSpecs[
|
||||
'qos'])
|
||||
|
||||
@mock.patch.object(
|
||||
common.VMAXCommon,
|
||||
'_find_lun',
|
||||
|
|
|
@ -2120,7 +2120,7 @@ class VMAXCommon(object):
|
|||
else:
|
||||
# V2 extra specs
|
||||
extraSpecs = self._set_v2_extra_specs(extraSpecs, poolRecord)
|
||||
if (qosSpecs.get('qos_spec')
|
||||
if (qosSpecs.get('qos_specs')
|
||||
and qosSpecs['qos_specs']['consumer'] != "front-end"):
|
||||
extraSpecs['qos'] = qosSpecs['qos_specs']['specs']
|
||||
except Exception:
|
||||
|
|
|
@ -2646,6 +2646,7 @@ class VMAXUtils(object):
|
|||
:param storagegroup: the storagegroup instance name
|
||||
:param extraSpecs: extra specifications
|
||||
"""
|
||||
modifiedInstance = None
|
||||
if type(storagegroup) is pywbem.cim_obj.CIMInstance:
|
||||
storagegroupInstance = storagegroup
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue