Software Development Kit (SDK) and API Discussions

Snapmirror Release trought API (SLM)

lcoppitelli
2,667 Views

Hi,

 

I'm tring to automate the deletion of a Volume and the related snapmirror relationship trough ontap2.0 apis in SLM.

 

i'm able to delete the snapmirror relationship on the destination volume, but usually, doing so from the GUI, you have the options to also release the snapmirror rerlationship on the source volume:

 

2017-02-24_11-36-08.jpg

 

While working on ontap APIs, there dosen't seem to be any snapmirror-release related call, therefore i'm unable to delete the source voume since it gives me an error stating that the volume is part of an un-released snapmirror relationship.

 

any idea on how to release a SM relationship?

2 REPLIES 2

lcoppitelli
2,657 Views

Here is the error i get after trying to DELETE the volume:

 

{
  "status": {
    "code": "SUCCESS"
  },
  "result": {
    "total_records": 1,
    "records": [
      {
        "key": "d9e35287-2f48-4fac-ad9f-b18c05757447",
        "parent_job_key": null,
        "owner": "api",
        "resource_name": "Volume",
        "status": "FAILED",
        "start_time": 1487934948061,
        "end_time": 1487934948237,
        "error_code": 4702,
        "error_message": "Volume voltestsm in Vserver ITNAPPOCSVMVM01 is the source endpoint of one or more SnapMirror relationships. Before you delete the volume, you must release the source information of the SnapMirror relationships using snapmirror release. To display the destinations to be used in the snapmirror release commands, use the snapmirror list-destinations -source-vserver ITNAPPOCSVMVM01 -source-volume voltestsm command. (errno=18436)",
        "request_method": "delete",
        "request_uri": "https://10.160.30.49:8443/api/2.0/ontap/volumes/f1d6062e-9374-40ed-97d7-63c0ad5ae012:type=volume,uuid=96a24105-2a82-43ab-ab7b-4c44700a6956"
      }
    ]
  }
}

 

and none of the calls available seems to be able to RELEASE the relationship:

 

 

    get /ontap/snap-mirrors
        Retrieve all the snap-mirrors

    post /ontap/snap-mirrors
        Creates snap-mirrors

    get /ontap/snap-mirrors/{key}
        Retrieve the specified snap-mirror

    delete /ontap/snap-mirrors/{key}
        Deletes snap-mirrors

    put /ontap/snap-mirrors/{key}
        Modifies snap-mirrors

    get /ontap/snap-mirrors/{key}/events
        Retrieve all the events of specified snap-mirror

    post /ontap/snap-mirrors/{key}/jobs/restore
        SnapMirrorRestore job

    post /ontap/snap-mirrors/{key}/jobs/resume
        SnapMirrorResume job

    post /ontap/snap-mirrors/{key}/jobs/initialize
        SnapMirrorInitialize job

    post /ontap/snap-mirrors/{key}/jobs/quiesce
        SnapMirrorQuiesce job

    post /ontap/snap-mirrors/{key}/jobs/promote
        SnapMirrorPromote job

    post /ontap/snap-mirrors/{key}/jobs/resync
        SnapMirrorResync job

    post /ontap/snap-mirrors/{key}/jobs/update
        SnapMirrorUpdate job

    post /ontap/snap-mirrors/{key}/jobs/abort
        SnapMirrorAbort job

    post /ontap/snap-mirrors/{key}/jobs/break
        SnapMirrorBreak job

sens
2,631 Views

Hi Lorenzo,

 

SLM internally performs the snapmirror release operation (in addition to performing snapmirror delete) when you invoke DELETE /ontap/snap-mirrors/{snap-mirror-key} API.

So, instead of deleting the snap-mirror out of band using GUI, we recommend you to use the SLM API mentioned above.

 

For the current source volume which is tied to an unreleased but deleted snapmirror, you will need to use ONTAP CLI to release the snapmirror.

Please let us know if you need further details on this.

 

 

Regards,

Sen.

Public