]> git.proxmox.com Git - ceph.git/blob - ceph/doc/ceph-volume/lvm/activate.rst
eef5a0101fdbfd832bd41a574152e4a9612a37db
[ceph.git] / ceph / doc / ceph-volume / lvm / activate.rst
1 .. _ceph-volume-lvm-activate:
2
3 ``activate``
4 ============
5
6 Once :ref:`ceph-volume-lvm-prepare` is completed, and all the various steps
7 that entails are done, the volume is ready to get "activated".
8
9 This activation process enables a systemd unit that persists the OSD ID and its
10 UUID (also called ``fsid`` in Ceph CLI tools), so that at boot time it can
11 understand what OSD is enabled and needs to be mounted.
12
13 .. note:: The execution of this call is fully idempotent, and there is no
14 side-effects when running multiple times
15
16 For OSDs deployed by cephadm, please refer to :ref:cephadm-osd-activate:
17 instead.
18
19 New OSDs
20 --------
21 To activate newly prepared OSDs both the :term:`OSD id` and :term:`OSD uuid`
22 need to be supplied. For example::
23
24 ceph-volume lvm activate --bluestore 0 0263644D-0BF1-4D6D-BC34-28BD98AE3BC8
25
26 .. note:: The UUID is stored in the ``fsid`` file in the OSD path, which is
27 generated when :ref:`ceph-volume-lvm-prepare` is used.
28
29 Activating all OSDs
30 -------------------
31
32 .. note:: For OSDs deployed by cephadm, please refer to :ref:cephadm-osd-activate:
33 instead.
34
35 It is possible to activate all existing OSDs at once by using the ``--all``
36 flag. For example::
37
38 ceph-volume lvm activate --all
39
40 This call will inspect all the OSDs created by ceph-volume that are inactive
41 and will activate them one by one. If any of the OSDs are already running, it
42 will report them in the command output and skip them, making it safe to rerun
43 (idempotent).
44
45 requiring uuids
46 ^^^^^^^^^^^^^^^
47 The :term:`OSD uuid` is being required as an extra step to ensure that the
48 right OSD is being activated. It is entirely possible that a previous OSD with
49 the same id exists and would end up activating the incorrect one.
50
51
52 dmcrypt
53 ^^^^^^^
54 If the OSD was prepared with dmcrypt by ceph-volume, there is no need to
55 specify ``--dmcrypt`` on the command line again (that flag is not available for
56 the ``activate`` subcommand). An encrypted OSD will be automatically detected.
57
58
59 Discovery
60 ---------
61 With OSDs previously created by ``ceph-volume``, a *discovery* process is
62 performed using :term:`LVM tags` to enable the systemd units.
63
64 The systemd unit will capture the :term:`OSD id` and :term:`OSD uuid` and
65 persist it. Internally, the activation will enable it like::
66
67 systemctl enable ceph-volume@lvm-$id-$uuid
68
69 For example::
70
71 systemctl enable ceph-volume@lvm-0-8715BEB4-15C5-49DE-BA6F-401086EC7B41
72
73 Would start the discovery process for the OSD with an id of ``0`` and a UUID of
74 ``8715BEB4-15C5-49DE-BA6F-401086EC7B41``.
75
76 .. note:: for more details on the systemd workflow see :ref:`ceph-volume-lvm-systemd`
77
78 The systemd unit will look for the matching OSD device, and by looking at its
79 :term:`LVM tags` will proceed to:
80
81 # mount the device in the corresponding location (by convention this is
82 ``/var/lib/ceph/osd/<cluster name>-<osd id>/``)
83
84 # ensure that all required devices are ready for that OSD. In the case of
85 a journal (when ``--filestore`` is selected) the device will be queried (with
86 ``blkid`` for partitions, and lvm for logical volumes) to ensure that the
87 correct device is being linked. The symbolic link will *always* be re-done to
88 ensure that the correct device is linked.
89
90 # start the ``ceph-osd@0`` systemd unit
91
92 .. note:: The system infers the objectstore type (filestore or bluestore) by
93 inspecting the LVM tags applied to the OSD devices
94
95 Existing OSDs
96 -------------
97 For existing OSDs that have been deployed with ``ceph-disk``, they need to be
98 scanned and activated :ref:`using the simple sub-command <ceph-volume-simple>`.
99 If a different tooling was used then the only way to port them over to the new
100 mechanism is to prepare them again (losing data). See
101 :ref:`ceph-volume-lvm-existing-osds` for details on how to proceed.
102
103 Summary
104 -------
105 To recap the ``activate`` process for :term:`bluestore`:
106
107 #. require both :term:`OSD id` and :term:`OSD uuid`
108 #. enable the system unit with matching id and uuid
109 #. Create the ``tmpfs`` mount at the OSD directory in
110 ``/var/lib/ceph/osd/$cluster-$id/``
111 #. Recreate all the files needed with ``ceph-bluestore-tool prime-osd-dir`` by
112 pointing it to the OSD ``block`` device.
113 #. the systemd unit will ensure all devices are ready and linked
114 #. the matching ``ceph-osd`` systemd unit will get started
115
116 And for :term:`filestore`:
117
118 #. require both :term:`OSD id` and :term:`OSD uuid`
119 #. enable the system unit with matching id and uuid
120 #. the systemd unit will ensure all devices are ready and mounted (if needed)
121 #. the matching ``ceph-osd`` systemd unit will get started