[NetApp] check snapshot presence after creation

Introduce some extra safety by an additional guard.
Losing a snapshot is never an option, this justifies an
additional api call to the NetApp storage back end.

Change-Id: Ibc21b6c72d76a3a804f67e66e7604b3d0be4373f
Related-Bug: #1971710
This commit is contained in:
Maurice Escher 2022-05-05 16:01:59 +02:00 committed by Kiran Pawar
parent 4408ec4f7c
commit f95cb40ee3
2 changed files with 13 additions and 0 deletions

View File

@ -1750,6 +1750,10 @@ class NetAppCmodeFileStorageLibrary(object):
snapshot_name = self._get_backend_snapshot_name(snapshot['id'])
LOG.debug('Creating snapshot %s', snapshot_name)
vserver_client.create_snapshot(share_name, snapshot_name)
if not vserver_client.snapshot_exists(snapshot_name, share_name):
raise exception.SnapshotResourceNotFound(
name=snapshot_name)
return {'provider_location': snapshot_name}
def revert_to_snapshot(self, context, snapshot, share_server=None):

View File

@ -0,0 +1,9 @@
---
fixes:
- |
NetApp driver now checks after sending snapshot-create request that the
snapshot has been properly created. If snapshot is not checked, manila
assumes that working snapshot is available. But when user tries to access
the snapshot, request could fail.
`Launchpad bug 1971710 <https://bugs.launchpad.net/manila/+bug/1971710>`_
for more details.