1 ==================================
2 Pool Placement and Storage Classes
3 ==================================
10 .. versionadded:: Jewel
12 Placement targets control which `Pools`_ are associated with a particular
13 bucket. A bucket's placement target is selected on creation, and cannot be
14 modified. The ``radosgw-admin bucket stats`` command will display its
17 The zonegroup configuration contains a list of placement targets with an
18 initial target named ``default-placement``. The zone configuration then maps
19 each zonegroup placement target name onto its local storage. This zone
20 placement information includes the ``index_pool`` name for the bucket index,
21 the ``data_extra_pool`` name for metadata about incomplete multipart uploads,
22 and a ``data_pool`` name for each storage class.
29 .. versionadded:: Nautilus
31 Storage classes are used to customize the placement of object data. S3 Bucket
32 Lifecycle rules can automate the transition of objects between storage classes.
34 Storage classes are defined in terms of placement targets. Each zonegroup
35 placement target lists its available storage classes with an initial class
36 named ``STANDARD``. The zone configuration is responsible for providing a
37 ``data_pool`` pool name for each of the zonegroup's storage classes.
39 Zonegroup/Zone Configuration
40 ============================
42 Placement configuration is performed with ``radosgw-admin`` commands on
43 the zonegroups and zones.
45 The zonegroup placement configuration can be queried with:
49 $ radosgw-admin zonegroup get
51 "id": "ab01123f-e0df-4f29-9d71-b44888d67cd5",
53 "api_name": "default",
55 "placement_targets": [
57 "name": "default-placement",
64 "default_placement": "default-placement",
68 The zone placement configuration can be queried with:
72 $ radosgw-admin zone get
74 "id": "557cdcee-3aae-4e9e-85c7-2f86f5eddb1f",
76 "domain_root": "default.rgw.meta:root",
80 "key": "default-placement",
82 "index_pool": "default.rgw.buckets.index",
85 "data_pool": "default.rgw.buckets.data"
88 "data_extra_pool": "default.rgw.buckets.non-ec",
96 .. note:: If you have not done any previous `Multisite Configuration`_,
97 a ``default`` zone and zonegroup are created for you, and changes
98 to the zone/zonegroup will not take effect until the Ceph Object
99 Gateways are restarted. If you have created a realm for multisite,
100 the zone/zonegroup changes will take effect once the changes are
101 committed with ``radosgw-admin period update --commit``.
103 Adding a Placement Target
104 -------------------------
106 To create a new placement target named ``temporary``, start by adding it to
111 $ radosgw-admin zonegroup placement add \
112 --rgw-zonegroup default \
113 --placement-id temporary
115 Then provide the zone placement info for that target:
119 $ radosgw-admin zone placement add \
121 --placement-id temporary \
122 --data-pool default.rgw.temporary.data \
123 --index-pool default.rgw.temporary.index \
124 --data-extra-pool default.rgw.temporary.non-ec
126 .. _adding_a_storage_class:
128 Adding a Storage Class
129 ----------------------
131 To add a new storage class named ``GLACIER`` to the ``default-placement`` target,
132 start by adding it to the zonegroup:
136 $ radosgw-admin zonegroup placement add \
137 --rgw-zonegroup default \
138 --placement-id default-placement \
139 --storage-class GLACIER
141 Then provide the zone placement info for that storage class:
145 $ radosgw-admin zone placement add \
147 --placement-id default-placement \
148 --storage-class GLACIER \
149 --data-pool default.rgw.glacier.data \
152 Customizing Placement
153 =====================
158 By default, new buckets will use the zonegroup's ``default_placement`` target.
159 This zonegroup setting can be changed with:
163 $ radosgw-admin zonegroup placement default \
164 --rgw-zonegroup default \
165 --placement-id new-placement
170 A Ceph Object Gateway user can override the zonegroup's default placement
171 target by setting a non-empty ``default_placement`` field in the user info.
172 Similarly, the ``default_storage_class`` can override the ``STANDARD``
173 storage class applied to objects by default.
177 $ radosgw-admin user info --uid testid
180 "default_placement": "",
181 "default_storage_class": "",
182 "placement_tags": [],
186 If a zonegroup's placement target contains any ``tags``, users will be unable
187 to create buckets with that placement target unless their user info contains
188 at least one matching tag in its ``placement_tags`` field. This can be useful
189 to restrict access to certain types of storage.
191 The ``radosgw-admin`` command can modify these fields directly with:
195 $ radosgw-admin user modify \
197 --placement-id <default-placement-id> \
198 --storage-class <default-storage-class> \
201 .. _s3_bucket_placement:
206 When creating a bucket with the S3 protocol, a placement target can be
207 provided as part of the LocationConstraint to override the default placement
208 targets from the user and zonegroup.
210 Normally, the LocationConstraint must match the zonegroup's ``api_name``:
214 <LocationConstraint>default</LocationConstraint>
216 A custom placement target can be added to the ``api_name`` following a colon:
220 <LocationConstraint>default:new-placement</LocationConstraint>
222 Swift Bucket Placement
223 ----------------------
225 When creating a bucket with the Swift protocol, a placement target can be
226 provided in the HTTP header ``X-Storage-Policy``:
230 X-Storage-Policy: new-placement
232 Using Storage Classes
233 =====================
235 All placement targets have a ``STANDARD`` storage class which is applied to
236 new objects by default. The user can override this default with its
237 ``default_storage_class``.
239 To create an object in a non-default storage class, provide that storage class
240 name in an HTTP header with the request. The S3 protocol uses the
241 ``X-Amz-Storage-Class`` header, while the Swift protocol uses the
242 ``X-Object-Storage-Class`` header.
244 When using AWS S3 SDKs such as ``boto3``, it is important that non-default
245 storage class names match those provided by AWS S3, or else the SDK
246 will drop the request and raise an exception.
248 S3 Object Lifecycle Management can then be used to move object data between
249 storage classes using ``Transition`` actions.
251 .. _`Pools`: ../pools
252 .. _`Multisite Configuration`: ../multisite