How to configure user- or bucket-specific data placement
There is some minimal documentation about the radosgw-admin 'zone/zonegroup placement' commands, and some documentation about the use of pools in radosgw. But there's nothing to describe how they fit together, how to add new placement targets, and how to configure specific users/buckets to use them.
This question was raised on the reddit.com/r/ceph, and I responded with these instructions:
The zonegroup contains a list of placement_targets, with default-placement as the initial/only target. The zone contains a list of placement_pools, which map placement targets from the zonegroup into specific pool names.
Assuming you leave the default-placement target as the safe/replicated pools, you'd want to add a new unsafe placement target to the zonegroup:
$ radosgw-admin zonegroup placement add --placement-id=unsafe
Then map that placement id to different pools in the zone config:
$ radosgw-admin zone placement add --placement-id=unsafe --index-pool=default.rgw.buckets.unsafe-index --data-pool=default.rgw.buckets.unsafe-data- --data-extra-pool=default.rgw.buckets.unsafe-non-ec
(note that the index-pool and data-extra-pool must not be erasure-coded, because they rely on omap)
You can then specify a default per-user placement target by setting the default_placement field of the user info. The radosgw-admin user modify command doesn't support setting this directly, so you'd have to resort to operating on the json format:
$ radosgw-admin metadata get user:<user-id> > user.json
$ vi user.json
$ radosgw-admin metadata put user:<user-id> < user.json
You can also specify a per-bucket placement target by adding a LocationConstraint to the PUT Bucket request. The format of this LocationConstraint would be api:placement-id, where api comes from the zonegroup's api_name field (and must be non-empty). This placement target would override any default_placement configured on the user.