2012-01-09 06:30 AM
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...
Thank you for your help.
2012-01-09 07:07 AM
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
snapshotScheduleName=Sunday at midnight with daily and hourly
Or by running the following cli.
[root@ ~]# dfpm dataset snapshot delete help
delete -- delete snapshots of volumes in a dataset
dfpm dataset snapshot delete [ - D ] <dataset-name-or-id> <volume-name-or-id>
<snapshot-name-or-id> [ <snapshot-name-or-id> ... ]
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.
To list the snapshot use the following.
[root@ ~]# dfpm dataset snapshot list help
list -- list snapshots for a particular object
dfpm dataset snapshot list [ <object-name-or-id> ]
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.
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.