volume snapshot policy create
Create a new snapshot policy
Availability: This command is available to cluster and Vserver administrators at the admin privilege level.
Description
The volume snapshot policy create
command creates a snapshot policy. A snapshot policy includes at least one schedule, up to a maximum of five schedules, and a maximum number of snapshots per schedule. You can create a schedule by using the job schedule cron create or job schedule interval create commands. When applied to a volume, the snapshot policy specifies the schedule on which snapshots are taken and the maximum number of snapshots that each schedule can take. The total count of all the snapshots to be retained for the policy cannot be more than 1023.
Parameters
-vserver <vserver name>
- Vserver Name-
This specifies the Vserver on which the snapshot policy is to be created.
-policy <snapshot policy>
- Snapshot Policy Name-
This specifies the snapshot policy that is to be created.
-enabled {true|false}
- Snapshot Policy Enabled-
This specifies whether the snapshot policy is enabled.
[-comment <text>]
- Comment-
This option specifies a text comment for the snapshot policy.
-schedule1 <text>
- Schedule1 Name-
This specifies the name of the first schedule associated with the snapshot policy.
-count1 <integer>
- Maximum Snapshot Copies for Schedule1-
This specifies the maximum number of snapshots that can be taken by the first schedule.
[-prefix1 <text>]
- Snapshot Copy Name Prefix for Schedule1-
This option specifies the prefix associated with the first schedule. Every schedule has only one prefix. The command fails if you try to update an existing prefix. If you do not specify this parameter and there is no prefix associated with the schedule, the schedule name is used as the prefix. If you do not specify this parameter and there is already a prefix associated with the schedule from a previous invocation of the command, then that prefix is used.
[-snapmirror-label1 <text>]
- Label for SnapMirror Operations for Schedule1-
This specifies the SnapMirror Label of the first schedule associated with the snapshot policy. Once specified, all snapshots created for that schedule have the SnapMirror Label assigned to them. The SnapMirror Label is used by the Vaulting subsystem when you back up snapshots to the Vault Destination.
[-retention-period1 <snaplock minmax period>]
- SnapLock Retention Period-
This specifies the retention period for snapshots that can be taken by the first schedule. If this parameter is specified, the
-schedule1
parameter must also be specified. The default is no retention period. [-schedule2 <text>]
- Schedule2 Name-
This option specifies the name of the second schedule associated with the snapshot policy. If this parameter is specified, the
-count2
parameter must also be specified. [-count2 <integer>]
- Maximum Snapshot Copies for Schedule2-
This option specifies the maximum number of snapshots that can be taken by the second schedule. If this parameter is specified, the
-schedule2
parameter must also be specified. [-prefix2 <text>]
- Snapshot Copy Name Prefix for Schedule2-
This option specifies the prefix associated with the second schedule. If this parameter is specified,
-schedule2
and-count2
parameters must also be specified. Every schedule has only one prefix. The command fails if you try to update an existing prefix. If you do not specify this parameter and there is no prefix associated with the schedule, the schedule name is used as the prefix. If you do not specify this parameter and there is already a prefix associated with the schedule from a previous invocation of the command, then that prefix is used. [-snapmirror-label2 <text>]
- Label for SnapMirror Operations for Schedule2-
This specifies the SnapMirror Label of the second schedule associated with the snapshot policy. Once specified, all snapshots created for that schedule have the SnapMirror Label assigned to them. The SnapMirror Label is used by the Vaulting subsystem when you back up snapshots to the Vault Destination.
[-retention-period2 <snaplock minmax period>]
- SnapLock Retention Period-
This specifies the retention period for snapshots that can be taken by the second schedule. If this parameter is specified, the
-schedule2
parameter must also be specified. The default is no retention period. [-schedule3 <text>]
- Schedule3 Name-
This option specifies the name of the third schedule associated with the snapshot policy. If this parameter is specified, the
-count3
parameter must also be specified. [-count3 <integer>]
- Maximum Snapshot Copies for Schedule3-
This option specifies the maximum number of snapshots that can be taken by the third schedule. If this parameter is specified, the
-schedule3
parameter must also be specified. [-prefix3 <text>]
- Snapshot Copy Name Prefix for Schedule3-
This option specifies the prefix associated with the third schedule. If this parameter is specified,
-schedule3
and-count3
parameters must also be specified. Every schedule has only one prefix. The command fails if you try to update an existing prefix. If you do not specify this parameter and there is no prefix associated with the schedule, the schedule name is used as the prefix. If you do not specify this parameter and there is already a prefix associated with the schedule from a previous invocation of the command, then that prefix is used. [-retention-period3 <snaplock minmax period>]
- SnapLock Retention Period-
This specifies the retention period for snapshots that can be taken by the third schedule. If this parameter is specified, the
-schedule3
parameter must also be specified. The default is no retention period. [-snapmirror-label3 <text>]
- Label for SnapMirror Operations for Schedule3-
This specifies the SnapMirror Label of the third schedule associated with the snapshot policy. Once specified, all snapshots created for that schedule have the SnapMirror Label assigned to them. The SnapMirror Label is used by the Vaulting subsystem when you back up snapshots to the Vault Destination.
[-schedule4 <text>]
- Schedule4 Name-
This option specifies the name of the fourth schedule associated with the snapshot policy. If this parameter is specified, the
-count4
parameter must also be specified. [-count4 <integer>]
- Maximum Snapshot Copies for Schedule4-
This option specifies the maximum number of snapshots that can be taken by the fourth schedule. If this parameter is specified, the
-schedule4
parameter must also be specified. [-prefix4 <text>]
- Snapshot Copy Name Prefix for Schedule4-
This option specifies the prefix associated with the fourth schedule. If this parameter is specified,
-schedule4
and-count4
parameters must also be specified. Every schedule has only one prefix. The command fails if you try to update an existing prefix. If you do not specify this parameter and there is no prefix associated with the schedule, the schedule name is used as the prefix. If you do not specify this parameter and there is already a prefix associated with the schedule from a previous invocation of the command, then that prefix is used. [-retention-period4 <snaplock minmax period>]
- SnapLock Retention Period-
This specifies the retention period for snapshots that can be taken by the fourth schedule. If this parameter is specified, the
-schedule4
parameter must also be specified. The default is no retention period. [-snapmirror-label4 <text>]
- Label for SnapMirror Operations for Schedule4-
This specifies the SnapMirror Label of the fourth schedule associated with the snapshot policy. Once specified, all snapshots created for that schedule have the SnapMirror Label assigned to them. The SnapMirror Label is used by the Vaulting subsystem when you back up snapshots to the Vault Destination.
[-schedule5 <text>]
- Schedule5 Name-
This option specifies the name of the fifth schedule associated with the snapshot policy. If this parameter is specified, the
-count5
parameter must also be specified. [-count5 <integer>]
- Maximum Snapshot Copies for Schedule5-
This option specifies the maximum number of snapshots that can be taken by the fifth schedule. If this parameter is specified, the
-schedule5
parameter must also be specified. [-prefix5 <text>]
- Snapshot Copy Name Prefix for Schedule5-
This option specifies the prefix associated with the fifth schedule. If this parameter is specified,
-schedule5
and-count5
parameters must also be specified. Every schedule has only one prefix. The command fails if you try to update an existing prefix. If you do not specify this parameter and there is no prefix associated with the schedule, the schedule name is be used as the prefix. If you do not specify this parameter and there is already a prefix associated with the schedule from a previous invocation of the command, then that prefix is used. [-retention-period5 <snaplock minmax period>]
- SnapLock Retention Period-
This specifies the retention period for snapshots that can be taken by the fifth schedule. If this parameter is specified, the
-schedule5
parameter must also be specified. The default is no retention period. [-snapmirror-label5 <text>]
- Label for SnapMirror Operations for Schedule5-
This specifies the SnapMirror Label of the fifth schedule associated with the snapshot policy. Once specified, all snapshots created for that schedule have the SnapMirror Label assigned to them. The SnapMirror Label is used by the Vaulting subsystem when you back up snapshots to the Vault Destination.
Examples
The following example creates a snapshot policy named snappolicy_4hrs on a Vserver named vs0. The policy runs on a single schedule named 4hrs with a prefix every_4_hour and has a maximum number of five snapshots.
cluster1::> volume snapshot policy create -vserver vs0 -policy snappolicy_4hrs -schedule1 4hrs -count1 5 -prefix1 every_4_hour -retention-period1 "8 hours"