Merge "Storwize/SVC driver detach volume failed" into stable/icehouse
This commit is contained in:
commit
63f5798e87
@ -2390,15 +2390,13 @@ class StorwizeSVCDriverTestCase(test.TestCase):
|
||||
self._delete_volume(volume)
|
||||
|
||||
def test_storwize_initiator_multiple_preferred_nodes_matching(self):
|
||||
# Set the context.
|
||||
ctxt = context.get_admin_context()
|
||||
|
||||
# Generate us a test volume
|
||||
volume = self._generate_vol_info(None, None)
|
||||
self.driver.create_volume(volume)
|
||||
volume = self._create_volume()
|
||||
|
||||
# Fibre Channel volume type
|
||||
vol_type = volume_types.create(ctxt, 'FC', {'protocol': 'FC'})
|
||||
extra_spec = {'capabilities:storage_protocol': '<in> FC'}
|
||||
vol_type = volume_types.create(self.ctxt, 'FC', extra_spec)
|
||||
|
||||
volume['volume_type_id'] = vol_type['id']
|
||||
|
||||
@ -2427,15 +2425,12 @@ class StorwizeSVCDriverTestCase(test.TestCase):
|
||||
'AABBCCDDEEFF0010')
|
||||
|
||||
def test_storwize_initiator_multiple_preferred_nodes_no_matching(self):
|
||||
# Set the context.
|
||||
ctxt = context.get_admin_context()
|
||||
|
||||
# Generate us a test volume
|
||||
volume = self._generate_vol_info(None, None)
|
||||
self.driver.create_volume(volume)
|
||||
volume = self._create_volume()
|
||||
|
||||
# Fibre Channel volume type
|
||||
vol_type = volume_types.create(ctxt, 'FC', {'protocol': 'FC'})
|
||||
extra_spec = {'capabilities:storage_protocol': '<in> FC'}
|
||||
vol_type = volume_types.create(self.ctxt, 'FC', extra_spec)
|
||||
|
||||
volume['volume_type_id'] = vol_type['id']
|
||||
|
||||
@ -2464,15 +2459,12 @@ class StorwizeSVCDriverTestCase(test.TestCase):
|
||||
'AABBCCDDEEFF0001')
|
||||
|
||||
def test_storwize_initiator_single_preferred_node_matching(self):
|
||||
# Set the context
|
||||
ctxt = context.get_admin_context()
|
||||
|
||||
# Generate us a test volume
|
||||
volume = self._generate_vol_info(None, None)
|
||||
self.driver.create_volume(volume)
|
||||
volume = self._create_volume()
|
||||
|
||||
# Fibre Channel volume type
|
||||
vol_type = volume_types.create(ctxt, 'FC', {'protocol': 'FC'})
|
||||
extra_spec = {'capabilities:storage_protocol': '<in> FC'}
|
||||
vol_type = volume_types.create(self.ctxt, 'FC', extra_spec)
|
||||
|
||||
volume['volume_type_id'] = vol_type['id']
|
||||
|
||||
@ -2499,16 +2491,36 @@ class StorwizeSVCDriverTestCase(test.TestCase):
|
||||
self.assertEqual(init_ret['data']['target_wwn'],
|
||||
'AABBCCDDEEFF0012')
|
||||
|
||||
def test_storwize_initiator_target_map(self):
|
||||
# Create two volumes to be used in mappings
|
||||
ctxt = context.get_admin_context()
|
||||
def test_storwize_terminate_connection(self):
|
||||
# create a FC volume
|
||||
volume_fc = self._create_volume()
|
||||
extra_spec = {'capabilities:storage_protocol': '<in> FC'}
|
||||
vol_type_fc = volume_types.create(self.ctxt, 'FC', extra_spec)
|
||||
volume_fc['volume_type_id'] = vol_type_fc['id']
|
||||
|
||||
# create a iSCSI volume
|
||||
volume_iSCSI = self._create_volume()
|
||||
extra_spec = {'capabilities:storage_protocol': '<in> iSCSI'}
|
||||
vol_type_iSCSI = volume_types.create(self.ctxt, 'iSCSI', extra_spec)
|
||||
volume_iSCSI['volume_type_id'] = vol_type_iSCSI['id']
|
||||
|
||||
connector = {'host': 'storwize-svc-host',
|
||||
'wwnns': ['20000090fa17311e', '20000090fa17311f'],
|
||||
'wwpns': ['ff00000000000000', 'ff00000000000001'],
|
||||
'initiator': 'iqn.1993-08.org.debian:01:eac5ccc1aaa'}
|
||||
|
||||
self.driver.initialize_connection(volume_fc, connector)
|
||||
self.driver.initialize_connection(volume_iSCSI, connector)
|
||||
self.driver.terminate_connection(volume_iSCSI, connector)
|
||||
self.driver.terminate_connection(volume_fc, connector)
|
||||
|
||||
def test_storwize_initiator_target_map(self):
|
||||
# Generate us a test volume
|
||||
volume = self._generate_vol_info(None, None)
|
||||
self.driver.create_volume(volume)
|
||||
volume = self._create_volume()
|
||||
|
||||
# FIbre Channel volume type
|
||||
vol_type = volume_types.create(ctxt, 'FC', {'protocol': 'FC'})
|
||||
extra_spec = {'capabilities:storage_protocol': '<in> FC'}
|
||||
vol_type = volume_types.create(self.ctxt, 'FC', extra_spec)
|
||||
|
||||
volume['volume_type_id'] = vol_type['id']
|
||||
|
||||
|
@ -471,6 +471,16 @@ class StorwizeSVCDriver(san.SanDriver):
|
||||
|
||||
vol_name = volume['name']
|
||||
if 'host' in connector:
|
||||
# maybe two hosts on the storage, one is for FC and the other for
|
||||
# iSCSI, so get host according to protocol
|
||||
vol_opts = self._get_vdisk_params(volume['volume_type_id'])
|
||||
connector = connector.copy()
|
||||
if vol_opts['protocol'] == 'FC':
|
||||
connector.pop('initiator', None)
|
||||
elif vol_opts['protocol'] == 'iSCSI':
|
||||
connector.pop('wwnns', None)
|
||||
connector.pop('wwpns', None)
|
||||
|
||||
host_name = self._helpers.get_host_from_connector(connector)
|
||||
if host_name is None:
|
||||
msg = (_('terminate_connection: Failed to get host name from'
|
||||
|
Loading…
Reference in New Issue
Block a user