In a special use case, one of our customer needs that snapshots created with snapshot-create API call are usable to create a CIFS share in the snapshot namespace.
However, from time to time (right after snapshot creation), the share creation fails with the error :
The specified path "/vol/xxxxxxx/.snapshot/testsharertv/xxxxxx/yyyy/zzzzzz" does not exist in the namespace belonging to Vserver "xxxxxxx".
The snapshot-create API call has the value 'async' set to false, but the share creation fails when issued right after the snapshot creation, and 1-2 retries later (1-2 secs apart) eventually passes.
I've tried to check the state of the created snapshots using snapshot-list-info/snapshot-get-iter, but there's no information returned by the API that would match the output of the diag snap status command (creating/complete/deleting status).
Is there some way to make sure a newly created snapshot can be used as a path for a CIFS share?
Does the share created from the snapshot have to be available immediately, or is 3-5 seconds of delay acceptable? If it is acceptable, then why not just put a brief sleep into the script? Or, use a try/catch statement to test the operation until it succeeds or exceeds some threshold.
If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.