Skip to main content
A newer release of this product is available.

Update the SnapMirror policy

Contributors

PATCH /snapmirror/policies/{uuid}

Introduced In: 9.6

Updates the SnapMirror policy.

Important notes

  • The properties "retention.label" and "retention.count" are mandatory if "retention" is provided in the input. The provided "retention.label" is the final list and it replaces the existing values.

  • The value of the "identity_preservation" property cannot be changed if the SnapMirror relationships associated with the policy have different identity_preservation configurations.

  • If the SnapMirror policy "identity_preservation" value matches the "identity_preservation" value of the associated SnapMirror relationships, then the "identity_preservation" value can be changed from a higher "identity_preservation" threshold value to a lower "identity_preservation" threshold value but not vice-versa. For example, the threshold value of the "identity_preservation" property can be changed from "full" to "exclude_network_config", but cannot be increased from "exclude_network_and_protocol_config" to "exclude_network_config" to "full". The threshold value of the "identity_preservation" cannot be changed to "exclude_network_and_protocol_config" for IDP SVMDR.

  • The policy properties "copy_all_source_snapshots", "copy_latest_source_snapshot", and "create_snapshot_on_source" cannot be modified.

  • No "retention" properties can be modified if the "copy_all_source_snapshots" or "copy_latest_source_snapshot" property is present in the policy.

  • Replacing or deleting all retention rules of a policy that has the "create_snapshot_on_source" property set to false in a single API call is not supported.

  • Modifying the property "retention.label" for all retention rules of a policy that has the "create_snapshot_on_source" property set to false in a single API call is not supported.

  • To remove a transfer_schedule on a SnapMirror policy set the "transfer_schedule" to null (no-quotes) during SnapMirror policy PATCH.

  • The property "archive.enabled" can be modified to "true" only for "async" policies with "create_snapshot_on_source" set to "false".

  • The property "archive.after_days" can be modified only when "archive.enabled" is "true". The value range of "archive.after_days" is 0..999. If the value is set to "0", the latest snapshot copy will be archived. The value of "archive.after_days" cannot be changed from "0" if any SnapMirror relationship is associated with the policy.

  • Modifying the property "network_compression_enabled" to "true" is not allowed if policy is associated with snapmirror relationship having object store endpoints.

  • Modifying the property "retention.creation_schedule" is not allowed if policy is associated with snapmirror relationship having object store endpoints.

  • snapmirror policy modify

Example

Updating the "retention" property to add rules to a policy without any rules.

 PATCH "/api/snapmirror/policies/fe65686d-00dc-11e9-b5fb-0050568e3f83" '{"retention": [{"label": "newlabel", "count": 2}, {"label": "weekly", "count": 2, "creation_schedule": {"name": "weekly"}}, {"label": "daily", "count": 14}]}'

Updating the "retention" property to add rules to a policy with existing rules {"retention": [{"label": "oldLabel1", "count": 2}, {"label": "oldLabel2", "count": 5}]

 PATCH "/api/snapmirror/policies/fe65686d-00dc-11e9-b5fb-0050568e3f83" '{"retention": [{"label": "oldLabel1", "count": 2}, {"label": "oldLabel2", "count": 5}, {"label": "newlabel", "count": 3}, {"label": "weekly", "count": 1}]}'

Updating the "retention" property to remove a rule (oldLabel1) and add new rule to a policy with existing rules {"retention": [{"label": "oldLabel1", "count": 2}, {"label": "oldLabel2", "count": 3}]

 PATCH "/api/snapmirror/policies/fe65686d-00dc-11e9-b5fb-0050568e3f83" '{"retention": [{"label": "oldLabel2", "count": 3}, {"label": "newlabel", "count": 2}]}'

Updating "transfer_schedule", "throttle", and "identity_preservation" properties

 PATCH "/api/snapmirror/policies/8aef950b-3bef-11e9-80ac-0050568ea591" '{"transfer_schedule.name" : "weekly", "throttle" : "100", "identity_preservation":"exclude_network_and_protocol_config"}'

Removing the SnapMirror transfer_schedule for a SnapMirror policy. Transfer_schedule can be specified as UUID or name or both with the value set to null (no-quotes).

 PATCH "/api/snapmirror/policies/98bb2608-fc60-11e8-aa13-005056a707ff/" '{"transfer_schedule":{"uuid":null, "name":null}}'

Updating the "archive" property

 PATCH "/api/snapmirror/policies/fe65686d-00dc-11e9-b5fb-0050568e3f83" '{"archive": {"enabled": "true", "after_days": "30"}}'

Parameters

Name Type In Required Description

uuid

string

path

True

Policy UUID

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.

  • Default value: 1

  • Max value: 120

  • Min value: 0

Request Body

Name Type Description

_links

_links

archive

archive

Archive information for the objects in an object store SnapMirror relationship. This property is applicable only for "async" policies with "create_snapshot_on_source" set to "false".

comment

string

Comment associated with the policy.

copy_all_source_snapshots

boolean

Specifies that all the source Snapshot copies (including the one created by SnapMirror before the transfer begins) should be copied to the destination on a transfer. "Retention" properties cannot be specified along with this property. This is applicable only to async policies. Property can only be set to 'true'.

copy_latest_source_snapshot

boolean

Specifies that the latest source Snapshot copy (created by SnapMirror before the transfer begins) should be copied to the destination on a transfer. "Retention" properties cannot be specified along with this property. This is applicable only to async policies. Property can only be set to 'true'.

create_snapshot_on_source

boolean

Specifies whether a new Snapshot copy should be created on the source at the beginning of an update or resync operation. This is applicable only to async policies. Property can only be set to 'false'.

identity_preservation

string

Specifies which configuration of the source SVM is replicated to the destination SVM. This property is applicable only for SVM data protection with "async" policy type.

name

string

Name of the policy.

network_compression_enabled

boolean

Specifies whether network compression is enabled for transfers. This is applicable only to the policies of type "async".

retention

array[snapmirror_policy_rule]

Rules for Snapshot copy retention.

rpo

integer

Specifies the duration of time for which a change to be propogated to a mirror should be delayed, in seconds. This is an intentional propagation delay between mirrors and is configurable down to zero, which means an immediate propogation. This is supported for policies of type 'continuous'.

scope

string

Set to "svm" for policies owned by an SVM, otherwise set to "cluster".

snapshot_lock_mode

string

Specifies the lock mode of the Snapshot copies stored in the object store. This property is applicable only to policies of type "async" with "create_snapshot_on_source" set to "false". When set to enterprise or compliance, the policy can be associated only with SnapMirror relationships where the source endpoint is a FlexVol volume and the destination endpoint is an object store. When set to compliance, no users can delete a Snapshot copy until the retention period has expired. When set to enterprise, users that have special permissions can delete a Snapshot copy before the retention period has expired.

svm

svm

sync_common_snapshot_schedule

sync_common_snapshot_schedule

Schedule used to create common Snapshot copies for synchronous relationships.

sync_type

string

throttle

integer

Throttle in KB/s. Default to unlimited.

transfer_schedule

transfer_schedule

The schedule used to update asynchronous relationships. Only cron schedules are supported for SnapMirror.

type

string

uuid

string

Example request
{
  "_links": {
    "self": {
      "href": "/api/resourcelink"
    }
  },
  "comment": "string",
  "copy_all_source_snapshots": 1,
  "copy_latest_source_snapshot": 1,
  "create_snapshot_on_source": "",
  "identity_preservation": "string",
  "name": "Asynchronous",
  "retention": [
    {
      "count": 7,
      "creation_schedule": {
        "_links": {
          "self": {
            "href": "/api/resourcelink"
          }
        },
        "name": "weekly",
        "uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
      },
      "label": "hourly",
      "period": "P30D",
      "prefix": "string"
    }
  ],
  "rpo": 0,
  "scope": "string",
  "snapshot_lock_mode": "string",
  "svm": {
    "_links": {
      "self": {
        "href": "/api/resourcelink"
      }
    },
    "name": "svm1",
    "uuid": "02c9e252-41be-11e9-81d5-00a0986138f7"
  },
  "sync_common_snapshot_schedule": {
    "_links": {
      "self": {
        "href": "/api/resourcelink"
      }
    },
    "name": "weekly",
    "uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
  },
  "sync_type": "string",
  "throttle": 0,
  "transfer_schedule": {
    "_links": {
      "self": {
        "href": "/api/resourcelink"
      }
    },
    "name": "weekly",
    "uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
  },
  "type": "string",
  "uuid": "4ea7a442-86d1-11e0-ae1c-123478563412"
}

Response

Status: 202, Accepted
Name Type Description

job

job_link

Example response
{
  "job": {
    "_links": {
      "self": {
        "href": "/api/resourcelink"
      }
    },
    "uuid": "string"
  }
}

Error

Status: Default

ONTAP Error Response codes

Error code Description

6619714

Schedule specified is an interval schedule. SnapMirror does not support interval schedules.

13303842

SnapMirror policy is not supported.

13303843

Conflicting values between SnapMirror policy and SnapMirror relationships for either 'transfer_schedule, throttle or identity_preservation' properties

13303850

Invalid input parameter

13303887

Failed to create SnapMirror policy. Reason: Maximum number of allowed retention rules reached

13304050

Retention cannot be empty for a SnapMirror policy with 'create_snapshot_on_source' set to false.

13303932

Invalid input property

13303947

The specified property needs another property to be specified

13303948

The specified properties cannot be set to the specified values.

13304047

An additional property is required with the specified policy property.

6621102

Failed to modify the property from zero because the policy is currently associated with a SnapMirror relationship.

6621104

Failed to modify the property because the policy is currently associated with a relationship which does not support the property.

13304096

Property archive is not supported when property snapshot_lock_mode is set to compliance or enterprise.

Name Type Description

error

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

Name Type Description

self

href

archive

Archive information for the objects in an object store SnapMirror relationship. This property is applicable only for "async" policies with "create_snapshot_on_source" set to "false".

Name Type Description

after_days

integer

Number of days after which the objects are archived. This is only applicable when "archive.enabled" is "true". If this property is not set when "archive.enabled" is "true", the default value is "0" and therefore archiving will be triggered instantly. The value range is 0..999. If the value is set to "0", the latest snapshot copy will be archived. The value of after_days cannot be changed from "0" if any FlexVol SnapMirror relationship is associated with the policy.

enabled

boolean

When set to "true", the objects are archived. When set to "false", the objects are not archived.

creation_schedule

Schedule used to create Snapshot copies on the destination for long term retention. Only cron schedules are supported for SnapMirror.

Name Type Description

_links

_links

name

string

Job schedule name

uuid

string

Job schedule UUID

snapmirror_policy_rule

SnapMirror policy rule for retention.

Name Type Description

count

integer

Number of Snapshot copies to be kept for retention.

creation_schedule

creation_schedule

Schedule used to create Snapshot copies on the destination for long term retention. Only cron schedules are supported for SnapMirror.

label

string

Snapshot copy label

period

string

Specifies the duration for which the Snapshot copies in the object store are locked. This property is valid only when the property 'snapshot_lock_mode' in the policy is set to enterprise or compliance. The retention period value represents a duration and must be specified in the ISO-8601 duration format. The retention period can be in years, months, or days. A period specified for years, months, or days is represented in the ISO-8601 format as "PY", "PM", or "PD" respectively. For example, "P10Y" represents a duration of 10 years. The period string must contain only a single time element, that is, either years, months, or days. A duration which combines different periods is not supported, for example "P1Y10M" is not supported. Years, if specified, must be less than or equal to 100. Months, if specified, must be less than or equal to 1200. Days, if specified, must be between and including 30 and 36500.

prefix

string

Specifies the prefix for the Snapshot copy name to be created as per the schedule. If no value is specified, then the label is used as the prefix.

svm

Name Type Description

_links

_links

name

string

The name of the SVM.

uuid

string

The unique identifier of the SVM.

sync_common_snapshot_schedule

Schedule used to create common Snapshot copies for synchronous relationships.

Name Type Description

_links

_links

name

string

Job schedule name

uuid

string

Job schedule UUID

transfer_schedule

The schedule used to update asynchronous relationships. Only cron schedules are supported for SnapMirror.

Name Type Description

_links

_links

name

string

Job schedule name

uuid

string

Job schedule UUID

snapmirror_policy

SnapMirror policy information. SnapMirror policy can either be of type "async", "sync" or "continuous". The policy type "async" can be associated with a SnapMirror relationship that has either the FlexVol volume or FlexGroup volume or SVM as the endpoint. The policy type "sync" along with "sync_type" as "sync" or "strict_sync" can be associated with a SnapMirror relationship that has FlexVol volume as the endpoint. The policy type "sync" can have a "sync_type" of either "sync", "strict_sync" or "automated_failover". If the "sync_type" is "sync" then a write success is returned to the client after writing the data to the source endpoint and before writing the data to the destination endpoint. If the "sync_type" is "strict_sync" then a write success is returned to the client after writing the data to the both source and destination endpoints. If the "sync_type" is "automated_failover" then the policy can be associated with a SnapMirror relationship that has Consistency Group as the endpoint. Use the "sync" policy with "sync_type" as "automated_failover" to establish SnapMirror relationships for business continuity usecases. SnapMirror relationships with policy type as "sync" and "sync_type" as "automated_failover" can be monitored by the Mediator, if configured. In case the source Consistency Group endpoint is not reachable, the Mediator may trigger a failover to the destination Consistency Group endpoint. A policy of type "continuous" can be associated with SnapMirror relationships that have either ONTAP S3 buckets or NON-ONTAP object stores as endpoints. This type of policy is used for FabricLink owned targets.

Name Type Description

_links

_links

archive

archive

Archive information for the objects in an object store SnapMirror relationship. This property is applicable only for "async" policies with "create_snapshot_on_source" set to "false".

comment

string

Comment associated with the policy.

copy_all_source_snapshots

boolean

Specifies that all the source Snapshot copies (including the one created by SnapMirror before the transfer begins) should be copied to the destination on a transfer. "Retention" properties cannot be specified along with this property. This is applicable only to async policies. Property can only be set to 'true'.

copy_latest_source_snapshot

boolean

Specifies that the latest source Snapshot copy (created by SnapMirror before the transfer begins) should be copied to the destination on a transfer. "Retention" properties cannot be specified along with this property. This is applicable only to async policies. Property can only be set to 'true'.

create_snapshot_on_source

boolean

Specifies whether a new Snapshot copy should be created on the source at the beginning of an update or resync operation. This is applicable only to async policies. Property can only be set to 'false'.

identity_preservation

string

Specifies which configuration of the source SVM is replicated to the destination SVM. This property is applicable only for SVM data protection with "async" policy type.

name

string

Name of the policy.

network_compression_enabled

boolean

Specifies whether network compression is enabled for transfers. This is applicable only to the policies of type "async".

retention

array[snapmirror_policy_rule]

Rules for Snapshot copy retention.

rpo

integer

Specifies the duration of time for which a change to be propogated to a mirror should be delayed, in seconds. This is an intentional propagation delay between mirrors and is configurable down to zero, which means an immediate propogation. This is supported for policies of type 'continuous'.

scope

string

Set to "svm" for policies owned by an SVM, otherwise set to "cluster".

snapshot_lock_mode

string

Specifies the lock mode of the Snapshot copies stored in the object store. This property is applicable only to policies of type "async" with "create_snapshot_on_source" set to "false". When set to enterprise or compliance, the policy can be associated only with SnapMirror relationships where the source endpoint is a FlexVol volume and the destination endpoint is an object store. When set to compliance, no users can delete a Snapshot copy until the retention period has expired. When set to enterprise, users that have special permissions can delete a Snapshot copy before the retention period has expired.

svm

svm

sync_common_snapshot_schedule

sync_common_snapshot_schedule

Schedule used to create common Snapshot copies for synchronous relationships.

sync_type

string

throttle

integer

Throttle in KB/s. Default to unlimited.

transfer_schedule

transfer_schedule

The schedule used to update asynchronous relationships. Only cron schedules are supported for SnapMirror.

type

string

uuid

string

Name Type Description

_links

_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.