ONTAP Discussions

Snapshot deletion in Protection Manager

filer002
2,209 Views

Hello,

We need to delete a lot of old snapshots (~1500) generated by PM (dfpm, daily, hourly).

Is there a way to do this in command line (for scripting) instead of using the GUI?

We managed to delete a snapshot manually with the "snap delete" command. However, it did not remove the entry in the PM database (the snapshot is still visible in the GUI).

NetApp support told us that it is not possible, but it seems quite unusual...

Any idea?

Thank you for your help.

Best regards,

Stéphane

1 REPLY 1

adaikkap
2,209 Views

HI Stephane,

     Why do you want to delete it manually ? Isnt the policy retention setting doing the job of deletion ? You can make the snapshot getting automatically deleted by reducing the retention setting in the policy of a dataset. So that the next conformance run can delete them.

[root@~]# dfpm policy node get -q 58

nodeId=1

nodeName=Primary data

hourlyRetentionCount=2

hourlyRetentionDuration=86400

dailyRetentionCount=2

dailyRetentionDuration=604800

weeklyRetentionCount=1

weeklyRetentionDuration=1209600

monthlyRetentionCount=0

monthlyRetentionDuration=0

backupScriptPath=

backupScriptRunAs=

failoverScriptPath=

failoverScriptRunAs=

snapshotScheduleId=43

snapshotScheduleName=Sunday at midnight with daily and hourly

lagWarningEnabled=Yes

lagWarningThreshold=129600

lagErrorEnabled=Yes

lagErrorThreshold=172800

nodeId=2

nodeName=Backup

hourlyRetentionCount=0

hourlyRetentionDuration=0

dailyRetentionCount=2

dailyRetentionDuration=1209600

weeklyRetentionCount=2

weeklyRetentionDuration=4838400

monthlyRetentionCount=1

monthlyRetentionDuration=8467200

[root@~]#

Or by running the following cli.

[root@ ~]#  dfpm dataset snapshot delete help

NAME

    delete -- delete snapshots of volumes in a dataset

SYNOPSIS

    dfpm dataset snapshot delete [ - D ] <dataset-name-or-id> <volume-name-or-id>

        <snapshot-name-or-id> [ <snapshot-name-or-id> ... ]

DESCRIPTION

    Delete snapshots of a volume member of a dataset.

    If -D option is specified, only dry run results will be

    displayed. No changes will be made to the dataset.

[root@ ~]#

To list the snapshot use the following.

[root@ ~]#  dfpm dataset snapshot list help

NAME

    list -- list snapshots for a particular object

SYNOPSIS

    dfpm dataset snapshot list [ <object-name-or-id> ]

DESCRIPTION

    list snapshots for a particular object.

    object-name-or-id can be either a volume, aggregate,

    storage system, vFiler unit, dataset. If object-name-or-id is not

    specified, then all snapshots are listed.

[root@ ~]#

If you know the volume names on which the snapshot are to be deleted you can use the dfm run cmd to run commands on the filer.

Regards

adai

Public