Skip to content

Commit 5477719

Browse files
Merge pull request ceph#62759 from bluikko/doc-prompts-ceph-volume
doc/ceph-volume: Promptify commands and fix formatting
2 parents 627a12f + f07f697 commit 5477719

File tree

3 files changed

+73
-33
lines changed

3 files changed

+73
-33
lines changed

doc/ceph-volume/drive-group.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ straight to ceph-volume as json. ceph-volume will then attempt to deploy this
77
drive groups via the batch subcommand.
88

99
The specification can be passed via a file, string argument or on stdin.
10-
See the subcommand help for further details::
10+
See the subcommand help for further details:
1111

12-
# ceph-volume drive-group --help
12+
.. prompt:: bash #
13+
14+
ceph-volume drive-group --help

doc/ceph-volume/lvm/list.rst

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@ means that all devices and logical volumes found in the system will be
2222
displayed.
2323

2424
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::
25+
one with a physical device may look similar to:
2626

27-
# ceph-volume lvm list
27+
.. prompt:: bash #
2828

29+
ceph-volume lvm list
30+
31+
::
2932

3033
====== osd.1 =======
3134

@@ -88,10 +91,13 @@ Single reporting can consume both devices and logical volumes as input
8891
name as well as the logical volume name.
8992

9093
For example the ``data-lv2`` logical volume, in the ``test_group`` volume group
91-
can be listed in the following way::
94+
can be listed in the following way:
95+
96+
.. prompt:: bash #
9297

93-
# ceph-volume lvm list test_group/data-lv2
98+
ceph-volume lvm list test_group/data-lv2
9499

100+
::
95101

96102
====== osd.1 =======
97103

@@ -114,11 +120,13 @@ can be listed in the following way::
114120

115121

116122
For plain disks, the full path to the device is required. For example, for
117-
a device like ``/dev/sdd1`` it can look like::
123+
a device like ``/dev/sdd1`` it can look like:
118124

125+
.. prompt:: bash #
119126

120-
# ceph-volume lvm list /dev/sdd1
127+
ceph-volume lvm list /dev/sdd1
121128

129+
::
122130

123131
====== osd.0 =======
124132

@@ -138,9 +146,14 @@ information is presented as-is. Full output as well as single devices can be
138146
listed.
139147

140148
For brevity, this is how a single logical volume would look with ``json``
141-
output (note how tags aren't modified)::
149+
output (note how tags aren't modified):
150+
151+
.. prompt:: bash #
152+
153+
ceph-volume lvm list --format=json test_group/data-lv1
154+
155+
::
142156

143-
# ceph-volume lvm list --format=json test_group/data-lv1
144157
{
145158
"0": [
146159
{

doc/ceph-volume/lvm/prepare.rst

Lines changed: 48 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -47,25 +47,25 @@ case it looks like:
4747

4848
.. prompt:: bash #
4949

50-
ceph-volume lvm prepare --bluestore --data vg/lv
50+
ceph-volume lvm prepare --bluestore --data vg/lv
5151

5252
A raw device can be specified in the same way:
5353

5454
.. prompt:: bash #
5555

56-
ceph-volume lvm prepare --bluestore --data /path/to/device
56+
ceph-volume lvm prepare --bluestore --data /path/to/device
5757

5858
For enabling :ref:`encryption <ceph-volume-lvm-encryption>`, the ``--dmcrypt`` flag is required:
5959

6060
.. prompt:: bash #
6161

62-
ceph-volume lvm prepare --bluestore --dmcrypt --data vg/lv
62+
ceph-volume lvm prepare --bluestore --dmcrypt --data vg/lv
6363

6464
Starting with Ceph Squid, you can opt for TPM2 token enrollment for the created LUKS2 devices with the ``--with-tpm`` flag:
6565

6666
.. prompt:: bash #
6767

68-
ceph-volume lvm prepare --bluestore --dmcrypt --with-tpm --data vg/lv
68+
ceph-volume lvm prepare --bluestore --dmcrypt --with-tpm --data vg/lv
6969

7070
If a ``block.db`` device or a ``block.wal`` device is needed, it can be
7171
specified with ``--block.db`` or ``--block.wal``. These can be physical
@@ -81,9 +81,14 @@ and are ephemeral.
8181

8282
A symlink is created for the ``block`` device, and is optional for ``block.db``
8383
and ``block.wal``. For a cluster with a default name and an OSD ID of 0, the
84-
directory looks like this::
84+
directory looks like this:
85+
86+
.. prompt:: bash #
87+
88+
ls -l /var/lib/ceph/osd/ceph-0
89+
90+
::
8591

86-
# ls -l /var/lib/ceph/osd/ceph-0
8792
lrwxrwxrwx. 1 ceph ceph 93 Oct 20 13:05 block -> /dev/ceph-be2b6fbd-bcf2-4c51-b35d-a35a162a02f0/osd-block-25cf0a05-2bc6-44ef-9137-79d65bd7ad62
8893
lrwxrwxrwx. 1 ceph ceph 93 Oct 20 13:05 block.db -> /dev/sda1
8994
lrwxrwxrwx. 1 ceph ceph 93 Oct 20 13:05 block.wal -> /dev/ceph/osd-wal-0
@@ -187,18 +192,19 @@ To fetch the monmap by using the bootstrap key from the OSD, use this command:
187192

188193
.. prompt:: bash #
189194

190-
/usr/bin/ceph --cluster ceph --name client.bootstrap-osd --keyring
191-
/var/lib/ceph/bootstrap-osd/ceph.keyring mon getmap -o
195+
/usr/bin/ceph --cluster ceph --name client.bootstrap-osd --keyring \
196+
/var/lib/ceph/bootstrap-osd/ceph.keyring mon getmap -o \
192197
/var/lib/ceph/osd/<cluster name>-<osd id>/activate.monmap
193198

194199
To populate the OSD directory (which has already been mounted), use this ``ceph-osd`` command:
200+
195201
.. prompt:: bash #
196202

197-
ceph-osd --cluster ceph --mkfs --mkkey -i <osd id> \ --monmap
203+
ceph-osd --cluster ceph --mkfs --mkkey -i <osd id> --monmap \
198204
/var/lib/ceph/osd/<cluster name>-<osd id>/activate.monmap --osd-data \
199-
/var/lib/ceph/osd/<cluster name>-<osd id> --osd-journal
200-
/var/lib/ceph/osd/<cluster name>-<osd id>/journal \ --osd-uuid <osd uuid>
201-
--keyring /var/lib/ceph/osd/<cluster name>-<osd id>/keyring \ --setuser ceph
205+
/var/lib/ceph/osd/<cluster name>-<osd id> --osd-journal \
206+
/var/lib/ceph/osd/<cluster name>-<osd id>/journal --osd-uuid <osd uuid> \
207+
--keyring /var/lib/ceph/osd/<cluster name>-<osd id>/keyring --setuser ceph \
202208
--setgroup ceph
203209

204210
All of the information from the previous steps is used in the above command.
@@ -216,31 +222,46 @@ If using device partitions the only requirement is that they contain the
216222

217223
For example, using a new, unformatted drive (``/dev/sdd`` in this case) we can
218224
use ``parted`` to create a new partition. First we list the device
219-
information::
225+
information:
226+
227+
.. prompt:: bash #
228+
229+
parted --script /dev/sdd print
230+
231+
::
220232

221-
$ parted --script /dev/sdd print
222233
Model: VBOX HARDDISK (scsi)
223234
Disk /dev/sdd: 11.5GB
224235
Sector size (logical/physical): 512B/512B
225236
Disk Flags:
226237

227238
This device is not even labeled yet, so we can use ``parted`` to create
228239
a ``gpt`` label before we create a partition, and verify again with ``parted
229-
print``::
240+
print``:
241+
242+
.. prompt:: bash #
243+
244+
parted --script /dev/sdd mklabel gpt
245+
parted --script /dev/sdd print
246+
247+
::
230248

231-
$ parted --script /dev/sdd mklabel gpt
232-
$ parted --script /dev/sdd print
233249
Model: VBOX HARDDISK (scsi)
234250
Disk /dev/sdd: 11.5GB
235251
Sector size (logical/physical): 512B/512B
236252
Partition Table: gpt
237253
Disk Flags:
238254

239255
Now lets create a single partition, and verify later if ``blkid`` can find
240-
a ``PARTUUID`` that is needed by ``ceph-volume``::
256+
a ``PARTUUID`` that is needed by ``ceph-volume``:
257+
258+
.. prompt:: bash #
259+
260+
parted --script /dev/sdd mkpart primary 1 100%
261+
blkid /dev/sdd1
262+
263+
::
241264

242-
$ parted --script /dev/sdd mkpart primary 1 100%
243-
$ blkid /dev/sdd1
244265
/dev/sdd1: PARTLABEL="primary" PARTUUID="16399d72-1e1f-467d-96ee-6fe371a7d0d4"
245266

246267

@@ -263,9 +284,11 @@ already running there are a few things to take into account:
263284

264285
The one time process for an existing OSD, with an ID of 0 and using
265286
a ``"ceph"`` cluster name would look like (the following command will **destroy
266-
any data** in the OSD)::
287+
any data** in the OSD):
288+
289+
.. prompt:: bash #
267290

268-
ceph-volume lvm prepare --filestore --osd-id 0 --osd-fsid E3D291C1-E7BF-4984-9794-B60D9FA139CB
291+
ceph-volume lvm prepare --filestore --osd-id 0 --osd-fsid E3D291C1-E7BF-4984-9794-B60D9FA139CB
269292

270293
The command line tool will not contact the monitor to generate an OSD ID and
271294
will format the LVM device in addition to storing the metadata on it so that it
@@ -278,7 +301,9 @@ Crush device class
278301

279302
To set the crush device class for the OSD, use the ``--crush-device-class`` flag.
280303

281-
ceph-volume lvm prepare --bluestore --data vg/lv --crush-device-class foo
304+
.. prompt:: bash #
305+
306+
ceph-volume lvm prepare --bluestore --data vg/lv --crush-device-class foo
282307

283308

284309
.. _ceph-volume-lvm-multipath:

0 commit comments

Comments
 (0)