Merge "[Pure Storage] Disable management of secure tenant volumes and snaps"
This commit is contained in:
@@ -1676,6 +1676,10 @@ class PureBaseVolumeDriver(san.SanDriver):
|
|||||||
" key to identify an existing volume."))
|
" key to identify an existing volume."))
|
||||||
|
|
||||||
if is_snap:
|
if is_snap:
|
||||||
|
if existing_ref['source-name'].count("::") > 1:
|
||||||
|
# Don't allow for managing snaphot in a realm
|
||||||
|
raise exception.ManageExistingInvalidReference(
|
||||||
|
_("Unable to manage snapshot in a Realm"))
|
||||||
# Purity snapshot names are prefixed with the source volume name.
|
# Purity snapshot names are prefixed with the source volume name.
|
||||||
ref_vol_name, ref_snap_suffix = existing_ref['source-name'].split(
|
ref_vol_name, ref_snap_suffix = existing_ref['source-name'].split(
|
||||||
'.')
|
'.')
|
||||||
@@ -1683,6 +1687,10 @@ class PureBaseVolumeDriver(san.SanDriver):
|
|||||||
ref_vol_name = existing_ref['source-name']
|
ref_vol_name = existing_ref['source-name']
|
||||||
|
|
||||||
current_array = self._get_current_array()
|
current_array = self._get_current_array()
|
||||||
|
if not is_snap and self._realm_check(current_array, ref_vol_name):
|
||||||
|
# Don't allow for managing volumes in a realm
|
||||||
|
raise exception.ManageExistingInvalidReference(
|
||||||
|
_("Unable to manage volume in a Realm"))
|
||||||
if not is_snap and self._pod_check(current_array, ref_vol_name):
|
if not is_snap and self._pod_check(current_array, ref_vol_name):
|
||||||
# Don't allow for managing volumes in a replicated pod
|
# Don't allow for managing volumes in a replicated pod
|
||||||
raise exception.ManageExistingInvalidReference(
|
raise exception.ManageExistingInvalidReference(
|
||||||
@@ -1992,6 +2000,9 @@ class PureBaseVolumeDriver(san.SanDriver):
|
|||||||
def _pod_check(self, array, volume):
|
def _pod_check(self, array, volume):
|
||||||
"""Check if volume is in a replicated pod."""
|
"""Check if volume is in a replicated pod."""
|
||||||
if "::" in volume:
|
if "::" in volume:
|
||||||
|
if volume.count("::") != 1:
|
||||||
|
# This is a special for a volume in a realm pod
|
||||||
|
return False
|
||||||
pod = volume.split("::")[0]
|
pod = volume.split("::")[0]
|
||||||
pod_info = list(array.get_pods(names=[pod]).items)[0]
|
pod_info = list(array.get_pods(names=[pod]).items)[0]
|
||||||
if (pod_info.link_source_count == 0
|
if (pod_info.link_source_count == 0
|
||||||
@@ -2003,6 +2014,16 @@ class PureBaseVolumeDriver(san.SanDriver):
|
|||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def _realm_check(self, array, volume):
|
||||||
|
"""Check if volume is in a realm."""
|
||||||
|
if "::" in volume:
|
||||||
|
if volume.count("::") > 1:
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
def _rename_volume_object(self,
|
def _rename_volume_object(self,
|
||||||
old_name,
|
old_name,
|
||||||
new_name,
|
new_name,
|
||||||
@@ -2184,6 +2205,7 @@ class PureBaseVolumeDriver(san.SanDriver):
|
|||||||
cinder_id = existing_vols.get(vol_name)
|
cinder_id = existing_vols.get(vol_name)
|
||||||
not_safe_msgs = []
|
not_safe_msgs = []
|
||||||
host = connected_vols.get(vol_name)
|
host = connected_vols.get(vol_name)
|
||||||
|
in_realm = self._realm_check(array, vol_name)
|
||||||
in_pod = self._pod_check(array, vol_name)
|
in_pod = self._pod_check(array, vol_name)
|
||||||
is_deleted = pure_vols[pure_vol].destroyed
|
is_deleted = pure_vols[pure_vol].destroyed
|
||||||
|
|
||||||
@@ -2193,6 +2215,9 @@ class PureBaseVolumeDriver(san.SanDriver):
|
|||||||
if cinder_id:
|
if cinder_id:
|
||||||
not_safe_msgs.append(_('Volume already managed'))
|
not_safe_msgs.append(_('Volume already managed'))
|
||||||
|
|
||||||
|
if in_realm:
|
||||||
|
not_safe_msgs.append(_('Volume is in a Realm'))
|
||||||
|
|
||||||
if in_pod:
|
if in_pod:
|
||||||
not_safe_msgs.append(_('Volume is in a Replicated Pod'))
|
not_safe_msgs.append(_('Volume is in a Replicated Pod'))
|
||||||
|
|
||||||
@@ -2248,6 +2273,10 @@ class PureBaseVolumeDriver(san.SanDriver):
|
|||||||
is_safe = False
|
is_safe = False
|
||||||
reason_not_safe = _("Snapshot is deleted.")
|
reason_not_safe = _("Snapshot is deleted.")
|
||||||
|
|
||||||
|
if snap_name.count("::") > 1:
|
||||||
|
is_safe = False
|
||||||
|
reason_not_safe = _("Snapshot is in a realm.")
|
||||||
|
|
||||||
manageable_snaps.append({
|
manageable_snaps.append({
|
||||||
'reference': {'name': snap_name},
|
'reference': {'name': snap_name},
|
||||||
'size': self._round_bytes_to_gib(
|
'size': self._round_bytes_to_gib(
|
||||||
|
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
Pure Storage driver: Fixed issue with FlashArray secure tenant volumes and
|
||||||
|
snapshots as theese are not eligible to be managed.
|
Reference in New Issue
Block a user