Dell PowerMax: Added exception handling after
the masking view REST call. Added exception handling after the masking view REST call to retry fetching the host lunid if it is not returned by the REST call Updated the retry count based on trial and error. The maximum observed retries reached the 8th attempt, so we have set it to 8 retries. Closes-Bug: #2081742 Change-Id: I9e8e5f38c8ab8804c5e7ae4ad5e0f650768e93c3
This commit is contained in:
parent
774d784aca
commit
c05d12875f
@ -869,10 +869,10 @@ class PowerMaxRestTest(test.TestCase):
|
|||||||
def test_find_mv_connections_for_vol_missing_host_lun_address(self):
|
def test_find_mv_connections_for_vol_missing_host_lun_address(self):
|
||||||
with mock.patch.object(self.rest, 'get_resource',
|
with mock.patch.object(self.rest, 'get_resource',
|
||||||
return_value=self.data.maskingview_no_lun):
|
return_value=self.data.maskingview_no_lun):
|
||||||
host_lun_id = self.rest.find_mv_connections_for_vol(
|
self.assertRaises(exception.VolumeBackendAPIException,
|
||||||
self.data.array, self.data.masking_view_name_f,
|
self.rest.find_mv_connections_for_vol,
|
||||||
self.data.device_id)
|
self.data.array, self.data.masking_view_name_f,
|
||||||
self.assertIsNone(host_lun_id)
|
self.data.device_id)
|
||||||
|
|
||||||
def test_find_mv_connections_for_vol_failed(self):
|
def test_find_mv_connections_for_vol_failed(self):
|
||||||
# no masking view info retrieved
|
# no masking view info retrieved
|
||||||
@ -883,9 +883,10 @@ class PowerMaxRestTest(test.TestCase):
|
|||||||
# no connection info received
|
# no connection info received
|
||||||
with mock.patch.object(self.rest, 'get_resource',
|
with mock.patch.object(self.rest, 'get_resource',
|
||||||
return_value={'no_conn': 'no_info'}):
|
return_value={'no_conn': 'no_info'}):
|
||||||
host_lun_id2 = self.rest.find_mv_connections_for_vol(
|
self.assertRaises(exception.VolumeBackendAPIException,
|
||||||
self.data.array, self.data.masking_view_name_f, device_id)
|
self.rest.find_mv_connections_for_vol,
|
||||||
self.assertIsNone(host_lun_id2)
|
self.data.array, self.data.masking_view_name_f,
|
||||||
|
self.data.device_id)
|
||||||
|
|
||||||
def test_get_storage_groups_from_volume(self):
|
def test_get_storage_groups_from_volume(self):
|
||||||
array = self.data.array
|
array = self.data.array
|
||||||
|
@ -1621,7 +1621,7 @@ class PowerMaxRest(object):
|
|||||||
self.delete_resource(array, SLOPROVISIONING,
|
self.delete_resource(array, SLOPROVISIONING,
|
||||||
"volume", device_id)
|
"volume", device_id)
|
||||||
|
|
||||||
@retry(retry_exc_tuple, interval=2, retries=3)
|
@retry(retry_exc_tuple, interval=2, retries=8)
|
||||||
def find_mv_connections_for_vol(self, array, maskingview, device_id):
|
def find_mv_connections_for_vol(self, array, maskingview, device_id):
|
||||||
"""Find the host_lun_id for a volume in a masking view.
|
"""Find the host_lun_id for a volume in a masking view.
|
||||||
|
|
||||||
@ -1644,28 +1644,42 @@ class PowerMaxRest(object):
|
|||||||
try:
|
try:
|
||||||
masking_view_conn = connection_info.get(
|
masking_view_conn = connection_info.get(
|
||||||
'maskingViewConnection')
|
'maskingViewConnection')
|
||||||
if masking_view_conn and isinstance(
|
if (masking_view_conn and isinstance(
|
||||||
masking_view_conn, list):
|
masking_view_conn, list) and
|
||||||
|
len(masking_view_conn) > 0):
|
||||||
host_lun_id = masking_view_conn[0].get(
|
host_lun_id = masking_view_conn[0].get(
|
||||||
'host_lun_address')
|
'host_lun_address')
|
||||||
if host_lun_id:
|
if host_lun_id:
|
||||||
host_lun_id = int(host_lun_id, 16)
|
host_lun_id = int(host_lun_id, 16)
|
||||||
else:
|
else:
|
||||||
exception_message = (
|
exception_message = (_("Unable to get "
|
||||||
_('Unable to get host_lun_address for '
|
"host_lun_address for device "
|
||||||
'device %(dev)s on masking view %(mv)s. '
|
"%(dev)s on masking view "
|
||||||
'Retrying...')
|
"%(mv)s. Retrying...")
|
||||||
% {'dev': device_id, 'mv': maskingview})
|
% {"dev": device_id,
|
||||||
|
"mv": maskingview})
|
||||||
LOG.warning(exception_message)
|
LOG.warning(exception_message)
|
||||||
raise exception.VolumeBackendAPIException(
|
raise exception.VolumeBackendAPIException(
|
||||||
message=exception_message)
|
message=exception_message)
|
||||||
|
else:
|
||||||
|
exception_message = (_("Unable to retrieve connection "
|
||||||
|
"information for volume %(vol)s "
|
||||||
|
"in masking view %(mv)s. "
|
||||||
|
"Retrying...")
|
||||||
|
% {"vol": device_id,
|
||||||
|
"mv": maskingview})
|
||||||
|
LOG.warning(exception_message)
|
||||||
|
raise exception.VolumeBackendAPIException(
|
||||||
|
message=exception_message)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
exception_message = (
|
exception_message = (_("Unable to retrieve connection "
|
||||||
_("Unable to retrieve connection information "
|
"information for volume %(vol)s "
|
||||||
"for volume %(vol)s in masking view %(mv)s. "
|
"in masking view %(mv)s. "
|
||||||
"Exception received: %(e)s. Retrying...")
|
"Exception received: %(e)s. "
|
||||||
% {'vol': device_id, 'mv': maskingview,
|
"Retrying...")
|
||||||
'e': e})
|
% {"vol": device_id,
|
||||||
|
"mv": maskingview,
|
||||||
|
"e": e})
|
||||||
LOG.warning(exception_message)
|
LOG.warning(exception_message)
|
||||||
raise exception.VolumeBackendAPIException(
|
raise exception.VolumeBackendAPIException(
|
||||||
message=exception_message)
|
message=exception_message)
|
||||||
|
@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
Dell PowerMax Driver `bug #2081742
|
||||||
|
<https://bugs.launchpad.net/cinder/+bug/2081742>`_: The REST
|
||||||
|
API calls for the masking view connection do not return
|
||||||
|
the HostLUN ID immediately. To address this, an exception
|
||||||
|
has been added to implement a retry mechanism.
|
Loading…
x
Reference in New Issue
Block a user