]> git.proxmox.com Git - ceph.git/blame - ceph/doc/dev/rbd-export.rst
update sources to 12.2.7
[ceph.git] / ceph / doc / dev / rbd-export.rst
CommitLineData
7c673cae
FG
1RBD Export & Import
2===================
3
4This is a file format of an RBD image or snapshot. It's a sparse format
5for the full image. There are three recording sections in the file.
6
7(1) Header.
8(2) Metadata.
9(3) Diffs.
10
11Header
12~~~~~~
13
14"rbd image v2\\n"
15
16Metadata records
17~~~~~~~~~~~~~~~~
18
19Every record has a one byte "tag" that identifies the record type,
20followed by length of data, and then some other data.
21
22Metadata records come in the first part of the image. Order is not
23important, as long as all the metadata records come before the data
24records.
25
26In v2, we have the following metadata in each section:
27(1 Bytes) tag.
28(8 Bytes) length.
29(n Bytes) data.
30
31In this way, we can skip the unrecognized tag.
32
33Image order
34-----------
35
36- u8: 'O'
37- le64: length of appending data (8)
38- le64: image order
39
40Image format
41------------
42
43- u8: 'F'
44- le64: length of appending data (8)
45- le64: image format
46
47Image Features
48--------------
49
50- u8: 'T'
51- le64: length of appending data (8)
52- le64: image features
53
54Image Stripe unit
55-----------------
56
57- u8: 'U'
58- le64: length of appending data (8)
59- le64: image striping unit
60
61Image Stripe count
62------------------
63
64- u8: 'C'
65- le64: length of appending data (8)
66- le64: image striping count
67
28e407b8
AA
68ImageMeta Key and Value
69-----------------------
70
71- u8: 'M'
72- le64: length of appending data (length of key + length of value + 4 * 2)
73- string: image-meta key
74- string: image-meta value
75
7c673cae
FG
76Final Record
77~~~~~~~~~~~~
78
79End
80---
81
82- u8: 'E'
83
84
85Diffs records
28e407b8
AA
86~~~~~~~~~~~~~
87
7c673cae
FG
88Record the all snapshots and the HEAD in this section.
89
28e407b8
AA
90Snap Protection status
91----------------------
92
93Record the snapshot's protection status if `--export-format=2`.
94- u8: 'p'
95- le64: length of appending data (8)
96- u8: snap protection status (0 for false, 1 for true)
97
98Others
99------
100
7c673cae
FG
101- le64: number of diffs
102- Diffs ...
103
104Detail please refer to rbd-diff.rst