ONTAP Rest API Discussions

Configure Snapmirror via NetApp Rest API

hojun
1,240 Views

Dear, all
I have configured Snapmirror via Ontap API.
After that, we try to execute the Break and quiesce commands through PATCH.
The job was performed normally and succeeded, but when checked in Cluster Shell,
The state does not change to the Broken-off state.

 

TEST environment :
System : Lab on demand Ontap 9.7 Version
Client : Lab on deamnd Linux(rhel) 7.7 Version

 

<Snapmirror break>
[root@rhel1 /]# curl -siku admin:Netapp1! -X PATCH "https://192.168.0.113/api/snapmirror/relationships/2dcea3bf-8af0-11ec-a746-005056b7e780" '{"state":"broken_off"}' -H "accept: application/hal+json"
HTTP/1.1 202 Accepted
Date: Sun, 13 Feb 2022 13:06:45 GMT
Server: libzapid-httpd
X-Content-Type-Options: nosniff
Cache-Control: no-cache,no-store,must-revalidate
Content-Length: 189
Content-Type: application/hal+json

{
"job": {
"uuid": "cbdec1f4-8ccd-11ec-a746-005056b7e780",   //job uuid create
"_links": {
"self": {
"href": "/api/cluster/jobs/cbdec1f4-8ccd-11ec-a746-005056b7e780"
}
}
}


<Snapmirror status>
cluster2::*> snapmirror show
Progress
Source Destination Mirror Relationship Total Last
Path Type Path State Status Progress Healthy Updated
----------- ---- ------------ ------- -------------- --------- ------- --------
svm1:vol1 XDP svm2:drvol1 Snapmirrored                     // State : Snapmirored
Idle - true -

 

<Job Status>
[root@rhel1 /]# curl -siku admin:Netapp1! -X GET "https://192.168.0.113/api/cluster/jobs/cbdec1f4-8ccd-11ec-a746-005056b7e780" -H "accept: application/hal+json"
HTTP/1.1 200 OK
Date: Sun, 13 Feb 2022 13:09:39 GMT
Server: libzapid-httpd
X-Content-Type-Options: nosniff
Cache-Control: no-cache,no-store,must-revalidate
Content-Length: 402
Content-Type: application/hal+json

{
"uuid": "cbdec1f4-8ccd-11ec-a746-005056b7e780",
"description": "PATCH /api/snapmirror/relationships/2dcea3bf-8af0-11ec-a746-005056b7e780",
"state": "success",
"message": "success",
"code": 0,
"start_time": "2022-02-13T13:06:45+00:00",
"end_time": "2022-02-13T13:06:45+00:00",
"_links": {
"self": {
"href": "/api/cluster/jobs/cbdec1f4-8ccd-11ec-a746-005056b7e780"
}
}

 

 

As above, the JOB succeeds, but does not change to Broken-off state.
Are there any resources that can help?
Also, please tell me how to check Transfer.uuid

 

Thank you.
have a good day.

 

 

 

1 REPLY 1

RobertBlackhart
1,223 Views

ONTAP 9.8 added a ?force=true option to the PATCH API when setting the state to broken_off. The documentation says this is to bypass any validation errors that might occur. However, I would have expected to see something in the job status if there were problems. Is your current test system the only one where the issue occurs? Are you able to upgrade it to a later version of ONTAP and if so, does the problem still occur? If this isn't an option for you, then you may want to contact support with a ticket and have them examine your logs or other system state to see why there is no error but the state isn't changing.

 

Checking the transfer status would be done using the /api/snapmirror/relatinoships/{relationship.uuid}/transfers endpoint. This would show any ongoing transfers as well as those that have completed within the last 24 hours.

Public