]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | ls on empty pool never containing images |
2 | ======================================== | |
3 | $ ceph osd pool create rbd_other 8 | |
4 | pool 'rbd_other' created | |
d2e6a577 | 5 | $ rbd pool init rbd_other |
7c673cae FG |
6 | $ rados -p rbd rm rbd_directory >/dev/null 2>&1 || true |
7 | $ rbd ls | |
8 | $ rbd ls --format json | |
9 | [] (no-eol) | |
10 | $ rbd ls --format xml | |
11 | <images></images> (no-eol) | |
12 | ||
13 | create | |
14 | ======= | |
15 | $ rbd create -s 1024 --image-format 1 foo | |
16 | rbd: image format 1 is deprecated | |
17 | $ rbd create -s 512 --image-format 2 bar | |
18 | $ rbd create -s 2048 --image-format 2 --image-feature layering baz | |
19 | $ rbd create -s 1 --image-format 1 quux | |
20 | rbd: image format 1 is deprecated | |
21 | $ rbd create -s 1G --image-format 2 quuy | |
22 | ||
23 | snapshot | |
24 | ======== | |
25 | $ rbd snap create bar@snap | |
26 | $ rbd resize -s 1024 --no-progress bar | |
27 | $ rbd resize -s 2G --no-progress quuy | |
28 | $ rbd snap create bar@snap2 | |
29 | $ rbd snap create foo@snap | |
30 | ||
31 | clone | |
32 | ===== | |
33 | $ rbd snap protect bar@snap | |
34 | $ rbd clone --image-feature layering,exclusive-lock,object-map,fast-diff bar@snap rbd_other/child | |
35 | $ rbd snap create rbd_other/child@snap | |
36 | $ rbd flatten rbd_other/child 2> /dev/null | |
37 | $ rbd bench rbd_other/child --io-type write --io-pattern seq --io-total 1B > /dev/null 2>&1 | |
38 | $ rbd clone bar@snap rbd_other/deep-flatten-child | |
39 | $ rbd snap create rbd_other/deep-flatten-child@snap | |
40 | $ rbd flatten rbd_other/deep-flatten-child 2> /dev/null | |
41 | ||
42 | lock | |
43 | ==== | |
44 | $ rbd lock add quux id | |
45 | $ rbd lock add baz id1 --shared tag | |
46 | $ rbd lock add baz id2 --shared tag | |
47 | $ rbd lock add baz id3 --shared tag | |
48 | ||
49 | test formatting | |
50 | =============== | |
51 | $ rbd children foo@snap | |
52 | $ rbd children bar@snap | |
53 | rbd_other/child | |
54 | $ rbd children bar@snap2 | |
55 | TODO: figure out why .* does not match the block_name_prefix line in rbd info. | |
56 | For now, use a more inclusive regex. | |
57 | $ rbd info foo | |
58 | rbd image 'foo': | |
59 | \tsize 1024 MB in 256 objects (esc) | |
60 | \torder 22 (4096 kB objects) (esc) | |
61 | [^^]+ (re) | |
62 | \tformat: 1 (esc) | |
63 | $ rbd info foo --format json | python -mjson.tool | sed 's/,$/, /' | |
64 | { | |
65 | "block_name_prefix": "rb.0.*", (glob) | |
66 | "format": 1, | |
67 | "name": "foo", | |
68 | "object_size": 4194304, | |
69 | "objects": 256, | |
70 | "order": 22, | |
71 | "size": 1073741824 | |
72 | } | |
73 | The version of xml_pp included in ubuntu precise always prints a 'warning' | |
74 | whenever it is run. grep -v to ignore it, but still work on other distros. | |
75 | $ rbd info foo --format xml | xml_pp 2>&1 | grep -v '^new version at /usr/bin/xml_pp' | |
76 | <image> | |
77 | <name>foo</name> | |
78 | <size>1073741824</size> | |
79 | <objects>256</objects> | |
80 | <order>22</order> | |
81 | <object_size>4194304</object_size> | |
82 | <block_name_prefix>rb.0.*</block_name_prefix> (glob) | |
83 | <format>1</format> | |
84 | </image> | |
85 | $ rbd info foo@snap | |
86 | rbd image 'foo': | |
87 | \tsize 1024 MB in 256 objects (esc) | |
88 | \torder 22 (4096 kB objects) (esc) | |
89 | [^^]+ (re) | |
90 | \tformat: 1 (esc) | |
91 | \tprotected: False (esc) | |
92 | $ rbd info foo@snap --format json | python -mjson.tool | sed 's/,$/, /' | |
93 | { | |
94 | "block_name_prefix": "rb.0.*", (glob) | |
95 | "format": 1, | |
96 | "name": "foo", | |
97 | "object_size": 4194304, | |
98 | "objects": 256, | |
99 | "order": 22, | |
100 | "protected": "false", | |
101 | "size": 1073741824 | |
102 | } | |
103 | $ rbd info foo@snap --format xml | xml_pp 2>&1 | grep -v '^new version at /usr/bin/xml_pp' | |
104 | <image> | |
105 | <name>foo</name> | |
106 | <size>1073741824</size> | |
107 | <objects>256</objects> | |
108 | <order>22</order> | |
109 | <object_size>4194304</object_size> | |
110 | <block_name_prefix>rb.0*</block_name_prefix> (glob) | |
111 | <format>1</format> | |
112 | <protected>false</protected> | |
113 | </image> | |
114 | $ rbd info bar | |
115 | rbd image 'bar': | |
116 | \tsize 1024 MB in 256 objects (esc) | |
117 | \torder 22 (4096 kB objects) (esc) | |
118 | [^^]+ (re) | |
119 | \tformat: 2 (esc) | |
120 | \tfeatures: layering, exclusive-lock, object-map, fast-diff, deep-flatten (esc) | |
121 | \tflags: (esc) | |
31f18b77 | 122 | \tcreate_timestamp:* (glob) |
7c673cae FG |
123 | $ rbd info bar --format json | python -mjson.tool | sed 's/,$/, /' |
124 | { | |
125 | "block_name_prefix": "rbd_data.*", (glob) | |
31f18b77 | 126 | "create_timestamp": "*", (glob) |
7c673cae FG |
127 | "features": [ |
128 | "layering", | |
129 | "exclusive-lock", | |
130 | "object-map", | |
131 | "fast-diff", | |
132 | "deep-flatten" | |
133 | ], | |
134 | "flags": [], | |
135 | "format": 2, | |
136 | "name": "bar", | |
137 | "object_size": 4194304, | |
138 | "objects": 256, | |
139 | "order": 22, | |
140 | "size": 1073741824 | |
141 | } | |
142 | $ rbd info bar --format xml | xml_pp 2>&1 | grep -v '^new version at /usr/bin/xml_pp' | |
143 | <image> | |
144 | <name>bar</name> | |
145 | <size>1073741824</size> | |
146 | <objects>256</objects> | |
147 | <order>22</order> | |
148 | <object_size>4194304</object_size> | |
149 | <block_name_prefix>rbd_data.*</block_name_prefix> (glob) | |
150 | <format>2</format> | |
151 | <features> | |
152 | <feature>layering</feature> | |
153 | <feature>exclusive-lock</feature> | |
154 | <feature>object-map</feature> | |
155 | <feature>fast-diff</feature> | |
156 | <feature>deep-flatten</feature> | |
157 | </features> | |
158 | <flags></flags> | |
31f18b77 | 159 | <create_timestamp>*</create_timestamp> (glob) |
7c673cae FG |
160 | </image> |
161 | $ rbd info bar@snap | |
162 | rbd image 'bar': | |
163 | \tsize 512 MB in 128 objects (esc) | |
164 | \torder 22 (4096 kB objects) (esc) | |
165 | [^^]+ (re) | |
166 | \tformat: 2 (esc) | |
167 | \tfeatures: layering, exclusive-lock, object-map, fast-diff, deep-flatten (esc) | |
168 | \tflags: (esc) | |
31f18b77 | 169 | \tcreate_timestamp:* (glob) |
7c673cae FG |
170 | \tprotected: True (esc) |
171 | $ rbd info bar@snap --format json | python -mjson.tool | sed 's/,$/, /' | |
172 | { | |
173 | "block_name_prefix": "rbd_data.*", (glob) | |
31f18b77 | 174 | "create_timestamp": "*", (glob) |
7c673cae FG |
175 | "features": [ |
176 | "layering", | |
177 | "exclusive-lock", | |
178 | "object-map", | |
179 | "fast-diff", | |
180 | "deep-flatten" | |
181 | ], | |
182 | "flags": [], | |
183 | "format": 2, | |
184 | "name": "bar", | |
185 | "object_size": 4194304, | |
186 | "objects": 128, | |
187 | "order": 22, | |
188 | "protected": "true", | |
189 | "size": 536870912 | |
190 | } | |
191 | $ rbd info bar@snap --format xml | xml_pp 2>&1 | grep -v '^new version at /usr/bin/xml_pp' | |
192 | <image> | |
193 | <name>bar</name> | |
194 | <size>536870912</size> | |
195 | <objects>128</objects> | |
196 | <order>22</order> | |
197 | <object_size>4194304</object_size> | |
198 | <block_name_prefix>rbd_data.*</block_name_prefix> (glob) | |
199 | <format>2</format> | |
200 | <features> | |
201 | <feature>layering</feature> | |
202 | <feature>exclusive-lock</feature> | |
203 | <feature>object-map</feature> | |
204 | <feature>fast-diff</feature> | |
205 | <feature>deep-flatten</feature> | |
206 | </features> | |
207 | <flags></flags> | |
31f18b77 | 208 | <create_timestamp>*</create_timestamp> (glob) |
7c673cae FG |
209 | <protected>true</protected> |
210 | </image> | |
211 | $ rbd info bar@snap2 | |
212 | rbd image 'bar': | |
213 | \tsize 1024 MB in 256 objects (esc) | |
214 | \torder 22 (4096 kB objects) (esc) | |
215 | [^^]+ (re) | |
216 | \tformat: 2 (esc) | |
217 | \tfeatures: layering, exclusive-lock, object-map, fast-diff, deep-flatten (esc) | |
218 | \tflags: (esc) | |
31f18b77 | 219 | \tcreate_timestamp:* (glob) |
7c673cae FG |
220 | \tprotected: False (esc) |
221 | $ rbd info bar@snap2 --format json | python -mjson.tool | sed 's/,$/, /' | |
222 | { | |
223 | "block_name_prefix": "rbd_data.*", (glob) | |
31f18b77 | 224 | "create_timestamp": "*", (glob) |
7c673cae FG |
225 | "features": [ |
226 | "layering", | |
227 | "exclusive-lock", | |
228 | "object-map", | |
229 | "fast-diff", | |
230 | "deep-flatten" | |
231 | ], | |
232 | "flags": [], | |
233 | "format": 2, | |
234 | "name": "bar", | |
235 | "object_size": 4194304, | |
236 | "objects": 256, | |
237 | "order": 22, | |
238 | "protected": "false", | |
239 | "size": 1073741824 | |
240 | } | |
241 | $ rbd info bar@snap2 --format xml | xml_pp 2>&1 | grep -v '^new version at /usr/bin/xml_pp' | |
242 | <image> | |
243 | <name>bar</name> | |
244 | <size>1073741824</size> | |
245 | <objects>256</objects> | |
246 | <order>22</order> | |
247 | <object_size>4194304</object_size> | |
248 | <block_name_prefix>rbd_data.*</block_name_prefix> (glob) | |
249 | <format>2</format> | |
250 | <features> | |
251 | <feature>layering</feature> | |
252 | <feature>exclusive-lock</feature> | |
253 | <feature>object-map</feature> | |
254 | <feature>fast-diff</feature> | |
255 | <feature>deep-flatten</feature> | |
256 | </features> | |
257 | <flags></flags> | |
31f18b77 | 258 | <create_timestamp>*</create_timestamp> (glob) |
7c673cae FG |
259 | <protected>false</protected> |
260 | </image> | |
261 | $ rbd info baz | |
262 | rbd image 'baz': | |
263 | \tsize 2048 MB in 512 objects (esc) | |
264 | \torder 22 (4096 kB objects) (esc) | |
265 | [^^]+ (re) | |
266 | \tformat: 2 (esc) | |
267 | \tfeatures: layering (esc) | |
268 | \tflags: (esc) | |
31f18b77 | 269 | \tcreate_timestamp:* (glob) |
7c673cae FG |
270 | $ rbd info baz --format json | python -mjson.tool | sed 's/,$/, /' |
271 | { | |
272 | "block_name_prefix": "rbd_data.*", (glob) | |
31f18b77 | 273 | "create_timestamp": "*", (glob) |
7c673cae FG |
274 | "features": [ |
275 | "layering" | |
276 | ], | |
277 | "flags": [], | |
278 | "format": 2, | |
279 | "name": "baz", | |
280 | "object_size": 4194304, | |
281 | "objects": 512, | |
282 | "order": 22, | |
283 | "size": 2147483648 | |
284 | } | |
285 | $ rbd info baz --format xml | xml_pp 2>&1 | grep -v '^new version at /usr/bin/xml_pp' | |
286 | <image> | |
287 | <name>baz</name> | |
288 | <size>2147483648</size> | |
289 | <objects>512</objects> | |
290 | <order>22</order> | |
291 | <object_size>4194304</object_size> | |
292 | <block_name_prefix>rbd_data.*</block_name_prefix> (glob) | |
293 | <format>2</format> | |
294 | <features> | |
295 | <feature>layering</feature> | |
296 | </features> | |
297 | <flags></flags> | |
31f18b77 | 298 | <create_timestamp>*</create_timestamp> (glob) |
7c673cae FG |
299 | </image> |
300 | $ rbd info quux | |
301 | rbd image 'quux': | |
302 | \tsize 1024 kB in 1 objects (esc) | |
303 | \torder 22 (4096 kB objects) (esc) | |
304 | [^^]+ (re) | |
305 | \tformat: 1 (esc) | |
306 | $ rbd info quux --format json | python -mjson.tool | sed 's/,$/, /' | |
307 | { | |
308 | "block_name_prefix": "rb.0.*", (glob) | |
309 | "format": 1, | |
310 | "name": "quux", | |
311 | "object_size": 4194304, | |
312 | "objects": 1, | |
313 | "order": 22, | |
314 | "size": 1048576 | |
315 | } | |
316 | $ rbd info quux --format xml | xml_pp 2>&1 | grep -v '^new version at /usr/bin/xml_pp' | |
317 | <image> | |
318 | <name>quux</name> | |
319 | <size>1048576</size> | |
320 | <objects>1</objects> | |
321 | <order>22</order> | |
322 | <object_size>4194304</object_size> | |
323 | <block_name_prefix>rb.0.*</block_name_prefix> (glob) | |
324 | <format>1</format> | |
325 | </image> | |
326 | $ rbd info rbd_other/child | |
327 | rbd image 'child': | |
328 | \tsize 512 MB in 128 objects (esc) | |
329 | \torder 22 (4096 kB objects) (esc) | |
330 | [^^]+ (re) | |
331 | \tformat: 2 (esc) | |
332 | \tfeatures: layering, exclusive-lock, object-map, fast-diff (esc) | |
333 | \tflags: (esc) | |
31f18b77 | 334 | \tcreate_timestamp:* (glob) |
7c673cae FG |
335 | $ rbd info rbd_other/child --format json | python -mjson.tool | sed 's/,$/, /' |
336 | { | |
337 | "block_name_prefix": "rbd_data.*", (glob) | |
31f18b77 | 338 | "create_timestamp": "*", (glob) |
7c673cae FG |
339 | "features": [ |
340 | "layering", | |
341 | "exclusive-lock", | |
342 | "object-map", | |
343 | "fast-diff" | |
344 | ], | |
345 | "flags": [], | |
346 | "format": 2, | |
347 | "name": "child", | |
348 | "object_size": 4194304, | |
349 | "objects": 128, | |
350 | "order": 22, | |
351 | "size": 536870912 | |
352 | } | |
353 | $ rbd info rbd_other/child --format xml | xml_pp 2>&1 | grep -v '^new version at /usr/bin/xml_pp' | |
354 | <image> | |
355 | <name>child</name> | |
356 | <size>536870912</size> | |
357 | <objects>128</objects> | |
358 | <order>22</order> | |
359 | <object_size>4194304</object_size> | |
360 | <block_name_prefix>rbd_data.*</block_name_prefix> (glob) | |
361 | <format>2</format> | |
362 | <features> | |
363 | <feature>layering</feature> | |
364 | <feature>exclusive-lock</feature> | |
365 | <feature>object-map</feature> | |
366 | <feature>fast-diff</feature> | |
367 | </features> | |
368 | <flags></flags> | |
31f18b77 | 369 | <create_timestamp>*</create_timestamp> (glob) |
7c673cae FG |
370 | </image> |
371 | $ rbd info rbd_other/child@snap | |
372 | rbd image 'child': | |
373 | \tsize 512 MB in 128 objects (esc) | |
374 | \torder 22 (4096 kB objects) (esc) | |
375 | [^^]+ (re) | |
376 | \tformat: 2 (esc) | |
377 | \tfeatures: layering, exclusive-lock, object-map, fast-diff (esc) | |
378 | \tflags: (esc) | |
31f18b77 | 379 | \tcreate_timestamp:* (glob) |
7c673cae FG |
380 | \tprotected: False (esc) |
381 | \tparent: rbd/bar@snap (esc) | |
382 | \toverlap: 512 MB (esc) | |
383 | $ rbd info rbd_other/child@snap --format json | python -mjson.tool | sed 's/,$/, /' | |
384 | { | |
385 | "block_name_prefix": "rbd_data.*", (glob) | |
31f18b77 | 386 | "create_timestamp": "*", (glob) |
7c673cae FG |
387 | "features": [ |
388 | "layering", | |
389 | "exclusive-lock", | |
390 | "object-map", | |
391 | "fast-diff" | |
392 | ], | |
393 | "flags": [], | |
394 | "format": 2, | |
395 | "name": "child", | |
396 | "object_size": 4194304, | |
397 | "objects": 128, | |
398 | "order": 22, | |
399 | "parent": { | |
400 | "image": "bar", | |
401 | "overlap": 536870912, | |
402 | "pool": "rbd", | |
403 | "snapshot": "snap" | |
404 | }, | |
405 | "protected": "false", | |
406 | "size": 536870912 | |
407 | } | |
408 | $ rbd info rbd_other/child@snap --format xml | xml_pp 2>&1 | grep -v '^new version at /usr/bin/xml_pp' | |
409 | <image> | |
410 | <name>child</name> | |
411 | <size>536870912</size> | |
412 | <objects>128</objects> | |
413 | <order>22</order> | |
414 | <object_size>4194304</object_size> | |
415 | <block_name_prefix>rbd_data.*</block_name_prefix> (glob) | |
416 | <format>2</format> | |
417 | <features> | |
418 | <feature>layering</feature> | |
419 | <feature>exclusive-lock</feature> | |
420 | <feature>object-map</feature> | |
421 | <feature>fast-diff</feature> | |
422 | </features> | |
423 | <flags></flags> | |
31f18b77 | 424 | <create_timestamp>*</create_timestamp> (glob) |
7c673cae FG |
425 | <protected>false</protected> |
426 | <parent> | |
427 | <pool>rbd</pool> | |
428 | <image>bar</image> | |
429 | <snapshot>snap</snapshot> | |
430 | <overlap>536870912</overlap> | |
431 | </parent> | |
432 | </image> | |
433 | $ rbd info rbd_other/deep-flatten-child | |
434 | rbd image 'deep-flatten-child': | |
435 | \tsize 512 MB in 128 objects (esc) | |
436 | \torder 22 (4096 kB objects) (esc) | |
437 | [^^]+ (re) | |
438 | \tformat: 2 (esc) | |
439 | \tfeatures: layering, exclusive-lock, object-map, fast-diff, deep-flatten (esc) | |
440 | \tflags: (esc) | |
31f18b77 | 441 | \tcreate_timestamp:* (glob) |
7c673cae FG |
442 | $ rbd info rbd_other/deep-flatten-child --format json | python -mjson.tool | sed 's/,$/, /' |
443 | { | |
444 | "block_name_prefix": "rbd_data.*", (glob) | |
31f18b77 | 445 | "create_timestamp": "*", (glob) |
7c673cae FG |
446 | "features": [ |
447 | "layering", | |
448 | "exclusive-lock", | |
449 | "object-map", | |
450 | "fast-diff", | |
451 | "deep-flatten" | |
452 | ], | |
453 | "flags": [], | |
454 | "format": 2, | |
455 | "name": "deep-flatten-child", | |
456 | "object_size": 4194304, | |
457 | "objects": 128, | |
458 | "order": 22, | |
459 | "size": 536870912 | |
460 | } | |
461 | $ rbd info rbd_other/deep-flatten-child --format xml | xml_pp 2>&1 | grep -v '^new version at /usr/bin/xml_pp' | |
462 | <image> | |
463 | <name>deep-flatten-child</name> | |
464 | <size>536870912</size> | |
465 | <objects>128</objects> | |
466 | <order>22</order> | |
467 | <object_size>4194304</object_size> | |
468 | <block_name_prefix>rbd_data.*</block_name_prefix> (glob) | |
469 | <format>2</format> | |
470 | <features> | |
471 | <feature>layering</feature> | |
472 | <feature>exclusive-lock</feature> | |
473 | <feature>object-map</feature> | |
474 | <feature>fast-diff</feature> | |
475 | <feature>deep-flatten</feature> | |
476 | </features> | |
477 | <flags></flags> | |
31f18b77 | 478 | <create_timestamp>*</create_timestamp> (glob) |
7c673cae FG |
479 | </image> |
480 | $ rbd info rbd_other/deep-flatten-child@snap | |
481 | rbd image 'deep-flatten-child': | |
482 | \tsize 512 MB in 128 objects (esc) | |
483 | \torder 22 (4096 kB objects) (esc) | |
484 | [^^]+ (re) | |
485 | \tformat: 2 (esc) | |
486 | \tfeatures: layering, exclusive-lock, object-map, fast-diff, deep-flatten (esc) | |
487 | \tflags: (esc) | |
31f18b77 | 488 | \tcreate_timestamp:* (glob) |
7c673cae FG |
489 | \tprotected: False (esc) |
490 | $ rbd info rbd_other/deep-flatten-child@snap --format json | python -mjson.tool | sed 's/,$/, /' | |
491 | { | |
492 | "block_name_prefix": "rbd_data.*", (glob) | |
31f18b77 | 493 | "create_timestamp": "*", (glob) |
7c673cae FG |
494 | "features": [ |
495 | "layering", | |
496 | "exclusive-lock", | |
497 | "object-map", | |
498 | "fast-diff", | |
499 | "deep-flatten" | |
500 | ], | |
501 | "flags": [], | |
502 | "format": 2, | |
503 | "name": "deep-flatten-child", | |
504 | "object_size": 4194304, | |
505 | "objects": 128, | |
506 | "order": 22, | |
507 | "protected": "false", | |
508 | "size": 536870912 | |
509 | } | |
510 | $ rbd info rbd_other/deep-flatten-child@snap --format xml | xml_pp 2>&1 | grep -v '^new version at /usr/bin/xml_pp' | |
511 | <image> | |
512 | <name>deep-flatten-child</name> | |
513 | <size>536870912</size> | |
514 | <objects>128</objects> | |
515 | <order>22</order> | |
516 | <object_size>4194304</object_size> | |
517 | <block_name_prefix>rbd_data.*</block_name_prefix> (glob) | |
518 | <format>2</format> | |
519 | <features> | |
520 | <feature>layering</feature> | |
521 | <feature>exclusive-lock</feature> | |
522 | <feature>object-map</feature> | |
523 | <feature>fast-diff</feature> | |
524 | <feature>deep-flatten</feature> | |
525 | </features> | |
526 | <flags></flags> | |
31f18b77 | 527 | <create_timestamp>*</create_timestamp> (glob) |
7c673cae FG |
528 | <protected>false</protected> |
529 | </image> | |
530 | $ rbd list | |
531 | foo | |
532 | quux | |
533 | bar | |
534 | baz | |
535 | quuy | |
536 | $ rbd list --format json | python -mjson.tool | sed 's/,$/, /' | |
537 | [ | |
538 | "foo", | |
539 | "quux", | |
540 | "bar", | |
541 | "baz", | |
542 | "quuy" | |
543 | ] | |
544 | $ rbd list --format xml | xml_pp 2>&1 | grep -v '^new version at /usr/bin/xml_pp' | |
545 | <images> | |
546 | <name>foo</name> | |
547 | <name>quux</name> | |
548 | <name>bar</name> | |
549 | <name>baz</name> | |
550 | <name>quuy</name> | |
551 | </images> | |
552 | $ rbd list -l | |
553 | NAME SIZE PARENT FMT PROT LOCK | |
554 | foo 1024M 1 | |
555 | foo@snap 1024M 1 | |
556 | quux 1024k 1 excl | |
557 | bar 1024M 2 | |
558 | bar@snap 512M 2 yes | |
559 | bar@snap2 1024M 2 | |
560 | baz 2048M 2 shr | |
561 | quuy 2048M 2 | |
562 | $ rbd list -l --format json | python -mjson.tool | sed 's/,$/, /' | |
563 | [ | |
564 | { | |
565 | "format": 1, | |
566 | "image": "foo", | |
567 | "size": 1073741824 | |
568 | }, | |
569 | { | |
570 | "format": 1, | |
571 | "image": "foo", | |
572 | "protected": "false", | |
573 | "size": 1073741824, | |
574 | "snapshot": "snap" | |
575 | }, | |
576 | { | |
577 | "format": 1, | |
578 | "image": "quux", | |
579 | "lock_type": "exclusive", | |
580 | "size": 1048576 | |
581 | }, | |
582 | { | |
583 | "format": 2, | |
584 | "image": "bar", | |
585 | "size": 1073741824 | |
586 | }, | |
587 | { | |
588 | "format": 2, | |
589 | "image": "bar", | |
590 | "protected": "true", | |
591 | "size": 536870912, | |
592 | "snapshot": "snap" | |
593 | }, | |
594 | { | |
595 | "format": 2, | |
596 | "image": "bar", | |
597 | "protected": "false", | |
598 | "size": 1073741824, | |
599 | "snapshot": "snap2" | |
600 | }, | |
601 | { | |
602 | "format": 2, | |
603 | "image": "baz", | |
604 | "lock_type": "shared", | |
605 | "size": 2147483648 | |
606 | }, | |
607 | { | |
608 | "format": 2, | |
609 | "image": "quuy", | |
610 | "size": 2147483648 | |
611 | } | |
612 | ] | |
613 | $ rbd list -l --format xml | xml_pp 2>&1 | grep -v '^new version at /usr/bin/xml_pp' | |
614 | <images> | |
615 | <image> | |
616 | <image>foo</image> | |
617 | <size>1073741824</size> | |
618 | <format>1</format> | |
619 | </image> | |
620 | <snapshot> | |
621 | <image>foo</image> | |
622 | <snapshot>snap</snapshot> | |
623 | <size>1073741824</size> | |
624 | <format>1</format> | |
625 | <protected>false</protected> | |
626 | </snapshot> | |
627 | <image> | |
628 | <image>quux</image> | |
629 | <size>1048576</size> | |
630 | <format>1</format> | |
631 | <lock_type>exclusive</lock_type> | |
632 | </image> | |
633 | <image> | |
634 | <image>bar</image> | |
635 | <size>1073741824</size> | |
636 | <format>2</format> | |
637 | </image> | |
638 | <snapshot> | |
639 | <image>bar</image> | |
640 | <snapshot>snap</snapshot> | |
641 | <size>536870912</size> | |
642 | <format>2</format> | |
643 | <protected>true</protected> | |
644 | </snapshot> | |
645 | <snapshot> | |
646 | <image>bar</image> | |
647 | <snapshot>snap2</snapshot> | |
648 | <size>1073741824</size> | |
649 | <format>2</format> | |
650 | <protected>false</protected> | |
651 | </snapshot> | |
652 | <image> | |
653 | <image>baz</image> | |
654 | <size>2147483648</size> | |
655 | <format>2</format> | |
656 | <lock_type>shared</lock_type> | |
657 | </image> | |
658 | <image> | |
659 | <image>quuy</image> | |
660 | <size>2147483648</size> | |
661 | <format>2</format> | |
662 | </image> | |
663 | </images> | |
664 | $ rbd list rbd_other | |
665 | child | |
666 | deep-flatten-child | |
667 | $ rbd list rbd_other --format json | python -mjson.tool | sed 's/,$/, /' | |
668 | [ | |
669 | "child", | |
670 | "deep-flatten-child" | |
671 | ] | |
672 | $ rbd list rbd_other --format xml | xml_pp 2>&1 | grep -v '^new version at /usr/bin/xml_pp' | |
673 | <images> | |
674 | <name>child</name> | |
675 | <name>deep-flatten-child</name> | |
676 | </images> | |
677 | $ rbd list rbd_other -l | |
678 | NAME SIZE PARENT FMT PROT LOCK | |
679 | child 512M 2 | |
680 | child@snap 512M rbd/bar@snap 2 | |
681 | deep-flatten-child 512M 2 | |
682 | deep-flatten-child@snap 512M 2 | |
683 | $ rbd list rbd_other -l --format json | python -mjson.tool | sed 's/,$/, /' | |
684 | [ | |
685 | { | |
686 | "format": 2, | |
687 | "image": "child", | |
688 | "size": 536870912 | |
689 | }, | |
690 | { | |
691 | "format": 2, | |
692 | "image": "child", | |
693 | "parent": { | |
694 | "image": "bar", | |
695 | "pool": "rbd", | |
696 | "snapshot": "snap" | |
697 | }, | |
698 | "protected": "false", | |
699 | "size": 536870912, | |
700 | "snapshot": "snap" | |
701 | }, | |
702 | { | |
703 | "format": 2, | |
704 | "image": "deep-flatten-child", | |
705 | "size": 536870912 | |
706 | }, | |
707 | { | |
708 | "format": 2, | |
709 | "image": "deep-flatten-child", | |
710 | "protected": "false", | |
711 | "size": 536870912, | |
712 | "snapshot": "snap" | |
713 | } | |
714 | ] | |
715 | $ rbd list rbd_other -l --format xml | xml_pp 2>&1 | grep -v '^new version at /usr/bin/xml_pp' | |
716 | <images> | |
717 | <image> | |
718 | <image>child</image> | |
719 | <size>536870912</size> | |
720 | <format>2</format> | |
721 | </image> | |
722 | <snapshot> | |
723 | <image>child</image> | |
724 | <snapshot>snap</snapshot> | |
725 | <size>536870912</size> | |
726 | <parent> | |
727 | <pool>rbd</pool> | |
728 | <image>bar</image> | |
729 | <snapshot>snap</snapshot> | |
730 | </parent> | |
731 | <format>2</format> | |
732 | <protected>false</protected> | |
733 | </snapshot> | |
734 | <image> | |
735 | <image>deep-flatten-child</image> | |
736 | <size>536870912</size> | |
737 | <format>2</format> | |
738 | </image> | |
739 | <snapshot> | |
740 | <image>deep-flatten-child</image> | |
741 | <snapshot>snap</snapshot> | |
742 | <size>536870912</size> | |
743 | <format>2</format> | |
744 | <protected>false</protected> | |
745 | </snapshot> | |
746 | </images> | |
747 | $ rbd lock list foo | |
748 | $ rbd lock list foo --format json | python -mjson.tool | sed 's/,$/, /' | |
749 | {} | |
750 | $ rbd lock list foo --format xml | xml_pp 2>&1 | grep -v '^new version at /usr/bin/xml_pp' | |
751 | <locks></locks> | |
752 | $ rbd lock list quux | |
753 | There is 1 exclusive lock on this image. | |
754 | Locker*ID*Address* (glob) | |
755 | client.* id * (glob) | |
756 | $ rbd lock list quux --format json | python -mjson.tool | sed 's/,$/, /' | |
757 | { | |
758 | "id": { | |
759 | "address": "*", (glob) | |
760 | "locker": "client.*" (glob) | |
761 | } | |
762 | } | |
763 | $ rbd lock list quux --format xml | xml_pp 2>&1 | grep -v '^new version at /usr/bin/xml_pp' | |
764 | <locks> | |
765 | <id> | |
766 | <locker>client.*</locker> (glob) | |
767 | <address>*</address> (glob) | |
768 | </id> | |
769 | </locks> | |
770 | $ rbd lock list baz | |
771 | There are 3 shared locks on this image. | |
772 | Lock tag: tag | |
773 | Locker*ID*Address* (glob) | |
774 | client.*id[123].* (re) | |
775 | client.*id[123].* (re) | |
776 | client.*id[123].* (re) | |
777 | $ rbd lock list baz --format json | python -mjson.tool | sed 's/,$/, /' | |
778 | { | |
779 | "id1": { | |
780 | "address": "*", (glob) | |
781 | "locker": "client.*" (glob) | |
782 | }, | |
783 | "id2": { | |
784 | "address": "*", (glob) | |
785 | "locker": "client.*" (glob) | |
786 | }, | |
787 | "id3": { | |
788 | "address": "*", (glob) | |
789 | "locker": "client.*" (glob) | |
790 | } | |
791 | } | |
792 | $ rbd lock list baz --format xml | xml_pp 2>&1 | grep -v '^new version at /usr/bin/xml_pp' | |
793 | <locks> | |
794 | <id*> (glob) | |
795 | <locker>client.*</locker> (glob) | |
796 | <address>*</address> (glob) | |
797 | </id*> (glob) | |
798 | <id*> (glob) | |
799 | <locker>client.*</locker> (glob) | |
800 | <address>*</address> (glob) | |
801 | </id*> (glob) | |
802 | <id*> (glob) | |
803 | <locker>client.*</locker> (glob) | |
804 | <address>*</address> (glob) | |
805 | </id*> (glob) | |
806 | </locks> | |
807 | $ rbd snap list foo | |
808 | SNAPID NAME SIZE TIMESTAMP | |
809 | *snap*1024*MB* (glob) | |
810 | $ rbd snap list foo --format json | python -mjson.tool | sed 's/,$/, /' | |
811 | [ | |
812 | { | |
813 | "id": *, (glob) | |
814 | "name": "snap", | |
815 | "size": 1073741824, | |
816 | "timestamp": "" | |
817 | } | |
818 | ] | |
819 | $ rbd snap list foo --format xml | xml_pp 2>&1 | grep -v '^new version at /usr/bin/xml_pp' | |
820 | <snapshots> | |
821 | <snapshot> | |
822 | <id>*</id> (glob) | |
823 | <name>snap</name> | |
824 | <size>1073741824</size> | |
825 | <timestamp></timestamp> | |
826 | </snapshot> | |
827 | </snapshots> | |
828 | $ rbd snap list bar | |
829 | SNAPID NAME SIZE TIMESTAMP | |
830 | *snap*512*MB* (glob) | |
831 | *snap2*1024*MB* (glob) | |
832 | $ rbd snap list bar --format json | python -mjson.tool | sed 's/,$/, /' | |
833 | [ | |
834 | { | |
835 | "id": *, (glob) | |
836 | "name": "snap", | |
837 | "size": 536870912, | |
838 | "timestamp": * (glob) | |
839 | }, | |
840 | { | |
841 | "id": *, (glob) | |
842 | "name": "snap2", | |
843 | "size": 1073741824, | |
844 | "timestamp": * (glob) | |
845 | } | |
846 | ] | |
847 | $ rbd snap list bar --format xml | xml_pp 2>&1 | grep -v '^new version at /usr/bin/xml_pp' | |
848 | <snapshots> | |
849 | <snapshot> | |
850 | <id>*</id> (glob) | |
851 | <name>snap</name> | |
852 | <size>536870912</size> | |
853 | <timestamp>*</timestamp> (glob) | |
854 | </snapshot> | |
855 | <snapshot> | |
856 | <id>*</id> (glob) | |
857 | <name>snap2</name> | |
858 | <size>1073741824</size> | |
859 | <timestamp>*</timestamp> (glob) | |
860 | </snapshot> | |
861 | </snapshots> | |
862 | $ rbd snap list baz | |
863 | $ rbd snap list baz --format json | python -mjson.tool | sed 's/,$/, /' | |
864 | [] | |
865 | $ rbd snap list baz --format xml | xml_pp 2>&1 | grep -v '^new version at /usr/bin/xml_pp' | |
866 | <snapshots></snapshots> | |
867 | $ rbd snap list rbd_other/child | |
868 | SNAPID NAME SIZE TIMESTAMP | |
869 | *snap*512*MB* (glob) | |
870 | $ rbd snap list rbd_other/child --format json | python -mjson.tool | sed 's/,$/, /' | |
871 | [ | |
872 | { | |
873 | "id": *, (glob) | |
874 | "name": "snap", | |
875 | "size": 536870912, | |
876 | "timestamp": * (glob) | |
877 | } | |
878 | ] | |
879 | $ rbd snap list rbd_other/child --format xml | xml_pp 2>&1 | grep -v '^new version at /usr/bin/xml_pp' | |
880 | <snapshots> | |
881 | <snapshot> | |
882 | <id>*</id> (glob) | |
883 | <name>snap</name> | |
884 | <size>536870912</size> | |
885 | <timestamp>*</timestamp> (glob) | |
886 | </snapshot> | |
887 | </snapshots> | |
888 | $ rbd disk-usage --pool rbd_other 2>/dev/null | |
889 | NAME PROVISIONED USED | |
890 | child@snap 512M 0 | |
891 | child 512M 4096k | |
892 | deep-flatten-child@snap 512M 0 | |
893 | deep-flatten-child 512M 0 | |
894 | <TOTAL> 1024M 4096k | |
895 | $ rbd disk-usage --pool rbd_other --format json | python -mjson.tool | sed 's/,$/, /' | |
896 | { | |
897 | "images": [ | |
898 | { | |
899 | "name": "child", | |
900 | "provisioned_size": 536870912, | |
901 | "snapshot": "snap", | |
902 | "used_size": 0 | |
903 | }, | |
904 | { | |
905 | "name": "child", | |
906 | "provisioned_size": 536870912, | |
907 | "used_size": 4194304 | |
908 | }, | |
909 | { | |
910 | "name": "deep-flatten-child", | |
911 | "provisioned_size": 536870912, | |
912 | "snapshot": "snap", | |
913 | "used_size": 0 | |
914 | }, | |
915 | { | |
916 | "name": "deep-flatten-child", | |
917 | "provisioned_size": 536870912, | |
918 | "used_size": 0 | |
919 | } | |
920 | ], | |
921 | "total_provisioned_size": 1073741824, | |
922 | "total_used_size": 4194304 | |
923 | } | |
924 | $ rbd disk-usage --pool rbd_other --format xml | xml_pp 2>&1 | grep -v '^new version at /usr/bin/xml_pp' | |
925 | <stats> | |
926 | <images> | |
927 | <image> | |
928 | <name>child</name> | |
929 | <snapshot>snap</snapshot> | |
930 | <provisioned_size>536870912</provisioned_size> | |
931 | <used_size>0</used_size> | |
932 | </image> | |
933 | <image> | |
934 | <name>child</name> | |
935 | <provisioned_size>536870912</provisioned_size> | |
936 | <used_size>4194304</used_size> | |
937 | </image> | |
938 | <image> | |
939 | <name>deep-flatten-child</name> | |
940 | <snapshot>snap</snapshot> | |
941 | <provisioned_size>536870912</provisioned_size> | |
942 | <used_size>0</used_size> | |
943 | </image> | |
944 | <image> | |
945 | <name>deep-flatten-child</name> | |
946 | <provisioned_size>536870912</provisioned_size> | |
947 | <used_size>0</used_size> | |
948 | </image> | |
949 | </images> | |
950 | <total_provisioned_size>1073741824</total_provisioned_size> | |
951 | <total_used_size>4194304</total_used_size> | |
952 | </stats> | |
953 | ||
954 | # cleanup | |
955 | $ rbd snap remove --no-progress rbd_other/deep-flatten-child@snap | |
956 | $ rbd snap remove --no-progress rbd_other/child@snap | |
957 | $ rbd snap unprotect bar@snap | |
958 | $ rbd snap purge bar 2> /dev/null | |
959 | $ rbd snap purge foo 2> /dev/null | |
960 | $ rbd rm rbd_other/deep-flatten-child 2> /dev/null | |
961 | $ rbd rm rbd_other/child 2> /dev/null | |
962 | $ rbd rm foo 2> /dev/null | |
963 | $ rbd rm bar 2> /dev/null | |
964 | $ rbd rm quux 2> /dev/null | |
965 | $ rbd rm quuy 2> /dev/null | |
966 | $ rbd rm baz 2> /dev/null | |
967 | $ ceph osd pool delete rbd_other rbd_other --yes-i-really-really-mean-it | |
968 | pool 'rbd_other' removed |