]>
Commit | Line | Data |
---|---|---|
11fdf7f2 TL |
1 | ================================== |
2 | Pool Placement and Storage Classes | |
3 | ================================== | |
a8e16298 TL |
4 | |
5 | .. contents:: | |
6 | ||
7 | Placement Targets | |
8 | ================= | |
9 | ||
10 | .. versionadded:: Jewel | |
11 | ||
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 | |
15 | ``placement_rule``. | |
16 | ||
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, | |
11fdf7f2 TL |
22 | and a ``data_pool`` name for each storage class. |
23 | ||
24 | .. _storage_classes: | |
25 | ||
26 | Storage Classes | |
27 | =============== | |
28 | ||
29 | .. versionadded:: Nautilus | |
30 | ||
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. | |
33 | ||
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. | |
a8e16298 TL |
38 | |
39 | Zonegroup/Zone Configuration | |
40 | ============================ | |
41 | ||
42 | Placement configuration is performed with ``radosgw-admin`` commands on | |
43 | the zonegroups and zones. | |
44 | ||
45 | The zonegroup placement configuration can be queried with: | |
46 | ||
47 | :: | |
48 | ||
49 | $ radosgw-admin zonegroup get | |
50 | { | |
51 | "id": "ab01123f-e0df-4f29-9d71-b44888d67cd5", | |
52 | "name": "default", | |
53 | "api_name": "default", | |
54 | ... | |
55 | "placement_targets": [ | |
56 | { | |
57 | "name": "default-placement", | |
58 | "tags": [], | |
11fdf7f2 TL |
59 | "storage_classes": [ |
60 | "STANDARD" | |
61 | ] | |
a8e16298 TL |
62 | } |
63 | ], | |
64 | "default_placement": "default-placement", | |
65 | ... | |
66 | } | |
67 | ||
68 | The zone placement configuration can be queried with: | |
69 | ||
70 | :: | |
71 | ||
72 | $ radosgw-admin zone get | |
73 | { | |
74 | "id": "557cdcee-3aae-4e9e-85c7-2f86f5eddb1f", | |
75 | "name": "default", | |
76 | "domain_root": "default.rgw.meta:root", | |
77 | ... | |
78 | "placement_pools": [ | |
79 | { | |
80 | "key": "default-placement", | |
81 | "val": { | |
82 | "index_pool": "default.rgw.buckets.index", | |
11fdf7f2 TL |
83 | "storage_classes": { |
84 | "STANDARD": { | |
85 | "data_pool": "default.rgw.buckets.data" | |
86 | } | |
87 | }, | |
a8e16298 TL |
88 | "data_extra_pool": "default.rgw.buckets.non-ec", |
89 | "index_type": 0 | |
90 | } | |
91 | } | |
92 | ], | |
93 | ... | |
94 | } | |
95 | ||
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``. | |
102 | ||
103 | Adding a Placement Target | |
104 | ------------------------- | |
105 | ||
106 | To create a new placement target named ``temporary``, start by adding it to | |
107 | the zonegroup: | |
108 | ||
109 | :: | |
110 | ||
111 | $ radosgw-admin zonegroup placement add \ | |
112 | --rgw-zonegroup default \ | |
113 | --placement-id temporary | |
114 | ||
115 | Then provide the zone placement info for that target: | |
116 | ||
117 | :: | |
118 | ||
119 | $ radosgw-admin zone placement add \ | |
120 | --rgw-zone default \ | |
121 | --placement-id temporary \ | |
122 | --data-pool default.rgw.temporary.data \ | |
123 | --index-pool default.rgw.temporary.index \ | |
11fdf7f2 TL |
124 | --data-extra-pool default.rgw.temporary.non-ec |
125 | ||
126 | Adding a Storage Class | |
127 | ---------------------- | |
128 | ||
129 | To add a new storage class named ``COLD`` to the ``default-placement`` target, | |
130 | start by adding it to the zonegroup: | |
131 | ||
132 | :: | |
133 | ||
134 | $ radosgw-admin zonegroup placement add \ | |
135 | --rgw-zonegroup default \ | |
136 | --placement-id default-placement \ | |
137 | --storage-class COLD | |
138 | ||
139 | Then provide the zone placement info for that storage class: | |
140 | ||
141 | :: | |
142 | ||
143 | $ radosgw-admin zone placement add \ | |
144 | --rgw-zone default \ | |
145 | --placement-id default-placement \ | |
146 | --storage-class COLD \ | |
147 | --data-pool default.rgw.cold.data \ | |
a8e16298 TL |
148 | --compression lz4 |
149 | ||
150 | Customizing Placement | |
151 | ===================== | |
152 | ||
153 | Default Placement | |
154 | ----------------- | |
155 | ||
156 | By default, new buckets will use the zonegroup's ``default_placement`` target. | |
157 | This zonegroup setting can be changed with: | |
158 | ||
159 | :: | |
160 | ||
161 | $ radosgw-admin zonegroup placement default \ | |
162 | --rgw-zonegroup default \ | |
163 | --placement-id new-placement | |
164 | ||
165 | User Placement | |
166 | -------------- | |
167 | ||
168 | A Ceph Object Gateway user can override the zonegroup's default placement | |
169 | target by setting a non-empty ``default_placement`` field in the user info. | |
11fdf7f2 TL |
170 | Similarly, the ``default_storage_class`` can override the ``STANDARD`` |
171 | storage class applied to objects by default. | |
a8e16298 TL |
172 | |
173 | :: | |
174 | ||
175 | $ radosgw-admin user info --uid testid | |
176 | { | |
177 | ... | |
178 | "default_placement": "", | |
11fdf7f2 | 179 | "default_storage_class": "", |
a8e16298 TL |
180 | "placement_tags": [], |
181 | ... | |
182 | } | |
183 | ||
184 | If a zonegroup's placement target contains any ``tags``, users will be unable | |
185 | to create buckets with that placement target unless their user info contains | |
186 | at least one matching tag in its ``placement_tags`` field. This can be useful | |
187 | to restrict access to certain types of storage. | |
188 | ||
9f95a23c | 189 | The ``radosgw-admin`` command can modify these fields directly with: |
a8e16298 TL |
190 | |
191 | :: | |
192 | ||
9f95a23c TL |
193 | $ radosgw-admin user modify \ |
194 | --uid <user-id> \ | |
195 | --placement-id <default-placement-id> \ | |
196 | --storage-class <default-storage-class> \ | |
197 | --tags <tag1,tag2> | |
a8e16298 | 198 | |
81eedcae TL |
199 | .. _s3_bucket_placement: |
200 | ||
a8e16298 TL |
201 | S3 Bucket Placement |
202 | ------------------- | |
203 | ||
204 | When creating a bucket with the S3 protocol, a placement target can be | |
205 | provided as part of the LocationConstraint to override the default placement | |
206 | targets from the user and zonegroup. | |
207 | ||
208 | Normally, the LocationConstraint must match the zonegroup's ``api_name``: | |
209 | ||
210 | :: | |
211 | ||
212 | <LocationConstraint>default</LocationConstraint> | |
213 | ||
214 | A custom placement target can be added to the ``api_name`` following a colon: | |
215 | ||
216 | :: | |
217 | ||
218 | <LocationConstraint>default:new-placement</LocationConstraint> | |
219 | ||
220 | Swift Bucket Placement | |
221 | ---------------------- | |
222 | ||
223 | When creating a bucket with the Swift protocol, a placement target can be | |
224 | provided in the HTTP header ``X-Storage-Policy``: | |
225 | ||
226 | :: | |
227 | ||
228 | X-Storage-Policy: new-placement | |
229 | ||
11fdf7f2 TL |
230 | Using Storage Classes |
231 | ===================== | |
232 | ||
233 | All placement targets have a ``STANDARD`` storage class which is applied to | |
234 | new objects by default. The user can override this default with its | |
235 | ``default_storage_class``. | |
236 | ||
237 | To create an object in a non-default storage class, provide that storage class | |
238 | name in an HTTP header with the request. The S3 protocol uses the | |
239 | ``X-Amz-Storage-Class`` header, while the Swift protocol uses the | |
240 | ``X-Object-Storage-Class`` header. | |
241 | ||
242 | S3 Object Lifecycle Management can then be used to move object data between | |
243 | storage classes using ``Transition`` actions. | |
244 | ||
a8e16298 TL |
245 | .. _`Pools`: ../pools |
246 | .. _`Multisite Configuration`: ../multisite |