Skip to main content

Create a Snapshot policy

Contributors netapp-aherbin netapp-lenida netapp-norbertt netapp-ahibbard

A Snapshot policy specifies when to create Snapshot copies, how many copies to retain, and how to name them. For example, a system might create one Snapshot copy every day at 12:10 a.m., retain the two most recent copies, and name them “daily.timestamp.” A Snapshot policy can contain up to five job schedules.

About this task

This procedure applies to FAS, AFF, and current ASA systems. If you have an ASA r2 system (ASA A1K, ASA A70, or ASA A90), follow these steps to create a snapshot policy. ASA r2 systems provide a simplified ONTAP experience specific to SAN-only customers.

By default, ONTAP forms the names of Snapshot copies by appending a timestamp to the job schedule name:

daily.2017-05-14_0013/              hourly.2017-05-15_1106/
daily.2017-05-15_0012/              hourly.2017-05-15_1206/
hourly.2017-05-15_1006/             hourly.2017-05-15_1306/

You can substitute a prefix for the job schedule name if you prefer.

The snapmirror-label option is for SnapMirror replication. For more information, see Defining a rule for a policy.

Steps

You can create a Snapshot copy policy using System Manager or the ONTAP CLI. The procedure creates a Snapshot copy policy on the local cluster only.

System Manager
  1. Navigate to Protection > Overview and expand Local policy settings.

  2. In the Snapshot policies pane, click Arrow icon.

  3. In the Snapshot policies tab, click Add icon.

  4. In the Add Snapshot policy window, enter the policy name, and choose the scope.

  5. Click Add icon.

  6. To select a schedule click the currently displayed schedule name, click Dropdown icon, and choose a different schedule.

  7. Enter the maximum Snapshot copies to retain, and, if needed, enter the SnapMirror label and the SnapLock retention period.

  8. Click Save.

CLI
  1. Create a Snapshot policy:

    volume snapshot policy create -vserver <SVM> -policy <policy_name> -enabled true|false -schedule1 <schedule1_name> -count1 <copies_to_retain> -prefix1 <snapshot_prefix> -snapmirror-label1 <snapshot_label> ... -schedule5 <schedule5_name> -count5 <copies_to_retain> -prefix5 <snapshot_prefix> -snapmirror-label5 <snapshot_label>

    The following example creates a Snapshot policy named snap_policy_daily that runs on a daily schedule. The policy has a maximum of five Snapshot copies, each with the name daily.timestamp and the SnapMirror label daily:

    cluster1::> volume snapshot policy create -vserver vs0 -policy snap_policy_daily -schedule1 daily -count1 5 -snapmirror-label1 daily