Delete Snapshot copies automatically
You can define and enable a policy for automatically deleting Snapshot copies and FlexClone LUNs. Automatically deleting Snapshot copies and FlexClone LUNs can help you manage space utilization.
You can automatically delete Snapshot copies from read-write volumes and FlexClone LUNs from read-write parent volumes. You cannot set up automatic deletion of Snapshot copies from read-only volumes, for example, SnapMirror destination volumes.
-
Define and enable a policy for automatically deleting Snapshot copies by using the
volume snapshot autodelete modify
command.See the
volume snapshot autodelete modify
man page for information about the parameters that you can use with this command to define a policy that meets your needs.The following command enables the automatic deletion of Snapshot copies and sets the trigger to
snap_reserve
for the vol3 volume, which is part of the vs0.example.com storage virtual machine (SVM):cluster1::> volume snapshot autodelete modify -vserver vs0.example.com -volume vol3 -enabled true -trigger snap_reserve
The following command enables the automatic deletion of Snapshot copies and of FlexClone LUNs marked for autodeletion for the vol3 volume, which is part of the vs0.example.com storage virtual machine (SVM):
cluster1::> volume snapshot autodelete modify -vserver vs0.example.com -volume vol3 -enabled true -trigger volume -commitment try -delete-order oldest_first -destroy-list lun_clone,file_clone
Aggregate-level Snapshot copies work differently than volume-level Snapshot copies and are managed automatically by ONTAP. The option to delete aggregate Snapshot copies is always enabled and helps in managing space utilization.
If the trigger parameter is set to
snap_reserve
for an aggregate, the Snapshot copies are maintained until the space reserved crosses the threshold capacity. Therefore, even if the trigger parameter is not set tosnap_reserve
, the space used by the Snapshot copy in the command will be listed as0
because these Snapshot copies are automatically deleted. Also, the space used by Snapshot copies in an aggregate is considered as free and is included in the available space parameter of the command.