Skip to content

Commit

Permalink
Fix prune deleted volumes for clones
Browse files Browse the repository at this point in the history
During prune deleted volumes option, if volume is offline, manila calls
for ONTAP volume-destroy API. However if volume has one or more clones,
the destroy operation fails. So upon receving clone related error, check
clone spilt status and if not started, start it.
  • Loading branch information
kpawar-sap authored and Carthaca committed Apr 26, 2024
1 parent f3a6fcd commit 0a721dd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion manila/share/drivers/netapp/dataontap/client/client_cmode.py
Original file line number Diff line number Diff line change
Expand Up @@ -3963,9 +3963,14 @@ def prune_deleted_volumes(self):
try:
client.send_request(
'volume-destroy', {'name': volume_name})
except netapp_api.NaApiError:
except netapp_api.NaApiError as e:
LOG.error(
'Pruning soft-deleted volume %s failed', volume_name)
if e.code == netapp_api.EVOLDEL_NOT_ALLOW_BY_CLONE:
if self.volume_clone_split_status(volume_name) != 100:
self.volume_clone_split_start(volume_name)
LOG.debug('Starting clone split for '
'volume %s ', volume_name)

@na_utils.trace
def create_snapshot(self, volume_name, snapshot_name):
Expand Down

0 comments on commit 0a721dd

Please sign in to comment.