]> git.proxmox.com Git - ceph.git/blob - ceph/doc/ceph-volume/lvm/list.rst
update sources to 12.2.7
[ceph.git] / ceph / doc / ceph-volume / lvm / list.rst
1 .. _ceph-volume-lvm-list:
2
3 ``list``
4 ========
5 This subcommand will list any devices (logical and physical) that may be
6 associated with a Ceph cluster, as long as they contain enough metadata to
7 allow for that discovery.
8
9 Output is grouped by the OSD ID associated with the devices, and unlike
10 ``ceph-disk`` it does not provide any information for devices that aren't
11 associated with Ceph.
12
13 Command line options:
14
15 * ``--format`` Allows a ``json`` or ``pretty`` value. Defaults to ``pretty``
16 which will group the device information in a human-readable format.
17
18 Full Reporting
19 --------------
20 When no positional arguments are used, a full reporting will be presented. This
21 means that all devices and logical volumes found in the system will be
22 displayed.
23
24 Full ``pretty`` reporting for two OSDs, one with a lv as a journal, and another
25 one with a physical device may look similar to::
26
27 # ceph-volume lvm list
28
29
30 ====== osd.1 =======
31
32 [journal] /dev/journals/journal1
33
34 journal uuid C65n7d-B1gy-cqX3-vZKY-ZoE0-IEYM-HnIJzs
35 osd id 1
36 cluster fsid ce454d91-d748-4751-a318-ff7f7aa18ffd
37 type journal
38 osd fsid 661b24f8-e062-482b-8110-826ffe7f13fa
39 data uuid SlEgHe-jX1H-QBQk-Sce0-RUls-8KlY-g8HgcZ
40 journal device /dev/journals/journal1
41 data device /dev/test_group/data-lv2
42 devices /dev/sda
43
44 [data] /dev/test_group/data-lv2
45
46 journal uuid C65n7d-B1gy-cqX3-vZKY-ZoE0-IEYM-HnIJzs
47 osd id 1
48 cluster fsid ce454d91-d748-4751-a318-ff7f7aa18ffd
49 type data
50 osd fsid 661b24f8-e062-482b-8110-826ffe7f13fa
51 data uuid SlEgHe-jX1H-QBQk-Sce0-RUls-8KlY-g8HgcZ
52 journal device /dev/journals/journal1
53 data device /dev/test_group/data-lv2
54 devices /dev/sdb
55
56 ====== osd.0 =======
57
58 [data] /dev/test_group/data-lv1
59
60 journal uuid cd72bd28-002a-48da-bdf6-d5b993e84f3f
61 osd id 0
62 cluster fsid ce454d91-d748-4751-a318-ff7f7aa18ffd
63 type data
64 osd fsid 943949f0-ce37-47ca-a33c-3413d46ee9ec
65 data uuid TUpfel-Q5ZT-eFph-bdGW-SiNW-l0ag-f5kh00
66 journal device /dev/sdd1
67 data device /dev/test_group/data-lv1
68 devices /dev/sdc
69
70 [journal] /dev/sdd1
71
72 PARTUUID cd72bd28-002a-48da-bdf6-d5b993e84f3f
73
74
75 For logical volumes the ``devices`` key is populated with the physical devices
76 associated with the logical volume. Since LVM allows multiple physical devices
77 to be part of a logical volume, the value will be comma separated when using
78 ``pretty``, but an array when using ``json``.
79
80 .. note:: Tags are displayed in a readable format. The ``osd id`` key is stored
81 as a ``ceph.osd_id`` tag. For more information on lvm tag conventions
82 see :ref:`ceph-volume-lvm-tag-api`
83
84 Single Reporting
85 ----------------
86 Single reporting can consume both devices and logical volumes as input
87 (positional parameters). For logical volumes, it is required to use the group
88 name as well as the logical volume name.
89
90 For example the ``data-lv2`` logical volume, in the ``test_group`` volume group
91 can be listed in the following way::
92
93 # ceph-volume lvm list test_group/data-lv2
94
95
96 ====== osd.1 =======
97
98 [data] /dev/test_group/data-lv2
99
100 journal uuid C65n7d-B1gy-cqX3-vZKY-ZoE0-IEYM-HnIJzs
101 osd id 1
102 cluster fsid ce454d91-d748-4751-a318-ff7f7aa18ffd
103 type data
104 osd fsid 661b24f8-e062-482b-8110-826ffe7f13fa
105 data uuid SlEgHe-jX1H-QBQk-Sce0-RUls-8KlY-g8HgcZ
106 journal device /dev/journals/journal1
107 data device /dev/test_group/data-lv2
108 devices /dev/sdc
109
110
111 .. note:: Tags are displayed in a readable format. The ``osd id`` key is stored
112 as a ``ceph.osd_id`` tag. For more information on lvm tag conventions
113 see :ref:`ceph-volume-lvm-tag-api`
114
115
116 For plain disks, the full path to the device is required. For example, for
117 a device like ``/dev/sdd1`` it can look like::
118
119
120 # ceph-volume lvm list /dev/sdd1
121
122
123 ====== osd.0 =======
124
125 [journal] /dev/sdd1
126
127 PARTUUID cd72bd28-002a-48da-bdf6-d5b993e84f3f
128
129
130
131 ``json`` output
132 ---------------
133 All output using ``--format=json`` will show everything the system has stored
134 as metadata for the devices, including tags.
135
136 No changes for readability are done with ``json`` reporting, and all
137 information is presented as-is. Full output as well as single devices can be
138 listed.
139
140 For brevity, this is how a single logical volume would look with ``json``
141 output (note how tags aren't modified)::
142
143 # ceph-volume lvm list --format=json test_group/data-lv1
144 {
145 "0": [
146 {
147 "devices": ["/dev/sda"],
148 "lv_name": "data-lv1",
149 "lv_path": "/dev/test_group/data-lv1",
150 "lv_tags": "ceph.cluster_fsid=ce454d91-d748-4751-a318-ff7f7aa18ffd,ceph.data_device=/dev/test_group/data-lv1,ceph.data_uuid=TUpfel-Q5ZT-eFph-bdGW-SiNW-l0ag-f5kh00,ceph.journal_device=/dev/sdd1,ceph.journal_uuid=cd72bd28-002a-48da-bdf6-d5b993e84f3f,ceph.osd_fsid=943949f0-ce37-47ca-a33c-3413d46ee9ec,ceph.osd_id=0,ceph.type=data",
151 "lv_uuid": "TUpfel-Q5ZT-eFph-bdGW-SiNW-l0ag-f5kh00",
152 "name": "data-lv1",
153 "path": "/dev/test_group/data-lv1",
154 "tags": {
155 "ceph.cluster_fsid": "ce454d91-d748-4751-a318-ff7f7aa18ffd",
156 "ceph.data_device": "/dev/test_group/data-lv1",
157 "ceph.data_uuid": "TUpfel-Q5ZT-eFph-bdGW-SiNW-l0ag-f5kh00",
158 "ceph.journal_device": "/dev/sdd1",
159 "ceph.journal_uuid": "cd72bd28-002a-48da-bdf6-d5b993e84f3f",
160 "ceph.osd_fsid": "943949f0-ce37-47ca-a33c-3413d46ee9ec",
161 "ceph.osd_id": "0",
162 "ceph.type": "data"
163 },
164 "type": "data",
165 "vg_name": "test_group"
166 }
167 ]
168 }
169
170
171 Synchronized information
172 ------------------------
173 Before any listing type, the lvm API is queried to ensure that physical devices
174 that may be in use haven't changed naming. It is possible that non-persistent
175 devices like ``/dev/sda1`` could change to ``/dev/sdb1``.
176
177 The detection is possible because the ``PARTUUID`` is stored as part of the
178 metadata in the logical volume for the data lv. Even in the case of a journal
179 that is a physical device, this information is still stored on the data logical
180 volume associated with it.
181
182 If the name is no longer the same (as reported by ``blkid`` when using the
183 ``PARTUUID``), the tag will get updated and the report will use the newly
184 refreshed information.