Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / doc / dev / rbd-export.rst
1 RBD Export & Import
2 ===================
3
4 This is a file format of an RBD image or snapshot. It's a sparse format
5 for the full image. There are three recording sections in the file.
6
7 (1) Header.
8 (2) Metadata.
9 (3) Diffs.
10
11 Header
12 ~~~~~~
13
14 "rbd image v2\\n"
15
16 Metadata records
17 ~~~~~~~~~~~~~~~~
18
19 Every record has a one byte "tag" that identifies the record type,
20 followed by length of data, and then some other data.
21
22 Metadata records come in the first part of the image.  Order is not
23 important, as long as all the metadata records come before the data
24 records.
25
26 In v2, we have the following metadata in each section:
27 (1 Bytes) tag.
28 (8 Bytes) length.
29 (n Bytes) data.
30
31 In this way, we can skip the unrecognized tag.
32
33 Image order
34 -----------
35
36 - u8: 'O'
37 - le64: length of appending data (8)
38 - le64: image order
39
40 Image format
41 ------------
42
43 - u8: 'F'
44 - le64: length of appending data (8)
45 - le64: image format
46
47 Image Features
48 --------------
49
50 - u8: 'T'
51 - le64: length of appending data (8)
52 - le64: image features
53
54 Image Stripe unit
55 -----------------
56
57 - u8: 'U'
58 - le64: length of appending data (8)
59 - le64: image striping unit
60
61 Image Stripe count
62 ------------------
63
64 - u8: 'C'
65 - le64: length of appending data (8)
66 - le64: image striping count
67
68 Final Record
69 ~~~~~~~~~~~~
70
71 End
72 ---
73
74 - u8: 'E'
75
76
77 Diffs records
78 ~~~~~~~~~~~~~~~~~
79 Record the all snapshots and the HEAD in this section. 
80
81 - le64: number of diffs
82 - Diffs ...
83
84 Detail please refer to rbd-diff.rst