Pool Placement and Storage Classes

Placement Targets

New in version Jewel.

Placement targets control which Pools are associated with a particularbucket. A bucket’s placement target is selected on creation, and cannot bemodified. The radosgw-admin bucket stats command will display itsplacement_rule.

The zonegroup configuration contains a list of placement targets with aninitial target named default-placement. The zone configuration then mapseach zonegroup placement target name onto its local storage. This zoneplacement information includes the index_pool name for the bucket index,the data_extra_pool name for metadata about incomplete multipart uploads,and a data_pool name for each storage class.

Storage Classes

New in version Nautilus.

Storage classes are used to customize the placement of object data. S3 BucketLifecycle rules can automate the transition of objects between storage classes.

Storage classes are defined in terms of placement targets. Each zonegroupplacement target lists its available storage classes with an initial classnamed STANDARD. The zone configuration is responsible for providing adata_pool pool name for each of the zonegroup’s storage classes.

Zonegroup/Zone Configuration

Placement configuration is performed with radosgw-admin commands onthe zonegroups and zones.

The zonegroup placement configuration can be queried with:

  1. $ radosgw-admin zonegroup get
  2. {
  3. "id": "ab01123f-e0df-4f29-9d71-b44888d67cd5",
  4. "name": "default",
  5. "api_name": "default",
  6. ...
  7. "placement_targets": [
  8. {
  9. "name": "default-placement",
  10. "tags": [],
  11. "storage_classes": [
  12. "STANDARD"
  13. ]
  14. }
  15. ],
  16. "default_placement": "default-placement",
  17. ...
  18. }

The zone placement configuration can be queried with:

  1. $ radosgw-admin zone get
  2. {
  3. "id": "557cdcee-3aae-4e9e-85c7-2f86f5eddb1f",
  4. "name": "default",
  5. "domain_root": "default.rgw.meta:root",
  6. ...
  7. "placement_pools": [
  8. {
  9. "key": "default-placement",
  10. "val": {
  11. "index_pool": "default.rgw.buckets.index",
  12. "storage_classes": {
  13. "STANDARD": {
  14. "data_pool": "default.rgw.buckets.data"
  15. }
  16. },
  17. "data_extra_pool": "default.rgw.buckets.non-ec",
  18. "index_type": 0
  19. }
  20. }
  21. ],
  22. ...
  23. }

Note

If you have not done any previous Multisite Configuration,a default zone and zonegroup are created for you, and changesto the zone/zonegroup will not take effect until the Ceph ObjectGateways are restarted. If you have created a realm for multisite,the zone/zonegroup changes will take effect once the changes arecommitted with radosgw-admin period update —commit.

Adding a Placement Target

To create a new placement target named temporary, start by adding it tothe zonegroup:

  1. $ radosgw-admin zonegroup placement add \
  2. --rgw-zonegroup default \
  3. --placement-id temporary

Then provide the zone placement info for that target:

  1. $ radosgw-admin zone placement add \
  2. --rgw-zone default \
  3. --placement-id temporary \
  4. --data-pool default.rgw.temporary.data \
  5. --index-pool default.rgw.temporary.index \
  6. --data-extra-pool default.rgw.temporary.non-ec

Adding a Storage Class

To add a new storage class named COLD to the default-placement target,start by adding it to the zonegroup:

  1. $ radosgw-admin zonegroup placement add \
  2. --rgw-zonegroup default \
  3. --placement-id default-placement \
  4. --storage-class COLD

Then provide the zone placement info for that storage class:

  1. $ radosgw-admin zone placement add \
  2. --rgw-zone default \
  3. --placement-id default-placement \
  4. --storage-class COLD \
  5. --data-pool default.rgw.cold.data \
  6. --compression lz4

Customizing Placement

Default Placement

By default, new buckets will use the zonegroup’s default_placement target.This zonegroup setting can be changed with:

  1. $ radosgw-admin zonegroup placement default \
  2. --rgw-zonegroup default \
  3. --placement-id new-placement

User Placement

A Ceph Object Gateway user can override the zonegroup’s default placementtarget by setting a non-empty default_placement field in the user info.Similarly, the default_storage_class can override the STANDARDstorage class applied to objects by default.

  1. $ radosgw-admin user info --uid testid
  2. {
  3. ...
  4. "default_placement": "",
  5. "default_storage_class": "",
  6. "placement_tags": [],
  7. ...
  8. }

If a zonegroup’s placement target contains any tags, users will be unableto create buckets with that placement target unless their user info containsat least one matching tag in its placement_tags field. This can be usefulto restrict access to certain types of storage.

The radosgw-admin command cannot modify these fields directly, so the jsonformat must be edited manually:

  1. $ radosgw-admin metadata get user:<user-id> > user.json
  2. $ vi user.json
  3. $ radosgw-admin metadata put user:<user-id> < user.json

S3 Bucket Placement

When creating a bucket with the S3 protocol, a placement target can beprovided as part of the LocationConstraint to override the default placementtargets from the user and zonegroup.

Normally, the LocationConstraint must match the zonegroup’s api_name:

  1. <LocationConstraint>default</LocationConstraint>

A custom placement target can be added to the api_name following a colon:

  1. <LocationConstraint>default:new-placement</LocationConstraint>

Swift Bucket Placement

When creating a bucket with the Swift protocol, a placement target can beprovided in the HTTP header X-Storage-Policy:

  1. X-Storage-Policy: new-placement

Using Storage Classes

All placement targets have a STANDARD storage class which is applied tonew objects by default. The user can override this default with itsdefault_storage_class.

To create an object in a non-default storage class, provide that storage classname in an HTTP header with the request. The S3 protocol uses theX-Amz-Storage-Class header, while the Swift protocol uses theX-Object-Storage-Class header.

S3 Object Lifecycle Management can then be used to move object data betweenstorage classes using Transition actions.