Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / 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
43       [data]    /dev/test_group/data-lv2
44
45           journal uuid              C65n7d-B1gy-cqX3-vZKY-ZoE0-IEYM-HnIJzs
46           osd id                    1
47           cluster fsid              ce454d91-d748-4751-a318-ff7f7aa18ffd
48           type                      data
49           osd fsid                  661b24f8-e062-482b-8110-826ffe7f13fa
50           data uuid                 SlEgHe-jX1H-QBQk-Sce0-RUls-8KlY-g8HgcZ
51           journal device            /dev/journals/journal1
52           data device               /dev/test_group/data-lv2
53
54     ====== osd.0 =======
55
56       [data]    /dev/test_group/data-lv1
57
58           journal uuid              cd72bd28-002a-48da-bdf6-d5b993e84f3f
59           osd id                    0
60           cluster fsid              ce454d91-d748-4751-a318-ff7f7aa18ffd
61           type                      data
62           osd fsid                  943949f0-ce37-47ca-a33c-3413d46ee9ec
63           data uuid                 TUpfel-Q5ZT-eFph-bdGW-SiNW-l0ag-f5kh00
64           journal device            /dev/sdd1
65           data device               /dev/test_group/data-lv1
66
67       [journal]    /dev/sdd1
68
69           PARTUUID                  cd72bd28-002a-48da-bdf6-d5b993e84f3f
70
71 .. note:: Tags are displayed in a readable format. The ``osd id`` key is stored
72           as a ``ceph.osd_id`` tag. For more information on lvm tag conventions
73           see :ref:`ceph-volume-lvm-tag-api`
74
75 Single Reporting
76 ----------------
77 Single reporting can consume both devices and logical volumes as input
78 (positional parameters). For logical volumes, it is required to use the group
79 name as well as the logical volume name.
80
81 For example the ``data-lv2`` logical volume, in the ``test_group`` volume group
82 can be listed in the following way::
83
84     # ceph-volume lvm list test_group/data-lv2
85
86
87     ====== osd.1 =======
88
89       [data]    /dev/test_group/data-lv2
90
91           journal uuid              C65n7d-B1gy-cqX3-vZKY-ZoE0-IEYM-HnIJzs
92           osd id                    1
93           cluster fsid              ce454d91-d748-4751-a318-ff7f7aa18ffd
94           type                      data
95           osd fsid                  661b24f8-e062-482b-8110-826ffe7f13fa
96           data uuid                 SlEgHe-jX1H-QBQk-Sce0-RUls-8KlY-g8HgcZ
97           journal device            /dev/journals/journal1
98           data device               /dev/test_group/data-lv2
99
100
101 .. note:: Tags are displayed in a readable format. The ``osd id`` key is stored
102           as a ``ceph.osd_id`` tag. For more information on lvm tag conventions
103           see :ref:`ceph-volume-lvm-tag-api`
104
105
106 For plain disks, the full path to the device is required. For example, for
107 a device like ``/dev/sdd1`` it can look like::
108
109
110     # ceph-volume lvm list /dev/sdd1
111
112
113     ====== osd.0 =======
114
115       [journal]    /dev/sdd1
116
117           PARTUUID                  cd72bd28-002a-48da-bdf6-d5b993e84f3f
118
119
120
121 ``json`` output
122 ---------------
123 All output using ``--format=json`` will show everything the system has stored
124 as metadata for the devices, including tags.
125
126 No changes for readability are done with ``json`` reporting, and all
127 information is presented as-is. Full output as well as single devices can be
128 listed.
129
130 For brevity, this is how a single logical volume would look with ``json``
131 output (note how tags aren't modified)::
132
133     # ceph-volume lvm list --format=json test_group/data-lv1
134     {
135         "0": [
136             {
137                 "lv_name": "data-lv1",
138                 "lv_path": "/dev/test_group/data-lv1",
139                 "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",
140                 "lv_uuid": "TUpfel-Q5ZT-eFph-bdGW-SiNW-l0ag-f5kh00",
141                 "name": "data-lv1",
142                 "path": "/dev/test_group/data-lv1",
143                 "tags": {
144                     "ceph.cluster_fsid": "ce454d91-d748-4751-a318-ff7f7aa18ffd",
145                     "ceph.data_device": "/dev/test_group/data-lv1",
146                     "ceph.data_uuid": "TUpfel-Q5ZT-eFph-bdGW-SiNW-l0ag-f5kh00",
147                     "ceph.journal_device": "/dev/sdd1",
148                     "ceph.journal_uuid": "cd72bd28-002a-48da-bdf6-d5b993e84f3f",
149                     "ceph.osd_fsid": "943949f0-ce37-47ca-a33c-3413d46ee9ec",
150                     "ceph.osd_id": "0",
151                     "ceph.type": "data"
152                 },
153                 "type": "data",
154                 "vg_name": "test_group"
155             }
156         ]
157     }
158
159
160 Synchronized information
161 ------------------------
162 Before any listing type, the lvm API is queried to ensure that physical devices
163 that may be in use haven't changed naming. It is possible that non-persistent
164 devices like ``/dev/sda1`` could change to ``/dev/sdb1``.
165
166 The detection is possible because the ``PARTUUID`` is stored as part of the
167 metadata in the logical volume for the data lv. Even in the case of a journal
168 that is a physical device, this information is still stored on the data logical
169 volume associated with it.
170
171 If the name is no longer the same (as reported by ``blkid`` when using the
172 ``PARTUUID``), the tag will get updated and the report will use the newly
173 refreshed information.