VMAX Driver - Initiator retrieval short hostname fix
This submission fixes a timeout issue with initiator retrieval, the fix uses targeted extraction instead of list matching to increase performance. Short hostname retrieval for hostnames with 16 or characters has been fixed. Change-Id: I4eff572448c720746fbdd49caf3ae2dccfb3d352 Closes-Bug: #1783855 Closes-Bug: #1783867
This commit is contained in:
parent
b2ceea84b8
commit
50586c61b6
|
@ -2408,19 +2408,6 @@ class VMAXRestTest(test.TestCase):
|
|||
init_list = self.rest.get_initiator_list(array)
|
||||
self.assertEqual([], init_list)
|
||||
|
||||
def test_get_in_use_initiator_list_from_array(self):
|
||||
ref_list = self.data.initiator_list[2]['initiatorId']
|
||||
init_list = self.rest.get_in_use_initiator_list_from_array(
|
||||
self.data.array)
|
||||
self.assertEqual(ref_list, init_list)
|
||||
|
||||
def test_get_in_use_initiator_list_from_array_failed(self):
|
||||
array = self.data.array
|
||||
with mock.patch.object(self.rest, 'get_initiator_list',
|
||||
return_value=[]):
|
||||
init_list = self.rest.get_in_use_initiator_list_from_array(array)
|
||||
self.assertEqual([], init_list)
|
||||
|
||||
def test_get_initiator_group_from_initiator(self):
|
||||
initiator = self.data.wwpn1
|
||||
ref_group = self.data.initiatorgroup_name_f
|
||||
|
@ -6778,18 +6765,26 @@ class VMAXMaskingTest(test.TestCase):
|
|||
exception.VolumeBackendAPIException,
|
||||
self.driver_fc.masking.find_initiator_names, connector)
|
||||
|
||||
def test_find_initiator_group(self):
|
||||
def test_find_initiator_group_found(self):
|
||||
with mock.patch.object(
|
||||
rest.VMAXRest, 'get_in_use_initiator_list_from_array',
|
||||
rest.VMAXRest, 'get_initiator_list',
|
||||
return_value=self.data.initiator_list[2]['initiatorId']):
|
||||
with mock.patch.object(
|
||||
rest.VMAXRest, 'get_initiator_group_from_initiator',
|
||||
rest.VMAXRest, 'get_initiator_group_from_initiator',
|
||||
return_value=self.data.initiator_list):
|
||||
found_init_group_nam = (
|
||||
self.driver.masking._find_initiator_group(
|
||||
self.data.array, ['FA-1D:4:123456789012345']))
|
||||
self.assertEqual(self.data.initiator_list,
|
||||
found_init_group_nam)
|
||||
|
||||
def test_find_initiator_group_not_found(self):
|
||||
with mock.patch.object(
|
||||
rest.VMAXRest, 'get_initiator_list',
|
||||
return_value=self.data.initiator_list[2]['initiatorId']):
|
||||
with mock.patch.object(
|
||||
rest.VMAXRest, 'get_initiator_group_from_initiator',
|
||||
return_value=None):
|
||||
found_init_group_nam = (
|
||||
self.driver.masking._find_initiator_group(
|
||||
self.data.array, ['Error']))
|
||||
|
|
|
@ -532,7 +532,7 @@ class VMAXCommon(object):
|
|||
async_grp = None
|
||||
LOG.info("Unmap volume: %(volume)s.", {'volume': volume})
|
||||
if connector is not None:
|
||||
host = connector['host']
|
||||
host = self.utils.get_host_short_name(connector['host'])
|
||||
attachment_list = volume.volume_attachment
|
||||
LOG.debug("Volume attachment list: %(atl)s. "
|
||||
"Attachment type: %(at)s",
|
||||
|
|
|
@ -98,9 +98,11 @@ class VMAXFCDriver(san.SanDriver, driver.FibreChannelDriver):
|
|||
- Fix for SSL verification/cert application (bug #1772924)
|
||||
- Log VMAX metadata of a volume (bp vmax-metadata)
|
||||
- Fix for get-pools command (bug #1784856)
|
||||
3.3.0 - Fix for initiator retrieval and short hostname unmapping
|
||||
(bugs #1783855 #1783867)
|
||||
"""
|
||||
|
||||
VERSION = "3.2.0"
|
||||
VERSION = "3.3.0"
|
||||
|
||||
# ThirdPartySystems wiki
|
||||
CI_WIKI_NAME = "EMC_VMAX_CI"
|
||||
|
@ -309,7 +311,7 @@ class VMAXFCDriver(san.SanDriver, driver.FibreChannelDriver):
|
|||
"""
|
||||
loc = volume.provider_location
|
||||
name = ast.literal_eval(loc)
|
||||
host = connector['host']
|
||||
host = self.common.utils.get_host_short_name(connector['host'])
|
||||
zoning_mappings = {}
|
||||
try:
|
||||
array = name['array']
|
||||
|
|
|
@ -103,9 +103,11 @@ class VMAXISCSIDriver(san.SanISCSIDriver):
|
|||
- Fix for SSL verification/cert application (bug #1772924)
|
||||
- Log VMAX metadata of a volume (bp vmax-metadata)
|
||||
- Fix for get-pools command (bug #1784856)
|
||||
3.3.0 - Fix for initiator retrieval and short hostname unmapping
|
||||
(bugs #1783855 #1783867)
|
||||
"""
|
||||
|
||||
VERSION = "3.2.0"
|
||||
VERSION = "3.3.0"
|
||||
|
||||
# ThirdPartySystems wiki
|
||||
CI_WIKI_NAME = "EMC_VMAX_CI"
|
||||
|
|
|
@ -788,10 +788,9 @@ class VMAXMasking(object):
|
|||
:returns: initiator group name -- string or None
|
||||
"""
|
||||
ig_name = None
|
||||
init_list = self.rest.get_in_use_initiator_list_from_array(
|
||||
serial_number)
|
||||
for initiator in initiator_names:
|
||||
found_init = [init for init in init_list if initiator in init]
|
||||
params = {'initiator_hba': initiator.lower()}
|
||||
found_init = self.rest.get_initiator_list(serial_number, params)
|
||||
if found_init:
|
||||
ig_name = self.rest.get_initiator_group_from_initiator(
|
||||
serial_number, found_init[0])
|
||||
|
|
|
@ -1339,17 +1339,6 @@ class VMAXRest(object):
|
|||
init_list = []
|
||||
return init_list
|
||||
|
||||
def get_in_use_initiator_list_from_array(self, array):
|
||||
"""Get the list of initiators which are in-use from the array.
|
||||
|
||||
Gets the list of initiators from the array which are in
|
||||
hosts/ initiator groups.
|
||||
:param array: the array serial number
|
||||
:returns: init_list
|
||||
"""
|
||||
params = {'in_a_host': 'true'}
|
||||
return self.get_initiator_list(array, params)
|
||||
|
||||
def get_initiator_group_from_initiator(self, array, initiator):
|
||||
"""Given an initiator, get its corresponding initiator group, if any.
|
||||
|
||||
|
|
Loading…
Reference in New Issue