Skip to main content

Enable automatic snapshot and LUN deletion to manage space

Contributors netapp-dbagwell netapp-mwallis netapp-aherbin

You can define and enable a policy for automatically deleting snapshots and FlexClone LUNs. Automatically deleting snapshots and FlexClone LUNs can help you manage space utilization.

About this task

You can automatically delete snapshots from read-write volumes and FlexClone LUNs from read-write parent volumes. You cannot set up automatic deletion of snapshots from read-only volumes, for example, SnapMirror destination volumes.

Step
  1. Define and enable a policy for automatically deleting snapshots 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 snapshots 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 snapshots 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
    Note

    Aggregate-level snapshots work differently than volume-level snapshots and are managed automatically by ONTAP. The option to delete aggregate snapshots is always enabled and helps in managing space utilization.

    If the trigger parameter is set to snap_reserve for an aggregate, the snapshots are maintained until the space reserved crosses the threshold capacity. Therefore, even if the trigger parameter is not set to snap_reserve, the space used by the snapshot copy in the command will be listed as 0 because these snapshots are automatically deleted. Also, the space used by snapshots in an aggregate is considered as free and is included in the available space parameter of the command.