How to use Snapshot Autodelete
Applies to
- ONTAP 9
- Clustered Data ONTAP 8
Answer
What is Volume Snapshot Autodelete?
- Snapshot Autodelete is a policy based space management feature available since Data ONTAP 7.1.
- It allows the user to define a policy to automatically delete snapshots when the volume is nearly full.
- It cannot be enabled on read-only volumes.
- See the manual for volume snapshot autodelete for documentation of all options.
Notes:
- The volume snapshot autodelete modify command enables you to modify autodelete policy setting for Snapshots, LUN's, NVMe namespaces, or file clones.
- This article only discusses Snapshots and only the most commonly used options.
- The
volume snapshot autodelete show
command is not directly in AutoSupport but is part ofVOL-STATUS-V
output.
Example:
::> volume snapshot autodelete show -vserver svm0 -volume nfs_vol
Vserver Name: svm0
Volume Name: nfs_vol
Enabled: false
Commitment: try
Defer Delete: user_created
Delete Order: oldest_first
Defer Delete Prefix: (not specified)
Target Free Space: 20%
Trigger: volume
Destroy List: none
Is Constituent Volume: false
What triggers automatic snapshot deletes?
Depending on what is selected in the "Trigger" option, Snapshot Autodelete will automatically delete a snapshot when, either the volume space utilized, or the snapshot reserve reaches a threshold capacity specified below.
Trigger:
- volume:
When the "volume" option is selected, Snapshot Autodelete will begin deleting snapshots when the volume reaches the threshold capacity AND the volume space reserved for snapshots is exceeded. If the space reserved for snapshots is zero, then exceeding the reserved snapshot space is always true and only the volume capacity threshold is used. The capacity threshold used is determined by the the size of the volume as follows:
- If volume size is less than 20 GB, the threshold is 85%.
- If volume size is equal to or greater than 20 GB and less than 100 GB, the threshold is 90%.
- If volume size is equal to or greater than 100 GB and less than 500 GB, the threshold is 92%.
- If volume size is equal to or greater than 500 GB and less than 1 TB, the threshold is 95%.
- If volume size is equal to or greater than 1 TB, the threshold is 98%.
Note: the value of the option "Volume Full Threshold Percent" shown in the volume show command is not related to Snapshot Autodelete's trigger threshold.
- snap_reserve:
When the "snap_reserve" option is selected, Snapshot Autodelete triggers the automatic deletion of snapshots when the space reserved for snapshots reaches the value assigned the volume in "Space Reserved for Snapshot Copies" (see the manual entry for volume show.)
When does it stop?
Snapshots are deleted, one at a time, until the used volume space reaches the value specified by "Target Free Space." The default for "Target Free Space" is 20% free space or 80% utilized. This value can be adjusted.
In what order are snapshots deleted?
Snapshot Autodelete orders the snapshots by date and time the snapshot was created and deletes then according to "Delete Order."
Delete Order:
- newest_first
- oldest_first {default}
What snapshots won't be deleted?
By default, Snapshot Autodelete will not delete snapshots locked by Snapmirror, or clones of a volume, a LUN, an NVMe namespace, or a file. Deletion of snapshots locked by these applications can be specified in the "Commitment" option.
Commitment:
- try: {default}
Snapshots not locked by any application are deleted.
- disrupt:
Snapshots locked by data protection utilities such as Snapmirror and Volume Move can be deleted. If such a locked snapshot is deleted during data transfer, the transfer is aborted. Snapshots that are not locked by data backing functionalities (such as volume clones, LUN clones, NVMe namespace clones and file clones) are deleted.
- destroy:
Snapshots locked by the data backing functionalities are deleted.
Will it remove all snapshots on the volume?
Potentially yes. Assuming there are no locked snapshots (or "Commitment" is set to "destroy"), Snapshot Autodelete will delete snapshots until the value in "Target Free Space" is reached. If deleting the snapshots does not free enough space to reach the target, all snapshots will be deleted.
What other options control the order snapshots are deleted?
The "Defer Delete" option and its accompanying option "Defer Delete Prefix" allow the user to tell Snapshot Autodelete to defer the deletion of specified snapshots until last.
Defer Delete:
- scheduled: scheduled snapshots are deleted last.
- user_created: {default} user-created snapshots are deleted last.
- prefix: Snapshots matching a certain prefix are deleted last.
- none: no defer deletion order is honored.
Defer Delete Prefix:
Specifies the prefix when "prefix" is selected in "Defer Delete."