❓ What?
Placement rules in Ceph are a method to assign a specific data pool, index pool and extra pools to a particular bucket. Placement rules are assigned to buckets at the time of creation and cannot be changed after creation. The default placement rule is called, default-placement
. It assigns a storage class called STANDARD
which links the default rados gateway data, index and non-ec pools.
Undocumented —storage-class flag
Currently, radosgw-admin
accepts an undocumented --storage-class
flag for changing the default storage class for a particular placement rule.
However, it does not do what it says, even though the default_placement
key now says default-placement/hot_storage_class
instead of just default-placement
. When new objects are uploaded to a bucket with that particular placement rule, they still goto the older default storage class STANDARD
.
Creating a New Placement Rule OR Changing what STANDARD means
However, this STANDARD
storage class can be configured to have custom pools during placement rule creation.
The new placement rule would look like this.
Changing Default Placement Rule for New Buckets
The default placement rule can be changed so that it can be auto selected during bucket creation (new buckets only). As previously mentioned, making the same placement rule with another storage class has no effect.
On the command-line it would look like:
❔ Why?
Placement rules establish a bucket (s3 lingo) to pool (ceph lingo) relationship, and are crucial for making sure buckets store data on the desired pools instead of on the default configured pools.
🎤 How?
Bucket Creation with Non-Default Placement Rule with croit
With croit, placement rules can be easily scrolled through during bucket creation:
Bucket Creation with Non-Default Placement Rule with AWS CLI
On the command line, it would look like this:
LocationConstraint
The
LocationConstraint
here withs3api
corresponds to thezonegroup
’sapi_name
and a custom placement rule can follow theapi_name
with a:
. This is just to point out the differences on how AWS S3 differs from Ceph S3.
The end result is the same with both the commands:
Changing Default Placement Rule for the user
A default placement rule with a default storage class can also be configured for a specific user like in the storage classes example.
👓 References
https://docs.ceph.com/en/reef/radosgw/placement/#s3-bucket-placement