Difference between revisions of "Deleting Object Storage with Versioning Enabled"

From Notes_Wiki
(Created page with "Home > Storage server > NetApp OneTap > Deleting Object Storage with Versioning Enabled == Object Storage: Bucket Deletion if Versioning is Enabled == -------------------------------------------------------------- In NetApp storage, after creating an S3 bucket with versioning enabled, you may encounter an error while deleting the S3 bucket even after emptying it: "Failed to remove bucket "backup" for SVM "svm3". Reason: Cannot delete bucket...")
 
(No difference)

Latest revision as of 06:14, 1 September 2025

Home > Storage server > NetApp OneTap > Deleting Object Storage with Versioning Enabled


Object Storage: Bucket Deletion if Versioning is Enabled


In NetApp storage, after creating an S3 bucket with versioning enabled, you may encounter an error while deleting the S3 bucket even after emptying it:

"Failed to remove bucket "backup" for SVM "svm3". Reason: Cannot delete bucket "backup" on SVM "svm3" because it is not empty. Delete the objects, and then try the operation again. For further assistance, contact technical support."

This happens because, with versioning enabled, simply emptying the objects does not remove their different versions. You must remove all object versions before deleting the bucket.

Steps to Remove a Bucket When Versioning is Enabled

1. List object versions

aws s3api --endpoint http://<FQDN-of-object-store-server> list-object-versions --bucket <bucket-name>

This lists all versions of objects in the specified bucket. Since versioning is enabled, each object can have multiple versions, and the output shows metadata such as:

  • ETag
  • Size
  • StorageClass
  • Key (object name, e.g., test-backup/test.txt)
  • VersionId (unique identifier for each version)
  • IsLatest (whether this is the current version)
  • LastModified

2. Delete all versions of each object

Loop through each object and version:

aws s3api --endpoint http://<FQDN-of-object-store-server> delete-object --bucket <bucket-name> --key <object-name> --version-id <VersionId>

Repeat this for all keys and version IDs listed in step 1.

3. Delete delete-markers (if any)

When versioning is enabled, deleting an object creates a delete marker. These must also be removed:

aws s3api --endpoint http://<FQDN-of-object-store-server> delete-object --bucket <bucket-name> --key <object-name> --version-id <DeleteMarkerVersionId>

4. Verify the bucket is empty

aws s3api --endpoint http://<FQDN-of-object-store-server> list-object-versions --bucket <bucket-name>

This should return no versions.

5. Delete the bucket

a) Using CLI (NetApp ONTAP SSH with admin credentials):

vserver object-store-server bucket delete -vserver <svm_name> -bucket <bucket_name>

b) Using Web UI:

  • Navigate to: Storage > Buckets
  • Locate the bucket you want to delete
  • Click the three dots next to the bucket name
  • Select Delete



Home > Storage server > NetApp OneTap > Deleting Object Storage with Versioning Enabled