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