[Pure Storage] Fix connection issue on network failure.

Retry the login process if a network issue has caused the connection to
the FlashBlade to fail.

Use the periodic task to update share stats to catch this.

Closes-bug: #2032681
Change-Id: Ic4be90aba729978e24bdd808ba1130d05aed9985
This commit is contained in:
Simon Dodsley 2023-08-25 10:40:49 -04:00
parent aafc221027
commit 279b8e2861
2 changed files with 19 additions and 1 deletions

View File

@ -197,6 +197,18 @@ class FlashBladeShareDriver(driver.ShareDriver):
super(FlashBladeShareDriver, self)._update_share_stats(data)
def _get_available_capacity(self):
try:
space = self._sys.arrays.list_arrays_space()
except purity_fb.rest.ApiException:
message = "Connection failure. Retrying login..."
LOG.warning(message)
try:
self._sys.login(self.api)
self._sys._api_client.user_agent = self._user_agent
except purity_fb.rest.ApiException as ex:
msg = _("Exception when logging into the array: %s\n") % ex
LOG.exception(msg)
raise exception.ManilaException(message=msg)
space = self._sys.arrays.list_arrays_space()
array_space = space.items[0]
data_reduction = array_space.space.data_reduction

View File

@ -0,0 +1,6 @@
---
fixes:
- |
Pure Storage FlashBlade driver: Retry login for periodic task should
network issue cause loss of connection. See `launchpad bug 2032681
<https://bugs.launchpad.net/manila/+bug/2032681>`_ for more details.