This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
storage:ibm_cos [2021/12/01 12:06] manu |
storage:ibm_cos [2024/07/27 12:37] (current) manu |
||
|---|---|---|---|
| Line 139: | Line 139: | ||
| * RTO sensitive workloads | * RTO sensitive workloads | ||
| + | ===== Bucket Object Lock ==== | ||
| + | https://github.com/aws/aws-cli | ||
| + | |||
| + | |||
| + | The Curl command didn't work so I used the aws s3 commands. (You need to have it installed for the commands to | ||
| + | work) | ||
| + | Please follow the steps below: | ||
| + | * Enable Object Lock feature on Manager GUI | ||
| + | * Enable Object Lock configuration on Storage Pool. Click on Configure button on Object Lock section. | ||
| + | * Select Container vaults to enable Object Lock. Versioning enabled on selected Container vaults as well. | ||
| + | * Create bucket and run commands to enable Versioning and Object Lock on the individual bucket. | ||
| + | |||
| + | __NOTE__ Enabling Object lock will not affect the existing vaults. | ||
| + | |||
| + | The below is an example which I tried in my lab to enable Versioning and then Object Lock. Maybe you can try | ||
| + | replicating the same to see if it works. | ||
| + | |||
| + | ==== create bucket ==== | ||
| + | |||
| + | <cli prompt='%'> | ||
| + | % curl -X PUT http://10.10.64.98:8337/container/testlockbucket -u jeff:password -d '{"storage_location":"cv1","service_instance":"jeff1"}' -H "Content-Type: application/json" | ||
| + | </cli> | ||
| + | <code> | ||
| + | { | ||
| + | "storage_location":"76c978d7-3e92-7946-11b8-2f8dd0e56865", | ||
| + | "name":"testlockbucket", | ||
| + | "service_instance":"jeff1", | ||
| + | "acl": { | ||
| + | "jeff1@00000000-0000-0000-0000-000000000002":["FULL_CONTROL"] | ||
| + | }, | ||
| + | "retention_policy": { | ||
| + | "status":"COMPLIANCE", | ||
| + | "permanent_retention_enabled":false | ||
| + | }, | ||
| + | "hard_quota":0, | ||
| + | "time_created":"2024-06-21T07:38:25.146Z", | ||
| + | "time_updated":"2024-06-21T07:38:25.155Z", | ||
| + | "versioning_state":"Disabled", | ||
| + | "has_replication":"Not Present" | ||
| + | } | ||
| + | </code> | ||
| + | |||
| + | ==== check versioning status ==== | ||
| + | |||
| + | <cli prompt='%'> | ||
| + | % aws s3api get-bucket-versioning --endpoint-url http://10.10.64.98 --bucket testlockbucket --profile jeff-lab2 | ||
| + | </cli> | ||
| + | |||
| + | ==== enable versioning ==== | ||
| + | |||
| + | <cli prompt='%'> | ||
| + | % aws s3api put-bucket-versioning --endpoint-url http://10.10.64.98 --bucket testlockbucket --versioning-configuration | ||
| + | </cli> | ||
| + | <code> | ||
| + | Status=Enabled --profile jeff-lab2 | ||
| + | </code> | ||
| + | <cli prompt='%'> | ||
| + | % aws s3api get-bucket-versioning --endpoint-url http://10.10.64.98 --bucket testlockbucket --profile jeff-lab2 | ||
| + | </cli> | ||
| + | <code> | ||
| + | { | ||
| + | "Status": "Enabled" | ||
| + | } | ||
| + | </code> | ||
| + | |||
| + | ==== check object lock status ==== | ||
| + | |||
| + | <cli prompt='%'> | ||
| + | % aws s3api get-object-lock-configuration --endpoint-url http://10.10.64.98 --bucket testlockbucket --profile jeff-lab2 | ||
| + | </cli> | ||
| + | <code> | ||
| + | An error occurred (ObjectLockConfigurationNotFoundError) when calling the GetObjectLockConfiguration operation: | ||
| + | Object Lock configuration does not exist for this bucket | ||
| + | </code> | ||
| + | |||
| + | ==== enable object lock ==== | ||
| + | |||
| + | <cli prompt='%'> | ||
| + | % aws s3api put-object-lock-configuration --endpoint-url http://10.10.64.98 --bucket testlockbucket --object-lock-configuration ObjectLockEnabled=Enabled --profile jeff-lab2 | ||
| + | </cli> | ||
| + | <cli prompt='%'> | ||
| + | % aws s3api get-object-lock-configuration --endpoint-url http://10.10.64.98 --bucket testlockbucket --profile jeff-lab2 | ||
| + | </cli> | ||
| + | <code> | ||
| + | { | ||
| + | "ObjectLockConfiguration": { | ||
| + | "ObjectLockEnabled": "Enabled" | ||
| + | } | ||
| + | } | ||
| + | </code> | ||