45Drives Knowledge Base
KB450472 - Intelligent Tiering with Lifecycle Management on Ceph (S3)
https://knowledgebase.45drives.com/kb/kb450472-intelligent-tiering-with-lifecycle-management-on-ceph-s3/

KB450472 - Intelligent Tiering with Lifecycle Management on Ceph (S3)

Posted on September 7, 2021 by Mitchell Hall


Scope/Description

Prerequisites

Steps

Creation of new storage class and pool

Note: If you only wish to create a rule that expires and deletes objects, rather than moving them to a new storage tier, this section can be skipped, and you can move directly to “Creating S3 lifecycle management policies”

root@labosd1:~# radosgw-admin zonegroup list

root@labosd1:~# radosgw-admin zone list

root@labosd1:~# radosgw-admin zonegroup placement list

Add a new storage class

root@labosd1:~# radosgw-admin zonegroup placement add \

--rgw-zonegroup default \

--placement-id default-placement \

--storage-class COLD

root@labosd1:~# radosgw-admin zone placement add \

--rgw-zone default \

--placement-id default-placement \

--storage-class COLD \

--data-pool default.rgw.cold.data \

--compression lz4

Creating S3 Lifecycle management policies

root@octrgw1:~# apt install s3cmd

root@octrgw1:~# s3cmd –configure

Lifecycle configuration

<LifecycleConfiguration>

  <Rule>

    <ID>Transition then Expire Rule</ID>

    <Filter>

       <Prefix></Prefix>

    </Filter>

    <Status>Enabled</Status>

    <Transition>

      <Days>30</Days>

      <StorageClass>COLD</StorageClass>

    </Transition>

    <Expiration>

      <Days>60</Days>

    </Expiration>

  </Rule>

</LifecycleConfiguration>
<LifecycleConfiguration>

  <Rule>

    <ID>Expire after 1 year</ID>

    <Filter>

       <Prefix></Prefix>

    </Filter>

    <Status>Enabled</Status>

    <Expiration>

      <Days>365</Days>

    </Expiration>

  </Rule>

</LifecycleConfiguration>
<LifecycleConfiguration>

  <Rule>

    <ID>Transition objects to COLD storage class</ID>

    <Filter>

       <Prefix></Prefix>

    </Filter>

    <Status>Enabled</Status>

    <Transition>

      <Days>30</Days>

      <StorageClass>COLD</StorageClass>

    </Transition>

  </Rule>

</LifecycleConfiguration>
<LifecycleConfiguration>

  <Rule>

    <ID>prefix expiration</ID>

    <Filter>

       <Prefix>dir1</Prefix>

    </Filter>

    <Status>Enabled</Status>

    <Expiration>

      <Days>120</Days>

    </Expiration>

    <Filter>

       <Prefix>dir2</Prefix>

    </Filter>

    <Status>Enabled</Status>

    <Expiration>

      <Days>60</Days>

    </Expiration>

  </Rule>

</LifecycleConfiguration>

 

root@octrgw1:~# s3cmd setlifecycle lifecycle-expire.xml s3://lifecycletest

root@octrgw1:~# s3cmd info s3://lifecycletest

When using transition rules instead of expire rules, s3cmd info will not properly list it. You will need a tool like S3 browser to view the lifecycle rule. S3 browser can also be used to create these rules. The only downside of using S3 Browser is that it does not allow the use of custom storage classes such as the use of “COLD”. It uses only standard Amazon S3 naming, so when using transition rather than expiration it is still better to use s3cmd and the XML files.

Verification

rgw lc debug interval = 60
root@octrgw1:~# systemctl restart ceph-radosgw@rgw.octrgw1

Troubleshooting

root@octrgw1:~# radosgw-admin lc list
root@octrgw1:~# radosgw-admin lc process