Software Development Kit (SDK) and API Discussions

ZAPI/filer command to lock/unlock a snapshot


I work on a remote backup application which accesses snapshots accessed via file sharing (CIFS shares on Windows, NFS mounts on non-Windows).

The problem I have is that is it possible to for snapshots to be deleted or renamed while my remote application is accessing the snapshot.

My application accesses the snapshot thru file sharing and has an authenticated session with the filer thru the ZAPI.

I need a mechanism (preferably a ZAPI call) to lock a specified snapshot while my application is accessing it and to unlock it when it is done.

Basically the mechanism need to prevent be able to prevent the snapshot from being deleted or renamed while while the lock is in place.

Any advice would be greatly appreciated....

Pete Tanenhaus

IBM Tivoli Storage Manager Client Development



Hi Pete,

     The easiest way is simply going to be to rename the snapshot while you are using it.  ONTAP will not automatically delete any snapshot that has been manually created or renamed.  In the API that is under snapshot > snapshot-rename.  After you are done, you would then have to delete the snapshot manually, that is the only downside.  I see to recall having some success in changing the snapshot name back to the original and the auto-cleanup working, but I wouldn't be able to verify that for a few hours.

- Scott


I have verified:

rename hourly.23 to scott-test

wait one hour for snaps to occur, hourly.22 now becomes hourly.23

rename scott-test to hourly.24 (which should never exist)

wiat one hour --> hourly.23 rolls off properly and hourly.24 is removed because it follows the default naming convention.

This means you could capture the name via the API, rename the snap via the API to something it won't delete, then rename to something in the default naming and let the system clean it up on the next pass.