Delete an ONTAP S3 bucket that contains objects
Beginning with ONTAP 9.20.1, you can schedule bucket delete operations on object store servers to remove buckets without first emptying them. You do this by using a configurable retention-based recovery window, which allows bucket recovery before the retention interval expires.
The ability to delete buckets that are not empty helps simplify bucket decommissioning by avoiding manual object-by-object cleanup before a bucket can be removed, reduces expiration backlog, and makes capacity reusable sooner.
-
You must be a cluster administrator or SVM administrator.
-
You must be at the advanced privilege level.
Delete a bucket that contains objects
You can schedule a bucket for deletion without first emptying it by setting a retention interval. By default, retention is set to 12 hours.
You can perform this task from System Manager or the ONTAP CLI.
-
Navigate to Storage > Buckets and locate the bucket you want to delete.
-
Click next to the bucket name and select Delete.
-
If the bucket is not empty, in the Delete Bucket window, select the option to delete the data and empty the bucket, and select Delete.
-
Specify the retention interval after which the bucket will be permanently deleted:
object-store-server create -vserver <SVM name> -bucket-delete-retention-hours <integer> -
Initiate the bucket deletion schedule:
`object-store-server bucket delete -bucket <bucket name> -delete-objects tru`e
Recover a deleted bucket
If a bucket is accidentally deleted, you can recover it using the ONTAP CLI during the retention period you specified.
-
Recover a deleted bucket by entering the following command:
object-store-server bucket recover-deleted-bucket -bucket <bucket name>