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