Restoring objects from S3 cloud-tier storage

You can restore the objects from the cloud back into Ceph Object Gateway cluster using S3 Restore API on the transitioned object.

Before you begin

Ensure the following prerequisites are met before restoring objects from S3 cloud-tier storage.

  • Target path created on Amazon S3.
  • retain_head_object should be set to true while configuring cloudtier storage-class to be able to restore from cloud service.
  • s3cmd installed on the bootstrapped node.
  • Ensure user credentials provided for that cloud-tier storage class remain valid for the restore function to work properly.
  • For cloud-s3-glacier tier types, be sure that the glacier_restore_days and glacier_restore_tier_type options are correctly set. For more information, see Transitioning data to Amazon S3 cloud service.

About this task

By default, objects are restored to STANDARD storage-class. However, you can configure the storage class to which the objects need to be restored to by setting the restore_storage_class option.

Note:

If the null version of an object is not the latest version, do not specify version-id null when issuing a restore-object request.

For example, suppose an object named object1 is uploaded to a bucket called testbucket1, transitioned to the cloud, and then restored. Later, versioning is enabled on testbucket1, and a new version of object1 is uploaded. At this point, the original (null) version is no longer the latest.

In this case, when restoring object1, you should omit the --version-id null parameter from the restore-objectcommand.

Procedure

Restore an object, using one of the following procedures.
  • Restore cloud transitioned objects by using the S3 restore-object command.
    aws s3api restore-object
              --bucket <value>
              --key <value>
              [--version-id <value>]
              --restore-request (structure) 
    {
                // for temporary restore
                "Days": integer, // "Days" is optional and if not provided, the object will be restored permanently.
              }
    Note: The restoration period of the temporary copies can be updated by reissuing the request with a new period.

    The following example demonstrates how to restore the object doc1.rtf from the specified version for a period of 10 days.

    aws s3api restore-object 
    --bucket bucket1 
    --key doc1.rtf [--version-id 3sL4kqtJlcpXroDTDmJ+rmSpXd3dIbrHY+MTRCxf3vjVBH40Nr8X8gdRQBpUMLUo]
    --restore-request "Days": 10 

    The following example demonstrates how to restore the object doc2.rtf permanently, where it is treated as a regular object.

    aws s3api restore-object  --bucket bucket1 --key doc2.rtf --restore-request {}
    Note: If a restore request for an object is already issued or in progress, the s3api restore request with the --debug flag displays a RestoreAlreadyInProgress message.
  • Restore and read the transitioned objects by using the read-through feature.
    Note: The object copy restored via read-through is temporary and is retained only for the duration of read_through_restore_days.
    Ensure that the following parameters are set:
    • "Allow_read_through”: “enable"
    • “read_through_restore_days”: 10
    
    --storage-class CLOUDTIER 
    --tier-config=endpoint=http://XX.XX.XX.XX:YY,
    access_key=<access_key>,secret=<secret>, 
    retain_head_object=true, 
    restore_storage_class=COLDTIER, 
    allow_read_through=true, 
    read_through_restore_days=10
     

    Following is an example to restore a object using the S3 Get Object when read-through is enabled.

    aws s3api get-object  --bucket bucket1 --key doc3.rtf

    Following are the examples of tier configuration.

    Example for restoring an object from cloud-s3tier-type
    tier-type = cloud-s3
    tier-config =
    {
    "access_key": xxx,
    "secret": xxx,
    "endpoint": http://10.0.210.010:8080
    “,
    "region": “”,
    "host_style": “path”,
    "acls": [ { "type": “id”,
    "source_id": “”,
    "dest_id": “” } ... ],
    "target_path": dfqe-bucket-01,
    "target_storage_class": “”,
    "multipart_sync_threshold": 44432,
    "multipart_min_part_size": 44432,
    "retain_head_object": “true”,
    “Allow_read_through”: “enable”,
    “read_through_restore_days”: 10
    }
     
    Note: The transition and restore logic works if the target storage class matches the actual storage class configured in the cloud endpoint that can archive objects.
    Example for restoring an object from cloud-s3-glacier tier-type
    tier-type = cloud-s3-glacier
    tier-config =
    {
    "access_key": xxx,
    "secret": xxx,
    "endpoint": http://s3.us-east-1.amazonaws.com
    “,
    "region": “us-east-1”,
    "host_style": “path”,
    "acls": [ { "type": “id”,
    "source_id": “”,
    "dest_id": “” } ... ],
    "target_path": rgwbucket,
    "target_storage_class": “GLACIER”,
    "multipart_sync_threshold": 44432,
    "multipart_min_part_size": 44432,
    "retain_head_object": “true”,
    “Allow_read_through”: “enable”,
    “read_through_restore_days”: 10
    "restore_storage_class": "COLDTIER", 
    "s3-glacier": { 
        "glacier_restore_days": 2, 
        "glacier_restore_tier_type": "Expedited"
    }
     

What to do next

Verify the status of the restore by running an S3 head-object request with the specified parameters.

Check the status of the restore using the S3 head-object request.

For example,
[root@host01 ~]$ aws s3api --ca-bundle  
/etc/pki/ca-trust/source/anchors/myCA.pem --profile rgw 
--endpoint https://host02.example.com:8043 --region default head-object 
--key transition1 --bucket transition