View and restore S3 snapshots
The ONTAP S3 snapshot feature enables you to view and browse the S3 snapshot content for your buckets from S3 clients. In addition, you can restore a single object, a set of objects, or a whole bucket on an S3 client from an S3 snapshot.
For viewing, browsing, and restoring ONTAP S3 snapshots on your buckets, the snapshots should have been created and the S3 base bucket should be accessible to you through the S3 protocol client.
List and view S3 snapshots
You can view the S3 snapshot details, compare them, and identify errors. Using the ONTAP CLI, you can list all the snapshots created on your S3 buckets.
-
List S3 snapshots:
vserver object-store-server bucket snapshot show
You can view the snapshot names, storage VMs, buckets, creation time, and
instance-uuid
of the S3 snapshots created for all your buckets on the cluster. -
You can also specify a bucket name to view the names, creation time, and
instance-uuid
of all the S3 snapshots created for that specific bucket.vserver object-store-server bucket snapshot show -vserver <svm_name> -bucket <bucket_name>
Browse S3 snapshots content
If you notice any failures or issues in your environment, you can browse the content of the S3 bucket snapshots to identify the errors. You can also browse the S3 snapshots to determine the error-free content to restore.
S3 snapshots are presented as snapshot buckets to the S3 clients. The snapshot bucket name is formatted as <base_bucket_name>-s3snap-<snapshot_name>
. You can see all the snapshot buckets in a storage VM using the ListBuckets
S3 API operation.
The S3 snapshot bucket inherits the access policies of the base bucket, and supports only read-only operations. If you have permissions to access the base bucket, you can also perform read-only S3 API operations on the S3 snapshot bucket, such as HeadObject
, GetObject
, GetObjectTagging
, ListObjects
, ListObjectVersions
, GetObjectAcl
, and CopyObject
.
The CopyObject operation is supported on an S3 snapshot bucket only if it is a snapshot copy of the source bucket, not if it is the storage destination of the snapshot.
|
For more information about these operations, refer to ONTAP S3 supported actions.
Restore content from S3 snapshots
You can perform a restore operation on an S3 client to recover a single object, a set of objects, or an entire bucket by copying content from a snapshot bucket to the original or a different bucket. You can browse snapshots to determine which snapshot content you should copy.
You restore the entire bucket, objects with a prefix, or a single object by using the aws s3 cp
command.
-
Take a snapshot of the base S3 bucket.
vserver object-store-server bucket snapshot create -vserver <svm_name> -bucket <base_bucket_name> -snapshot <snapshot_name>
-
Restore the base bucket using the snapshot:
-
Restore an entire bucket. Use the snapshot bucket name in the format
<base_bucket_name>-s3snap-<snapshot_name>
.aws --endpoint http://<IP> s3 cp s3://<snapshot-bucket-name> s3://<base-bucket> --recursive
-
Restore objects in a directory with the prefix
dir1
:aws --endpoint http://<IP> s3 cp s3://<snapshot-bucket-name>/dir1 s3://<base_bucket_name>/dir1 --recursive
-
Restore a single object named
web.py
:aws --endpoint http://<IP> s3 cp s3:// <snapshot-bucket-name>/web.py s3://<base_bucket_name>/web.py
-