ONTAP Rest API Discussions
ONTAP Rest API Discussions
Hi all,
We have an interesting case here where some volumes' relationships are not listed in snapmirror list-destinations REST api.
However, these volumes' relationships are clearly visible and present in both ontap console and REST api CLI passthru as described below.
The problematic volume used in this case is SL10248 but there are more. Our ontap is NetApp Release 9.7P13: Thu Apr 15 02:06:46 UTC 2021
Check the SL10248 relationships using ontap CLI, observe two relationships present
con-svm-201::> snapmirror list-destinations -source-volume SL10248 -instance
Source Path: con-svm-201:SL10248
Destination Path: con-svm-201_SVMDR:SL10248
Relationship Type: XDP
Relationship Group Type: vserver
SnapMirror Policy Type: async-mirror
Relationship Status: Idle
Transfer Progress: -
Progress Last Updated: -
Source Volume Node: con-stor-02
Relationship ID: 32747509-db36-11eb-b628-00a098997ee7
Source Path: con-svm-201:SL10248
Destination Path: rt1aae:SL10248
Relationship Type: DP
Relationship Group Type: none
SnapMirror Policy Type: async-mirror
Relationship Status: Idle
Transfer Progress: -
Progress Last Updated: -
Source Volume Node: con-stor-02
Relationship ID: fa107abb-aab8-11e7-9c1c-00a098b72ab5
2 entries were displayed.
con-svm-201::>
Check the SL10248 relationships using REST API CLI passtgrough. Observe two relationships present, same as above:
simacr@simacr-linux:~$ curl --insecure --user user:pass "https://con-svm-201/api/private/cli/snapmirror/list-destinations?source-volume=SL10248&fields=relationship_id"
{
"records": [
{
"source_path": "con-svm-201:SL10248",
"source_vserver": "con-svm-201",
"source_volume": "SL10248",
"destination_path": "con-svm-201_SVMDR:SL10248",
"destination_vserver": "con-svm-201_SVMDR",
"destination_volume": "SL10248",
"relationship_id": "32747509-db36-11eb-b628-00a098997ee7"
},
{
"source_path": "con-svm-201:SL10248",
"source_vserver": "con-svm-201",
"source_volume": "SL10248",
"destination_path": "rt1aae:SL10248",
"destination_vserver": "rt1aae",
"destination_volume": "SL10248",
"relationship_id": "fa107abb-aab8-11e7-9c1c-00a098b72ab5"
}
],
"num_records": 2
}simacr@simacr-linux:~$
Check the snapmirror relationships using proper REST API call. List all relationships to avoid filtering ambiguities. Redirect to file due to size. Grep the output for SL10248 AND by UUID to confirm the missing relationships. Show the output sample to prove the output contains valid data, but incomplete regarding SL10248:
simacr@simacr-linux:~$ curl --insecure --user user:pass "https://con-svm-201/api/snapmirror/relationships/?list_destinations_only=true&fields=source" >o
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 137k 0 137k 0 0 9628 0 --:--:-- 0:00:14 --:--:-- 9869
simacr@simacr-linux:~$ grep SL10248 o
simacr@simacr-linux:~$grep 32747509-db36-11eb-b628-00a098997ee7 o
simacr@simacr-linux:~$ grep fa107abb-aab8-11e7-9c1c-00a098b72ab5 o
simacr@simacr-linux:~$ more o
{
"records": [
{
"uuid": "000e6732-d8a1-11e9-8b45-00a098b98617",
"source": {
"path": "con-svm-201:SL10573",
"svm": {
"uuid": "73b41add-0450-11e7-a1f7-00a09876f5a4",
"name": "con-svm-201",
"_links": {
"self": {
"href": "/api/svm/svms/73b41add-0450-11e7-a1f7-00a09876f5a4"
}
}
}
},
"_links": {
"self": {
"href": "/api/snapmirror/relationships/000e6732-d8a1-11e9-8b45-00a098b98617/?list_destinations_only=true"
}
}
},
{
"uuid": "0017b348-5cab-11ea-ab11-00a098efcbcb",
"source": {
"path": "con-svm-201:SL10280",
"svm": {
"uuid": "73b41add-0450-11e7-a1f7-00a09876f5a4",
"name": "con-svm-201",
"_links": {
"self": {
"href": "/api/svm/svms/73b41add-0450-11e7-a1f7-00a09876f5a4"
}
}
}
},
"_links": {
"self": {
"href": "/api/snapmirror/relationships/0017b348-5cab-11ea-ab11-00a098efcbcb/?list_destinations_only=true"
}
}
},
...
I am not an expert on REST API, but just had a glance at the REST API call you shared,
curl --insecure --user user:pass "https://con-svm-201/api/snapmirror/relationships/?list_destinations_only=true&fields=source"
For fields, should it contain:
fields=destination,source
Instead of just - fields=source (In your script) ?
I only specified 'source' to ensure brevity of the output. The absence or presence of fields specified does not affect the problem of missing volume which I tried to point to here. Ultimate search for missing volume relationships is done by source AND by uuid and none was found.