Merge "PowerMax driver - add 'target_array_model' to metadata"
This commit is contained in:
commit
3521fc1cbf
|
@ -999,7 +999,7 @@ class PowerMaxData(object):
|
|||
openstack_release = '12.0.0.0b3.dev401'
|
||||
openstack_version = '12.0.0'
|
||||
python_version = '2.7.12'
|
||||
vmax_driver_version = '3.1'
|
||||
vmax_driver_version = '4.1'
|
||||
vmax_firmware_version = u'5977.1125.1125'
|
||||
vmax_model = u'VMAX250F'
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ class PowerMaxVolumeMetadataNoDebugTest(test.TestCase):
|
|||
super(PowerMaxVolumeMetadataNoDebugTest, self).setUp()
|
||||
is_debug = False
|
||||
self.volume_metadata = metadata.PowerMaxVolumeMetadata(
|
||||
rest.PowerMaxRest, '3.1', is_debug)
|
||||
rest.PowerMaxRest, '4.0', is_debug)
|
||||
|
||||
@mock.patch.object(
|
||||
metadata.PowerMaxVolumeMetadata, '_fill_volume_trace_dict',
|
||||
|
@ -49,7 +49,7 @@ class PowerMaxVolumeMetadataDebugTest(test.TestCase):
|
|||
super(PowerMaxVolumeMetadataDebugTest, self).setUp()
|
||||
is_debug = True
|
||||
self.volume_metadata = metadata.PowerMaxVolumeMetadata(
|
||||
rest.PowerMaxRest, '3.1', is_debug)
|
||||
rest.PowerMaxRest, '4.1', is_debug)
|
||||
self.utils = self.volume_metadata.utils
|
||||
self.rest = self.volume_metadata.rest
|
||||
|
||||
|
@ -255,3 +255,26 @@ class PowerMaxVolumeMetadataDebugTest(test.TestCase):
|
|||
self.volume_metadata.gather_version_info(self.data.array)
|
||||
self.assertEqual(
|
||||
self.data.version_dict, self.volume_metadata.version_dict)
|
||||
|
||||
def test_gather_replication_info_target_model(self):
|
||||
rep_extra_specs = {'rep_mode': 'Synchronous',
|
||||
'target_array_model': 'PowerMax_2000'}
|
||||
rdf_group_no = '70'
|
||||
remote_array = '000197800124'
|
||||
rep_config = {'mode': 'Synchronous',
|
||||
'rdf_group_label': '23_24_007',
|
||||
'portgroup': 'OS-fibre-PG',
|
||||
'allow_extend': True,
|
||||
'array': '000197800124',
|
||||
'srp': 'SRP_2'}
|
||||
rep_info_dict = self.volume_metadata.gather_replication_info(
|
||||
self.data.volume_id, 'replication', False,
|
||||
rdf_group_no=rdf_group_no,
|
||||
target_name='target_name', remote_array=remote_array,
|
||||
target_device_id=self.data.device_id2,
|
||||
replication_status=fields.ReplicationStatus.ENABLED,
|
||||
rep_mode=rep_extra_specs['rep_mode'],
|
||||
rdf_group_label=rep_config['rdf_group_label'],
|
||||
target_array_model=rep_extra_specs['target_array_model'])
|
||||
self.assertEqual(
|
||||
'PowerMax_2000', rep_info_dict['target_array_model'])
|
||||
|
|
|
@ -1006,3 +1006,73 @@ class PowerMaxReplicationTest(test.TestCase):
|
|||
self.data.test_volume.name, utils.REP_SYNC,
|
||||
True, self.data.extra_specs)
|
||||
mock_retype.assert_called_once()
|
||||
|
||||
|
||||
class PowerMaxReplicationDebugTest(test.TestCase):
|
||||
def setUp(self):
|
||||
self.data = tpd.PowerMaxData()
|
||||
super(PowerMaxReplicationDebugTest, self).setUp()
|
||||
mock_logging = self.mock_object(common, 'LOG')
|
||||
mock_log = mock.Mock()
|
||||
mock_log.isEnabledFor = True
|
||||
mock_logging.getLogger = mock.Mock(return_value=mock_log)
|
||||
self.replication_device = {
|
||||
'target_device_id': self.data.remote_array,
|
||||
'remote_port_group': self.data.port_group_name_f,
|
||||
'remote_pool': self.data.srp2,
|
||||
'rdf_group_label': self.data.rdf_group_name,
|
||||
'allow_extend': 'True'}
|
||||
volume_utils.get_max_over_subscription_ratio = mock.Mock()
|
||||
configuration = tpfo.FakeConfiguration(
|
||||
None, 'CommonReplicationDebugTests', 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],
|
||||
replication_device=self.replication_device,
|
||||
debug=True)
|
||||
rest.PowerMaxRest._establish_rest_session = mock.Mock(
|
||||
return_value=tpfo.FakeRequestsSession())
|
||||
driver = fc.PowerMaxFCDriver(configuration=configuration)
|
||||
self.driver = driver
|
||||
self.common = self.driver.common
|
||||
self.masking = self.common.masking
|
||||
self.provision = self.common.provision
|
||||
self.rest = self.common.rest
|
||||
self.utils = self.common.utils
|
||||
self.utils.get_volumetype_extra_specs = (
|
||||
mock.Mock(
|
||||
return_value=self.data.vol_type_extra_specs_rep_enabled))
|
||||
self.extra_specs = deepcopy(self.data.extra_specs_rep_enabled)
|
||||
self.extra_specs['retries'] = 1
|
||||
self.extra_specs['interval'] = 1
|
||||
self.extra_specs['rep_mode'] = 'Synchronous'
|
||||
|
||||
@mock.patch.object(masking.PowerMaxMasking, 'remove_and_reset_members')
|
||||
@mock.patch.object(common.PowerMaxCommon, '_create_volume')
|
||||
@mock.patch.object(rest.PowerMaxRest, 'get_array_model_info',
|
||||
return_value=('VMAX250F', False))
|
||||
def test_setup_volume_replication_target_debug(
|
||||
self, mock_model, mock_create, mock_rm):
|
||||
rep_status, rep_data, rep_info_dict = (
|
||||
self.common.setup_volume_replication(
|
||||
self.data.array, self.data.test_volume, self.data.device_id,
|
||||
self.extra_specs, self.data.device_id2))
|
||||
self.assertEqual(fields.ReplicationStatus.ENABLED, rep_status)
|
||||
self.assertEqual({'array': self.data.remote_array,
|
||||
'device_id': self.data.device_id2}, rep_data)
|
||||
self.assertEqual('VMAX250F', rep_info_dict['target_array_model'])
|
||||
mock_create.assert_not_called()
|
||||
|
||||
@mock.patch.object(masking.PowerMaxMasking, 'remove_and_reset_members')
|
||||
@mock.patch.object(rest.PowerMaxRest, 'get_array_model_info',
|
||||
return_value=('VMAX250F', False))
|
||||
def test_setup_volume_replication_no_target_debug(
|
||||
self, mock_model, mock_rm):
|
||||
rep_status, rep_data, rep_info_dict = (
|
||||
self.common.setup_volume_replication(
|
||||
self.data.array, self.data.test_volume, self.data.device_id,
|
||||
self.extra_specs))
|
||||
self.assertEqual(fields.ReplicationStatus.ENABLED, rep_status)
|
||||
self.assertEqual({'array': self.data.remote_array,
|
||||
'device_id': self.data.device_id}, rep_data)
|
||||
self.assertEqual('VMAX250F', rep_info_dict['target_array_model'])
|
||||
|
|
|
@ -3325,7 +3325,6 @@ class PowerMaxCommon(object):
|
|||
:returns: replication_status -- str, replication_driver_data -- dict
|
||||
rep_info_dict -- dict
|
||||
"""
|
||||
rep_extra_specs = {'rep_mode': None}
|
||||
source_name = volume.name
|
||||
LOG.debug('Starting replication setup '
|
||||
'for volume: %s.', source_name)
|
||||
|
@ -3340,10 +3339,10 @@ class PowerMaxCommon(object):
|
|||
# source volume
|
||||
target_name = self.utils.get_volume_element_name(volume.id)
|
||||
|
||||
rep_extra_specs = self._get_replication_extra_specs(
|
||||
extra_specs, self.rep_config)
|
||||
if not target_device_id:
|
||||
# Create a target volume on the target array
|
||||
rep_extra_specs = self._get_replication_extra_specs(
|
||||
extra_specs, self.rep_config)
|
||||
volume_dict = self._create_volume(
|
||||
target_name, rdf_vol_size, rep_extra_specs)
|
||||
target_device_id = volume_dict['device_id']
|
||||
|
@ -3376,7 +3375,8 @@ class PowerMaxCommon(object):
|
|||
target_device_id=target_device_id,
|
||||
replication_status=replication_status,
|
||||
rep_mode=rep_extra_specs['rep_mode'],
|
||||
rdf_group_label=self.rep_config['rdf_group_label'])
|
||||
rdf_group_label=self.rep_config['rdf_group_label'],
|
||||
target_array_model=rep_extra_specs['target_array_model'])
|
||||
|
||||
return replication_status, replication_driver_data, rep_info_dict
|
||||
|
||||
|
@ -4090,9 +4090,9 @@ class PowerMaxCommon(object):
|
|||
rep_extra_specs.pop(utils.DISABLECOMPRESSION, None)
|
||||
|
||||
# Check to see if SLO and Workload are configured on the target array.
|
||||
rep_extra_specs['target_array_model'], next_gen = (
|
||||
self.rest.get_array_model_info(rep_config['array']))
|
||||
if extra_specs[utils.SLO]:
|
||||
rep_extra_specs['target_array_model'], next_gen = (
|
||||
self.rest.get_array_model_info(rep_config['array']))
|
||||
is_valid_slo, is_valid_workload = (
|
||||
self.provision.verify_slo_workload(
|
||||
rep_extra_specs[utils.ARRAY],
|
||||
|
|
|
@ -17,6 +17,7 @@ import platform
|
|||
import prettytable
|
||||
import six
|
||||
import time
|
||||
import traceback
|
||||
import types
|
||||
|
||||
from oslo_log import log as logging
|
||||
|
@ -39,9 +40,9 @@ def debug_required(func):
|
|||
return func(*args, **kwargs)
|
||||
else:
|
||||
pass
|
||||
except Exception as ex:
|
||||
except Exception:
|
||||
LOG.warning("Volume metadata logging failure. "
|
||||
"Exception is %s.", ex)
|
||||
"Exception is %s.", traceback.format_exc())
|
||||
|
||||
return func_wrapper
|
||||
|
||||
|
@ -215,7 +216,6 @@ class PowerMaxVolumeMetadata(object):
|
|||
elif k2 == 'sg_list' and v2:
|
||||
for i, item in enumerate(v2, 1):
|
||||
my_volume_trace_dict["storage_group_%d" % i] = item
|
||||
|
||||
return my_volume_trace_dict
|
||||
|
||||
def _param_condition(self, key, value):
|
||||
|
|
Loading…
Reference in New Issue