Merge "PowerMax Driver - Remove deprecated config options"
This commit is contained in:
commit
1f54c5aee9
|
@ -328,16 +328,16 @@ class FakeConfiguration(object):
|
|||
for key, value in kwargs.items():
|
||||
if 'san_' in key:
|
||||
self.set_san_config_options(key, value)
|
||||
elif 'vmax_' in key:
|
||||
self.set_vmax_config_options(key, value)
|
||||
elif 'powermax_' and '_name_template' in key:
|
||||
self.set_host_name_template_config_options(key, value)
|
||||
elif 'powermax_' in key:
|
||||
self.set_powermax_config_options(key, value)
|
||||
elif 'chap_' in key:
|
||||
self.set_chap_config_options(key, value)
|
||||
elif 'driver_ssl_cert' in key:
|
||||
self.set_ssl_cert_config_options(key, value)
|
||||
elif 'u4p_' in key:
|
||||
self.set_u4p_failover_config_options(key, value)
|
||||
elif '_name_template' in key:
|
||||
self.set_host_name_template_config_options(key, value)
|
||||
elif 'load_' in key:
|
||||
self.set_performance_config_options(key, value)
|
||||
|
||||
|
@ -351,17 +351,17 @@ class FakeConfiguration(object):
|
|||
elif key == 'san_api_port':
|
||||
self.san_api_port = value
|
||||
|
||||
def set_vmax_config_options(self, key, value):
|
||||
if key == 'vmax_srp':
|
||||
self.vmax_srp = value
|
||||
elif key == 'vmax_service_level':
|
||||
self.vmax_service_level = value
|
||||
elif key == 'vmax_workload':
|
||||
self.vmax_workload = value
|
||||
elif key == 'vmax_port_groups':
|
||||
self.vmax_port_groups = value
|
||||
elif key == 'vmax_array':
|
||||
self.vmax_array = value
|
||||
def set_powermax_config_options(self, key, value):
|
||||
if key == 'powermax_srp':
|
||||
self.powermax_srp = value
|
||||
elif key == 'powermax_service_level':
|
||||
self.powermax_service_level = value
|
||||
elif key == 'powermax_workload':
|
||||
self.powermax_workload = value
|
||||
elif key == 'powermax_port_groups':
|
||||
self.powermax_port_groups = value
|
||||
elif key == 'powermax_array':
|
||||
self.powermax_array = value
|
||||
|
||||
def set_chap_config_options(self, key, value):
|
||||
if key == 'use_chap_auth':
|
||||
|
|
|
@ -49,8 +49,9 @@ class PowerMaxCommonTest(test.TestCase):
|
|||
configuration = tpfo.FakeConfiguration(
|
||||
emc_file=None, volume_backend_name='CommonTests', interval=1,
|
||||
retries=1, san_ip='1.1.1.1', san_login='smc',
|
||||
vmax_array=self.data.array, vmax_srp='SRP_1', san_password='smc',
|
||||
san_api_port=8443, vmax_port_groups=[self.data.port_group_name_f],
|
||||
powermax_array=self.data.array, powermax_srp='SRP_1',
|
||||
san_password='smc', san_api_port=8443,
|
||||
powermax_port_groups=[self.data.port_group_name_f],
|
||||
powermax_port_group_name_template='portGroupName',
|
||||
replication_device=replication_device)
|
||||
rest.PowerMaxRest._establish_rest_session = mock.Mock(
|
||||
|
@ -2914,8 +2915,9 @@ class PowerMaxCommonTest(test.TestCase):
|
|||
old_conf = tpfo.FakeConfiguration(None, 'CommonTests', 1, 1)
|
||||
configuration = tpfo.FakeConfiguration(
|
||||
None, 'CommonTests', 1, 1, san_ip='1.1.1.1', san_login='smc',
|
||||
vmax_array=self.data.array, vmax_srp='SRP_1', san_password='smc',
|
||||
san_api_port=8443, vmax_port_groups=[self.data.port_group_name_i])
|
||||
powermax_array=self.data.array, powermax_srp='SRP_1',
|
||||
san_password='smc', san_api_port=8443,
|
||||
powermax_port_groups=[self.data.port_group_name_i])
|
||||
self.common.configuration = configuration
|
||||
kwargs_returned = self.common.get_attributes_from_cinder_config()
|
||||
self.assertEqual(kwargs_expected, kwargs_returned)
|
||||
|
@ -2931,8 +2933,9 @@ class PowerMaxCommonTest(test.TestCase):
|
|||
'PortGroup': [self.data.port_group_name_i]})
|
||||
configuration = tpfo.FakeConfiguration(
|
||||
None, 'CommonTests', 1, 1, san_ip='1.1.1.1', san_login='smc',
|
||||
vmax_array=self.data.array, vmax_srp='SRP_1', san_password='smc',
|
||||
san_api_port=3448, vmax_port_groups=[self.data.port_group_name_i])
|
||||
powermax_array=self.data.array, powermax_srp='SRP_1',
|
||||
san_password='smc', san_api_port=3448,
|
||||
powermax_port_groups=[self.data.port_group_name_i])
|
||||
self.common.configuration = configuration
|
||||
kwargs_returned = self.common.get_attributes_from_cinder_config()
|
||||
self.assertEqual(kwargs_expected, kwargs_returned)
|
||||
|
@ -2945,8 +2948,9 @@ class PowerMaxCommonTest(test.TestCase):
|
|||
'PortGroup': [self.data.port_group_name_i]})
|
||||
configuration = tpfo.FakeConfiguration(
|
||||
None, 'CommonTests', 1, 1, san_ip='1.1.1.1', san_login='smc',
|
||||
vmax_array=self.data.array, vmax_srp='SRP_1', san_password='smc',
|
||||
vmax_port_groups=[self.data.port_group_name_i])
|
||||
powermax_array=self.data.array, powermax_srp='SRP_1',
|
||||
san_password='smc',
|
||||
powermax_port_groups=[self.data.port_group_name_i])
|
||||
self.common.configuration = configuration
|
||||
kwargs_returned = self.common.get_attributes_from_cinder_config()
|
||||
self.assertEqual(kwargs_expected, kwargs_returned)
|
||||
|
@ -2954,8 +2958,9 @@ class PowerMaxCommonTest(test.TestCase):
|
|||
def test_get_ssl_attributes_from_cinder_config(self):
|
||||
conf = tpfo.FakeConfiguration(
|
||||
None, 'CommonTests', 1, 1, san_ip='1.1.1.1', san_login='smc',
|
||||
vmax_array=self.data.array, vmax_srp='SRP_1', san_password='smc',
|
||||
vmax_port_groups=[self.data.port_group_name_i],
|
||||
powermax_array=self.data.array, powermax_srp='SRP_1',
|
||||
san_password='smc',
|
||||
powermax_port_groups=[self.data.port_group_name_i],
|
||||
driver_ssl_cert_verify=True,
|
||||
driver_ssl_cert_path='/path/to/cert')
|
||||
|
||||
|
@ -3227,16 +3232,16 @@ class PowerMaxCommonTest(test.TestCase):
|
|||
self.assertEqual(vols_lists, expected_response)
|
||||
|
||||
def test_get_slo_workload_combo_from_cinder_conf(self):
|
||||
self.common.configuration.vmax_service_level = 'Diamond'
|
||||
self.common.configuration.powermax_service_level = 'Diamond'
|
||||
self.common.configuration.vmax_workload = 'DSS'
|
||||
response1 = self.common.get_attributes_from_cinder_config()
|
||||
self.assertEqual('Diamond', response1['ServiceLevel'])
|
||||
self.assertEqual('DSS', response1['Workload'])
|
||||
|
||||
self.common.configuration.vmax_service_level = 'Diamond'
|
||||
self.common.configuration.powermax_service_level = 'Diamond'
|
||||
self.common.configuration.vmax_workload = None
|
||||
response2 = self.common.get_attributes_from_cinder_config()
|
||||
self.assertEqual(self.common.configuration.vmax_service_level,
|
||||
self.assertEqual(self.common.configuration.powermax_service_level,
|
||||
response2['ServiceLevel'])
|
||||
self.assertIsNone(response2['Workload'])
|
||||
|
||||
|
@ -3246,12 +3251,12 @@ class PowerMaxCommonTest(test.TestCase):
|
|||
'SerialNumber': '000197800123', 'srpName': 'SRP_1',
|
||||
'PortGroup': ['OS-fibre-PG']}
|
||||
|
||||
self.common.configuration.vmax_service_level = None
|
||||
self.common.configuration.powermax_service_level = None
|
||||
self.common.configuration.vmax_workload = 'DSS'
|
||||
response3 = self.common.get_attributes_from_cinder_config()
|
||||
self.assertEqual(expected_response, response3)
|
||||
|
||||
self.common.configuration.vmax_service_level = None
|
||||
self.common.configuration.powermax_service_level = None
|
||||
self.common.configuration.vmax_workload = None
|
||||
response4 = self.common.get_attributes_from_cinder_config()
|
||||
self.assertEqual(expected_response, response4)
|
||||
|
@ -3474,8 +3479,9 @@ class PowerMaxCommonTest(test.TestCase):
|
|||
# Test user set port ID
|
||||
configuration = tpfo.FakeConfiguration(
|
||||
None, 'CommonTests', 1, 1, san_ip='1.1.1.1', san_login='smc',
|
||||
vmax_array=self.data.array, vmax_srp='SRP_1', san_password='smc',
|
||||
san_api_port=1234, vmax_port_groups=[self.data.port_group_name_i])
|
||||
powermax_array=self.data.array, powermax_srp='SRP_1',
|
||||
san_password='smc', san_api_port=1234,
|
||||
powermax_port_groups=[self.data.port_group_name_i])
|
||||
self.common.configuration = configuration
|
||||
port = self.common._get_unisphere_port()
|
||||
self.assertEqual(1234, port)
|
||||
|
@ -3483,8 +3489,9 @@ class PowerMaxCommonTest(test.TestCase):
|
|||
# Test no set port ID, use default port
|
||||
configuration = tpfo.FakeConfiguration(
|
||||
None, 'CommonTests', 1, 1, san_ip='1.1.1.1', san_login='smc',
|
||||
vmax_array=self.data.array, vmax_srp='SRP_1', san_password='smc',
|
||||
vmax_port_groups=[self.data.port_group_name_i])
|
||||
powermax_array=self.data.array, powermax_srp='SRP_1',
|
||||
san_password='smc',
|
||||
powermax_port_groups=[self.data.port_group_name_i])
|
||||
self.common.configuration = configuration
|
||||
ref_port = utils.DEFAULT_PORT
|
||||
port = self.common._get_unisphere_port()
|
||||
|
@ -4094,7 +4101,7 @@ class PowerMaxCommonTest(test.TestCase):
|
|||
self.common.interval = 1
|
||||
self.common.retries = 1
|
||||
with mock.patch.object(
|
||||
self.common, '_get_configuration_value') as mock_array:
|
||||
tpfo.FakeConfiguration, 'safe_get') as mock_array:
|
||||
self.common._get_volume_group_info(
|
||||
self.data.test_group_1)
|
||||
mock_group_utils.assert_called_once_with(
|
||||
|
@ -4105,8 +4112,9 @@ class PowerMaxCommonTest(test.TestCase):
|
|||
def test_get_performance_config(self):
|
||||
ref_cinder_conf = tpfo.FakeConfiguration(
|
||||
None, 'ProvisionTests', 1, 1, san_ip='1.1.1.1', san_login='smc',
|
||||
vmax_array=self.data.array, vmax_srp='SRP_1', san_password='smc',
|
||||
san_api_port=8443, vmax_port_groups=[self.data.port_group_name_f],
|
||||
powermax_array=self.data.array, powermax_srp='SRP_1',
|
||||
san_password='smc', san_api_port=8443,
|
||||
powermax_port_groups=[self.data.port_group_name_f],
|
||||
load_balance=True, load_balance_real_time=True,
|
||||
load_data_format='avg', load_look_back=60,
|
||||
load_look_back_real_time=10, port_group_load_metric='PercentBusy',
|
||||
|
|
|
@ -35,8 +35,9 @@ class PowerMaxFCTest(test.TestCase):
|
|||
volume_utils.get_max_over_subscription_ratio = mock.Mock()
|
||||
self.configuration = tpfo.FakeConfiguration(
|
||||
None, 'FCTests', 1, 1, san_ip='1.1.1.1', san_login='smc',
|
||||
vmax_array=self.data.array, vmax_srp='SRP_1', san_password='smc',
|
||||
san_api_port=8443, vmax_port_groups=[self.data.port_group_name_i])
|
||||
powermax_array=self.data.array, powermax_srp='SRP_1',
|
||||
san_password='smc', san_api_port=8443,
|
||||
powermax_port_groups=[self.data.port_group_name_i])
|
||||
rest.PowerMaxRest._establish_rest_session = mock.Mock(
|
||||
return_value=tpfo.FakeRequestsSession())
|
||||
driver = fc.PowerMaxFCDriver(configuration=self.configuration)
|
||||
|
|
|
@ -34,8 +34,9 @@ class PowerMaxISCSITest(test.TestCase):
|
|||
volume_utils.get_max_over_subscription_ratio = mock.Mock()
|
||||
configuration = tpfo.FakeConfiguration(
|
||||
None, 'ISCSITests', 1, 1, san_ip='1.1.1.1', san_login='smc',
|
||||
vmax_array=self.data.array, vmax_srp='SRP_1', san_password='smc',
|
||||
san_api_port=8443, vmax_port_groups=[self.data.port_group_name_i])
|
||||
powermax_array=self.data.array, powermax_srp='SRP_1',
|
||||
san_password='smc', san_api_port=8443,
|
||||
powermax_port_groups=[self.data.port_group_name_i])
|
||||
rest.PowerMaxRest._establish_rest_session = mock.Mock(
|
||||
return_value=tpfo.FakeRequestsSession())
|
||||
driver = iscsi.PowerMaxISCSIDriver(configuration=configuration)
|
||||
|
@ -236,10 +237,10 @@ class PowerMaxISCSITest(test.TestCase):
|
|||
backup_conf = self.common.configuration
|
||||
configuration = tpfo.FakeConfiguration(
|
||||
None, 'ISCSITests', 1, 1, san_ip='1.1.1.1', san_login='smc',
|
||||
vmax_array=self.data.array, vmax_srp='SRP_1', san_password='smc',
|
||||
san_rest_port=8443, use_chap_auth=True,
|
||||
powermax_array=self.data.array, powermax_srp='SRP_1',
|
||||
san_password='smc', san_rest_port=8443, use_chap_auth=True,
|
||||
chap_username='auth_username', chap_password='auth_secret',
|
||||
vmax_port_groups=[self.data.port_group_name_i])
|
||||
powermax_port_groups=[self.data.port_group_name_i])
|
||||
self.driver.configuration = configuration
|
||||
ip_and_iqn = [{'ip': self.data.ip, 'iqn': self.data.initiator},
|
||||
{'ip': self.data.ip, 'iqn': self.data.iqn}]
|
||||
|
|
|
@ -38,9 +38,9 @@ class PowerMaxMaskingTest(test.TestCase):
|
|||
self.replication_device = self.data.sync_rep_device
|
||||
configuration = tpfo.FakeConfiguration(
|
||||
None, 'MaskingTests', 1, 1, san_ip='1.1.1.1',
|
||||
san_login='smc', vmax_array=self.data.array, vmax_srp='SRP_1',
|
||||
san_password='smc', san_api_port=8443,
|
||||
vmax_port_groups=[self.data.port_group_name_f],
|
||||
san_login='smc', powermax_array=self.data.array,
|
||||
powermax_srp='SRP_1', san_password='smc', san_api_port=8443,
|
||||
powermax_port_groups=[self.data.port_group_name_f],
|
||||
replication_device=self.replication_device)
|
||||
self._gather_info = common.PowerMaxCommon._gather_info
|
||||
common.PowerMaxCommon._get_u4p_failover_info = mock.Mock()
|
||||
|
|
|
@ -36,8 +36,8 @@ class PowerMaxMigrateTest(test.TestCase):
|
|||
super(PowerMaxMigrateTest, self).setUp()
|
||||
configuration = tpfo.FakeConfiguration(
|
||||
None, 'MaskingTests', 1, 1, san_ip='1.1.1.1',
|
||||
san_login='smc', vmax_array=self.data.array, vmax_srp='SRP_1',
|
||||
san_password='smc', san_api_port=8443,
|
||||
san_login='smc', powermax_array=self.data.array,
|
||||
powermax_srp='SRP_1', san_password='smc', san_api_port=8443,
|
||||
vmax_port_groups=[self.data.port_group_name_f])
|
||||
rest.PowerMaxRest._establish_rest_session = mock.Mock(
|
||||
return_value=tpfo.FakeRequestsSession())
|
||||
|
|
|
@ -34,8 +34,9 @@ class PowerMaxPerformanceTest(test.TestCase):
|
|||
self.data = tpd.PowerMaxData()
|
||||
self.reference_cinder_conf = tpfo.FakeConfiguration(
|
||||
None, 'ProvisionTests', 1, 1, san_ip='1.1.1.1', san_login='smc',
|
||||
vmax_array=self.data.array, vmax_srp='SRP_1', san_password='smc',
|
||||
san_api_port=8443, vmax_port_groups=[self.data.port_group_name_i],
|
||||
powermax_array=self.data.array, powermax_srp='SRP_1',
|
||||
san_password='smc', san_api_port=8443,
|
||||
powermax_port_groups=[self.data.port_group_name_i],
|
||||
load_balance=True, load_balance_real_time=True,
|
||||
load_data_format='avg', load_look_back=60,
|
||||
load_look_back_real_time=10, port_group_load_metric='PercentBusy',
|
||||
|
|
|
@ -35,8 +35,9 @@ class PowerMaxProvisionTest(test.TestCase):
|
|||
volume_utils.get_max_over_subscription_ratio = mock.Mock()
|
||||
configuration = tpfo.FakeConfiguration(
|
||||
None, 'ProvisionTests', 1, 1, san_ip='1.1.1.1', san_login='smc',
|
||||
vmax_array=self.data.array, vmax_srp='SRP_1', san_password='smc',
|
||||
san_api_port=8443, vmax_port_groups=[self.data.port_group_name_i])
|
||||
powermax_array=self.data.array, powermax_srp='SRP_1',
|
||||
san_password='smc', san_api_port=8443,
|
||||
powermax_port_groups=[self.data.port_group_name_i])
|
||||
rest.PowerMaxRest._establish_rest_session = mock.Mock(
|
||||
return_value=tpfo.FakeRequestsSession())
|
||||
driver = iscsi.PowerMaxISCSIDriver(configuration=configuration)
|
||||
|
|
|
@ -45,18 +45,18 @@ class PowerMaxReplicationTest(test.TestCase):
|
|||
volume_utils.get_max_over_subscription_ratio = mock.Mock()
|
||||
configuration = tpfo.FakeConfiguration(
|
||||
None, 'CommonReplicationTests', interval=1, retries=1,
|
||||
san_ip='1.1.1.1', san_login='smc', vmax_array=self.data.array,
|
||||
vmax_srp='SRP_1', san_password='smc', san_api_port=8443,
|
||||
vmax_port_groups=[self.data.port_group_name_f],
|
||||
san_ip='1.1.1.1', san_login='smc', powermax_array=self.data.array,
|
||||
powermax_srp='SRP_1', san_password='smc', san_api_port=8443,
|
||||
powermax_port_groups=[self.data.port_group_name_f],
|
||||
replication_device=self.replication_device)
|
||||
rest.PowerMaxRest._establish_rest_session = mock.Mock(
|
||||
return_value=tpfo.FakeRequestsSession())
|
||||
driver = fc.PowerMaxFCDriver(configuration=configuration)
|
||||
iscsi_config = tpfo.FakeConfiguration(
|
||||
None, 'CommonReplicationTests', interval=1, retries=1,
|
||||
san_ip='1.1.1.1', san_login='smc', vmax_array=self.data.array,
|
||||
vmax_srp='SRP_1', san_password='smc', san_api_port=8443,
|
||||
vmax_port_groups=[self.data.port_group_name_i],
|
||||
san_ip='1.1.1.1', san_login='smc', powermax_array=self.data.array,
|
||||
powermax_srp='SRP_1', san_password='smc', san_api_port=8443,
|
||||
powermax_port_groups=[self.data.port_group_name_i],
|
||||
replication_device=self.replication_device)
|
||||
iscsi_driver = iscsi.PowerMaxISCSIDriver(configuration=iscsi_config)
|
||||
self.iscsi_common = iscsi_driver.common
|
||||
|
@ -76,18 +76,18 @@ class PowerMaxReplicationTest(test.TestCase):
|
|||
self.async_rep_device = self.data.async_rep_device
|
||||
async_configuration = tpfo.FakeConfiguration(
|
||||
None, 'CommonReplicationTests', interval=1, retries=1,
|
||||
san_ip='1.1.1.1', san_login='smc', vmax_array=self.data.array,
|
||||
vmax_srp='SRP_1', san_password='smc', san_api_port=8443,
|
||||
vmax_port_groups=[self.data.port_group_name_f],
|
||||
san_ip='1.1.1.1', san_login='smc', powermax_array=self.data.array,
|
||||
powermax_srp='SRP_1', san_password='smc', san_api_port=8443,
|
||||
powermax_port_groups=[self.data.port_group_name_f],
|
||||
replication_device=self.async_rep_device)
|
||||
self.async_driver = fc.PowerMaxFCDriver(
|
||||
configuration=async_configuration)
|
||||
self.metro_rep_device = self.data.metro_rep_device
|
||||
metro_configuration = tpfo.FakeConfiguration(
|
||||
None, 'CommonReplicationTests', interval=1, retries=1,
|
||||
san_ip='1.1.1.1', san_login='smc', vmax_array=self.data.array,
|
||||
vmax_srp='SRP_1', san_password='smc', san_api_port=8443,
|
||||
vmax_port_groups=[self.data.port_group_name_f],
|
||||
san_ip='1.1.1.1', san_login='smc', powermax_array=self.data.array,
|
||||
powermax_srp='SRP_1', san_password='smc', san_api_port=8443,
|
||||
powermax_port_groups=[self.data.port_group_name_f],
|
||||
replication_device=self.metro_rep_device)
|
||||
self.metro_driver = fc.PowerMaxFCDriver(
|
||||
configuration=metro_configuration)
|
||||
|
|
|
@ -39,8 +39,9 @@ class PowerMaxRestTest(test.TestCase):
|
|||
volume_utils.get_max_over_subscription_ratio = mock.Mock()
|
||||
configuration = tpfo.FakeConfiguration(
|
||||
None, 'RestTests', 1, 1, san_ip='1.1.1.1', san_login='smc',
|
||||
vmax_array=self.data.array, vmax_srp='SRP_1', san_password='smc',
|
||||
san_api_port=8443, vmax_port_groups=[self.data.port_group_name_i])
|
||||
powermax_array=self.data.array, powermax_srp='SRP_1',
|
||||
san_password='smc', san_api_port=8443,
|
||||
powermax_port_groups=[self.data.port_group_name_i])
|
||||
rest.PowerMaxRest._establish_rest_session = mock.Mock(
|
||||
return_value=tpfo.FakeRequestsSession())
|
||||
driver = fc.PowerMaxFCDriver(configuration=configuration)
|
||||
|
|
|
@ -44,8 +44,9 @@ class PowerMaxUtilsTest(test.TestCase):
|
|||
self.replication_device = self.data.sync_rep_device
|
||||
configuration = tpfo.FakeConfiguration(
|
||||
None, 'UtilsTests', 1, 1, san_ip='1.1.1.1', san_login='smc',
|
||||
vmax_array=self.data.array, vmax_srp='SRP_1', san_password='smc',
|
||||
san_api_port=8443, vmax_port_groups=[self.data.port_group_name_i],
|
||||
powermax_array=self.data.array, powermax_srp='SRP_1',
|
||||
san_password='smc', san_api_port=8443,
|
||||
powermax_port_groups=[self.data.port_group_name_i],
|
||||
replication_device=self.replication_device)
|
||||
rest.PowerMaxRest._establish_rest_session = mock.Mock(
|
||||
return_value=tpfo.FakeRequestsSession())
|
||||
|
|
|
@ -67,35 +67,13 @@ powermax_opts = [
|
|||
default=200,
|
||||
help='Use this value to specify '
|
||||
'number of retries.'),
|
||||
cfg.IntOpt(utils.VMAX_SNAPVX_UNLINK_LIMIT,
|
||||
default=3,
|
||||
help='DEPRECATED: vmax_snapvc_unlink_limit.',
|
||||
deprecated_for_removal=True,
|
||||
deprecated_reason='Replaced by powermax_snapvx_unlink_limit.'),
|
||||
cfg.BoolOpt('initiator_check',
|
||||
default=False,
|
||||
help='Use this value to enable '
|
||||
'the initiator_check.'),
|
||||
cfg.StrOpt(utils.VMAX_ARRAY,
|
||||
help='DEPRECATED: vmax_array.',
|
||||
deprecated_for_removal=True,
|
||||
deprecated_reason='Replaced by powermax_array.'),
|
||||
cfg.StrOpt(utils.VMAX_SRP,
|
||||
help='DEPRECATED: vmax_srp.',
|
||||
deprecated_for_removal=True,
|
||||
deprecated_reason='Replaced by powermax_srp.'),
|
||||
cfg.StrOpt(utils.VMAX_SERVICE_LEVEL,
|
||||
help='DEPRECATED: vmax_service_level.',
|
||||
deprecated_for_removal=True,
|
||||
deprecated_reason='Replaced by powermax_service_level.'),
|
||||
cfg.StrOpt(utils.VMAX_WORKLOAD,
|
||||
help='Workload, setting this as an extra spec in '
|
||||
'pool_name is preferable.'),
|
||||
cfg.ListOpt(utils.VMAX_PORT_GROUPS,
|
||||
bounds=True,
|
||||
help='DEPRECATED: vmax_port_groups.',
|
||||
deprecated_for_removal=True,
|
||||
deprecated_reason='Replaced by powermax_port_groups.'),
|
||||
cfg.IntOpt(utils.U4P_FAILOVER_TIMEOUT,
|
||||
default=20.0,
|
||||
help='How long to wait for the server to send data before '
|
||||
|
@ -265,8 +243,7 @@ class PowerMaxCommon(object):
|
|||
"""Get relevent details from configuration file."""
|
||||
self.interval = self.configuration.safe_get('interval')
|
||||
self.retries = self.configuration.safe_get('retries')
|
||||
self.snapvx_unlink_limit = self._get_unlink_configuration_value(
|
||||
utils.VMAX_SNAPVX_UNLINK_LIMIT,
|
||||
self.snapvx_unlink_limit = self.configuration.safe_get(
|
||||
utils.POWERMAX_SNAPVX_UNLINK_LIMIT)
|
||||
self.powermax_array_tag_list = self.configuration.safe_get(
|
||||
utils.POWERMAX_ARRAY_TAG_LIST)
|
||||
|
@ -5188,8 +5165,7 @@ class PowerMaxCommon(object):
|
|||
"""
|
||||
volume_update_list = list()
|
||||
group_update_list = list()
|
||||
primary_array = self._get_configuration_value(
|
||||
utils.VMAX_ARRAY, utils.POWERMAX_ARRAY)
|
||||
primary_array = self.configuration.safe_get(utils.POWERMAX_ARRAY)
|
||||
array_list = self.rest.get_arrays_list()
|
||||
is_valid, msg = self.utils.validate_failover_request(
|
||||
self.failover, secondary_id, self.rep_configs, primary_array,
|
||||
|
@ -6566,19 +6542,16 @@ class PowerMaxCommon(object):
|
|||
username = self.configuration.safe_get(utils.VMAX_USER_NAME)
|
||||
password = self.configuration.safe_get(utils.VMAX_PASSWORD)
|
||||
if username and password:
|
||||
serial_number = self._get_configuration_value(
|
||||
utils.VMAX_ARRAY, utils.POWERMAX_ARRAY)
|
||||
serial_number = self.configuration.safe_get(utils.POWERMAX_ARRAY)
|
||||
if serial_number is None:
|
||||
LOG.error("Array Serial Number must be set in cinder.conf")
|
||||
srp_name = self._get_configuration_value(
|
||||
utils.VMAX_SRP, utils.POWERMAX_SRP)
|
||||
srp_name = self.configuration.safe_get(utils.POWERMAX_SRP)
|
||||
if srp_name is None:
|
||||
LOG.error("SRP Name must be set in cinder.conf")
|
||||
slo = self._get_configuration_value(
|
||||
utils.VMAX_SERVICE_LEVEL, utils.POWERMAX_SERVICE_LEVEL)
|
||||
slo = self.configuration.safe_get(utils.POWERMAX_SERVICE_LEVEL)
|
||||
workload = self.configuration.safe_get(utils.VMAX_WORKLOAD)
|
||||
port_groups = self._get_configuration_value(
|
||||
utils.VMAX_PORT_GROUPS, utils.POWERMAX_PORT_GROUPS)
|
||||
port_groups = self.configuration.safe_get(
|
||||
utils.POWERMAX_PORT_GROUPS)
|
||||
|
||||
kwargs = (
|
||||
{'RestServerIp': self.configuration.safe_get(
|
||||
|
@ -6604,25 +6577,6 @@ class PowerMaxCommon(object):
|
|||
|
||||
return kwargs
|
||||
|
||||
def _get_configuration_value(self, first_key, second_key):
|
||||
"""Get the configuration value of the first or second key
|
||||
|
||||
:param first_key: the first key
|
||||
:param second_key: the second key
|
||||
:returns: value
|
||||
"""
|
||||
return_value = None
|
||||
if (self.configuration.safe_get(first_key)
|
||||
and self.configuration.safe_get(second_key)):
|
||||
LOG.error("Cannot specifiy both %(first_key)s. "
|
||||
"and %(second_key)s.",
|
||||
{'first_key': first_key, 'second_key': second_key})
|
||||
else:
|
||||
return_value = self.configuration.safe_get(first_key)
|
||||
if return_value is None:
|
||||
return_value = self.configuration.safe_get(second_key)
|
||||
return return_value
|
||||
|
||||
def _get_volume_group_info(self, group):
|
||||
"""Get the volume group array, retries and intervals
|
||||
|
||||
|
@ -6633,8 +6587,7 @@ class PowerMaxCommon(object):
|
|||
array, interval_retries_dict = self.utils.get_volume_group_utils(
|
||||
group, self.interval, self.retries)
|
||||
if not array:
|
||||
array = self._get_configuration_value(
|
||||
utils.VMAX_ARRAY, utils.POWERMAX_ARRAY)
|
||||
array = self.configuration.safe_get(utils.POWERMAX_ARRAY)
|
||||
if not array:
|
||||
exception_message = _(
|
||||
"Cannot get the array serial_number")
|
||||
|
@ -6644,22 +6597,6 @@ class PowerMaxCommon(object):
|
|||
message=exception_message)
|
||||
return array, interval_retries_dict
|
||||
|
||||
def _get_unlink_configuration_value(self, first_key, second_key):
|
||||
"""Get the configuration value of snapvx_unlink_limit
|
||||
|
||||
This will give back the value of the default snapvx_unlink_limit
|
||||
unless either powermax_snapvx_unlink_limit or vmax_snapvx_unlink_limit
|
||||
is set to something else
|
||||
|
||||
:param first_key: the first key
|
||||
:param second_key: the second key
|
||||
:returns: value
|
||||
"""
|
||||
return_value = self.configuration.safe_get(second_key)
|
||||
if return_value == 3:
|
||||
return_value = self.configuration.safe_get(first_key)
|
||||
return return_value
|
||||
|
||||
def _get_unisphere_port(self):
|
||||
"""Get unisphere port from the configuration file
|
||||
|
||||
|
|
|
@ -122,12 +122,7 @@ VMAX_SERVER_IP = 'san_ip'
|
|||
VMAX_USER_NAME = 'san_login'
|
||||
VMAX_PASSWORD = 'san_password'
|
||||
U4P_SERVER_PORT = 'san_api_port'
|
||||
VMAX_ARRAY = 'vmax_array'
|
||||
VMAX_WORKLOAD = 'vmax_workload'
|
||||
VMAX_SRP = 'vmax_srp'
|
||||
VMAX_SERVICE_LEVEL = 'vmax_service_level'
|
||||
VMAX_PORT_GROUPS = 'vmax_port_groups'
|
||||
VMAX_SNAPVX_UNLINK_LIMIT = 'vmax_snapvx_unlink_limit'
|
||||
U4P_FAILOVER_TIMEOUT = 'u4p_failover_timeout'
|
||||
U4P_FAILOVER_RETRIES = 'u4p_failover_retries'
|
||||
U4P_FAILOVER_BACKOFF_FACTOR = 'u4p_failover_backoff_factor'
|
||||
|
|
Loading…
Reference in New Issue