Create a SnapMirror relationship
POST /snapmirror/relationships
Creates a SnapMirror relationship. This API must be executed on the cluster containing the destination endpoint.
Required properties
-
source.path
- Path to the source endpoint of the SnapMirror relationship. -
destination.path
- Path to the destination endpoint of the SnapMirror relationship.
Recommended optional properties
-
policy.name
orpolicy.uuid
- Policy governing the SnapMirror relationship.
Default property values
If not specified in POST, the following default property values are assigned:
-
policy.name
- MirrorAndVault -
restore
- false
Related ONTAP commands
-
snapmirror create
Examples
The following examples show how to create FlexVol, FlexGroup and SVM SnapMirror relationships. Note that the source SVM name should be the local name of the peer SVM.
Creating a FlexVol SnapMirror relationship of type XDP.
POST "/api/snapmirror/relationships/" '{"source": {"path": "test_vserv_src:src_vol_rw"}, "destination": { "path": "test_vserv_dst:dst_vol_rw"}}'
Creating a FlexGroup SnapMirror relationship of type XDP.
POST "/api/snapmirror/relationships/" '{"source": {"path": "test_vserv_src:source_flexgrp"}, "destination": { "path": "test_vserv_dst:dest_flexgrp"}}'
Creating a SVM SnapMirror relationship of type XDP.
POST "/api/snapmirror/relationships/" '{"source": { "path": "src_svm:"}, "destination": { "path": "dst_svm:"}}'
Creating a SnapMirror relationship in order to restore from a destination.
POST "/api/snapmirror/relationships/" '{"source": {"path": "test_vserv_src:src_vol_rw"}, "destination": { "path": "test_vserv_dst:dst_vol_rw"}, "restore": "true"}'
Learn more
Parameters
Name | Type | In | Required | Description |
---|---|---|---|---|
return_timeout |
integer |
query |
False |
The number of seconds to allow the call to execute before returning. When doing a POST, PATCH, or DELETE operation on a single record, the default is 0 seconds. This means that if an asynchronous operation is started, the server immediately returns HTTP code 202 (Accepted) along with a link to the job. If a non-zero value is specified for POST, PATCH, or DELETE operations, ONTAP waits that length of time to see if the job completes so it can return something other than 202. |
Request Body
Name | Type | Description |
---|---|---|
destination |
Endpoint of a SnapMirror relationship. |
|
exported_snapshot |
string |
Snapshot copy exported to clients on destination. |
healthy |
boolean |
Is the relationship healthy? |
lag_time |
string |
Time since the exported Snapshot copy was created. |
policy |
Basic policy information of the relationship. |
|
preserve |
boolean |
Set to true on resync to preserve Snapshot copies on the destination that are newer than the latest common Snapshot copy. This field is applicable only for relationships with FlexGroup or FlexVol endpoints and when the PATCH state is "snapmirrored". |
quick_resync |
boolean |
Set to true to reduce resync time by not preserving storage efficiency. This field is applicable only for relationships with FlexVol endpoints and when the PATCH state is "snapmirrored". |
recover_after_break |
boolean |
Set to true to recover from a failed SnapMirror break operation on a FlexGroup relationship. This restores all destination FlexGroup constituents to the latest Snapshot copy, and any writes to the read-write constituents are lost. This field is applicable only for SnapMirror relationships with FlexGroup endpoints and when the PATCH state is "broken_off". |
restore |
boolean |
Set to true to create a relationship for restore. To trigger restore-transfer, use transfers POST on the restore relationship. |
restore_to_snapshot |
string |
Specifies the Snapshot copy to restore to on the destination after a break operation. This field is applicable only for SnapMirror relationships with FlexVol endpoints and when the PATCH state is "broken_off". |
source |
Endpoint of a SnapMirror relationship. |
|
state |
string |
State of the relationship. To initialize the relationship, PATCH the state to "snapmirrored". To break the relationship, PATCH the state to "broken_off". To resync the broken relationship, PATCH the state to "snapmirrored" for relationships with async policy type or "in_sync" for relationships with sync policy type. To pause the relationship, suspending further transfers, PATCH the state to "paused". To resume transfers for a paused relationship, PATCH the state to "snapmirrored" or "in_sync". The entries "in_sync", "out_of_sync", and "synchronizing" are only applicable to relationships of the sync policy type. A PATCH call on the state change only triggers the transition to the specified state. You must poll on the "state", "healthy" and "unhealthy_reason" fields using GET to determine if the transition is successful. |
transfer |
Basic information on the current transfer. |
|
unhealthy_reason |
array[snapmirror_error] |
Reason the relationship is not healthy. It is a concatenation of up to four levels of error messages. |
uuid |
string |
Example request
{
"destination": {
"path": "svm1:volume1",
"svm": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "svm1",
"uuid": "02c9e252-41be-11e9-81d5-00a0986138f7"
}
},
"exported_snapshot": "string",
"lag_time": "PT8H35M42S",
"policy": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "MirrorAndVault",
"type": "string",
"uuid": "4ea7a442-86d1-11e0-ae1c-123478563412"
},
"restore_to_snapshot": "string",
"source": {
"path": "svm1:volume1",
"svm": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "svm1",
"uuid": "02c9e252-41be-11e9-81d5-00a0986138f7"
}
},
"state": "string",
"transfer": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"state": "string",
"uuid": "4ea7a442-86d1-11e0-ae1c-123478563412"
},
"unhealthy_reason": [
{
"code": "6621444",
"message": "Failed to complete update operation on one or more item relationships.",
"parameters": []
},
{
"code": "6621445",
"message": "Group Update failed",
"parameters": []
}
],
"uuid": "4ea7a442-86d1-11e0-ae1c-123478563412"
}
Response
Status: 202, Accepted
Name | Type | Description |
---|---|---|
job |
Example response
{
"job": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"uuid": "string"
}
}
Error
Status: Default
ONTAP Error Response codes
Error code | Description |
---|---|
13303841 |
Cross platform relationships are not allowed |
13303821 |
Invalid SnapMirror policy UUID |
13303819 |
Could not retrieve SnapMirror policy information |
13303852 |
destination.path provided does not contain \":\" |
13303853 |
Restore relationships are not supported for SVM-DR endpoints |
Name | Type | Description |
---|---|---|
error |
Example error
{
"error": {
"arguments": [
{
"code": "string",
"message": "string"
}
],
"code": "4",
"message": "entry doesn't exist",
"target": "uuid"
}
}
Definitions
See Definitions
href
Name | Type | Description |
---|---|---|
href |
string |
_links
Name | Type | Description |
---|---|---|
self |
svm
Name | Type | Description |
---|---|---|
_links |
||
name |
string |
The name of the SVM. |
uuid |
string |
The unique identifier of the SVM. |
snapmirror_endpoint
Endpoint of a SnapMirror relationship.
Name | Type | Description |
---|---|---|
path |
string |
ONTAP FlexVol/FlexGroup - svm1:volume1 ONTAP SVM - svm1:
|
svm |
policy
Basic policy information of the relationship.
Name | Type | Description |
---|---|---|
_links |
||
name |
string |
|
type |
string |
|
uuid |
string |
transfer
Basic information on the current transfer.
Name | Type | Description |
---|---|---|
_links |
||
bytes_transferred |
integer |
Bytes transferred. |
state |
string |
|
uuid |
string |
snapmirror_error
SnapMirror error
Name | Type | Description |
---|---|---|
code |
integer |
Error code |
message |
string |
Error message |
parameters |
array[string] |
Parameters for the error message |
snapmirror_relationship
SnapMirror relationship information
Name | Type | Description |
---|---|---|
destination |
Endpoint of a SnapMirror relationship. |
|
exported_snapshot |
string |
Snapshot copy exported to clients on destination. |
healthy |
boolean |
Is the relationship healthy? |
lag_time |
string |
Time since the exported Snapshot copy was created. |
policy |
Basic policy information of the relationship. |
|
preserve |
boolean |
Set to true on resync to preserve Snapshot copies on the destination that are newer than the latest common Snapshot copy. This field is applicable only for relationships with FlexGroup or FlexVol endpoints and when the PATCH state is "snapmirrored". |
quick_resync |
boolean |
Set to true to reduce resync time by not preserving storage efficiency. This field is applicable only for relationships with FlexVol endpoints and when the PATCH state is "snapmirrored". |
recover_after_break |
boolean |
Set to true to recover from a failed SnapMirror break operation on a FlexGroup relationship. This restores all destination FlexGroup constituents to the latest Snapshot copy, and any writes to the read-write constituents are lost. This field is applicable only for SnapMirror relationships with FlexGroup endpoints and when the PATCH state is "broken_off". |
restore |
boolean |
Set to true to create a relationship for restore. To trigger restore-transfer, use transfers POST on the restore relationship. |
restore_to_snapshot |
string |
Specifies the Snapshot copy to restore to on the destination after a break operation. This field is applicable only for SnapMirror relationships with FlexVol endpoints and when the PATCH state is "broken_off". |
source |
Endpoint of a SnapMirror relationship. |
|
state |
string |
State of the relationship. To initialize the relationship, PATCH the state to "snapmirrored". To break the relationship, PATCH the state to "broken_off". To resync the broken relationship, PATCH the state to "snapmirrored" for relationships with async policy type or "in_sync" for relationships with sync policy type. To pause the relationship, suspending further transfers, PATCH the state to "paused". To resume transfers for a paused relationship, PATCH the state to "snapmirrored" or "in_sync". The entries "in_sync", "out_of_sync", and "synchronizing" are only applicable to relationships of the sync policy type. A PATCH call on the state change only triggers the transition to the specified state. You must poll on the "state", "healthy" and "unhealthy_reason" fields using GET to determine if the transition is successful. |
transfer |
Basic information on the current transfer. |
|
unhealthy_reason |
array[snapmirror_error] |
Reason the relationship is not healthy. It is a concatenation of up to four levels of error messages. |
uuid |
string |
job_link
Name | Type | Description |
---|---|---|
_links |
||
uuid |
string |
The UUID of the asynchronous job that is triggered by a POST, PATCH, or DELETE operation. |
error_arguments
Name | Type | Description |
---|---|---|
code |
string |
Argument code |
message |
string |
Message argument |
error
Name | Type | Description |
---|---|---|
arguments |
array[error_arguments] |
Message arguments |
code |
string |
Error code |
message |
string |
Error message |
target |
string |
The target parameter that caused the error. |