Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / doc / ceph-volume / simple / activate.rst
1 .. _ceph-volume-simple-activate:
2
3 ``activate``
4 ============
5 Once :ref:`ceph-volume-simple-scan` has been completed, and all the metadata
6 captured for an OSD has been persisted to ``/etc/ceph/osd/{id}-{uuid}.json``
7 the OSD is now ready to get "activated".
8
9 This activation process **disables** all ``ceph-disk`` systemd units by masking
10 them, to prevent the UDEV/ceph-disk interaction that will attempt to start them
11 up at boot time.
12
13 The disabling of ``ceph-disk`` units is done only when calling ``ceph-volume
14 simple activate`` directly, but is is avoided when being called by systemd when
15 the system is booting up.
16
17 The activation process requires using both the :term:`OSD id` and :term:`OSD uuid`
18 To activate parsed OSDs::
19
20     ceph-volume simple activate 0 6cc43680-4f6e-4feb-92ff-9c7ba204120e
21
22 The above command will assume that a JSON configuration will be found in::
23
24     /etc/ceph/osd/0-6cc43680-4f6e-4feb-92ff-9c7ba204120e.json
25
26 Alternatively, using a path to a JSON file directly is also possible::
27
28     ceph-volume simple activate --file /etc/ceph/osd/0-6cc43680-4f6e-4feb-92ff-9c7ba204120e.json
29
30 requiring uuids
31 ^^^^^^^^^^^^^^^
32 The :term:`OSD uuid` is being required as an extra step to ensure that the
33 right OSD is being activated. It is entirely possible that a previous OSD with
34 the same id exists and would end up activating the incorrect one.
35
36
37 Discovery
38 ---------
39 With OSDs previously scanned by ``ceph-volume``, a *discovery* process is
40 performed using ``blkid`` and ``lvm``. There is currently support only for
41 devices with GPT partitions and LVM logical volumes.
42
43 The GPT partitions will have a ``PARTUUID`` that can be queried by calling out
44 to ``blkid``, and the logical volumes will have a ``lv_uuid`` that can be
45 queried against ``lvs`` (the LVM tool to list logical volumes).
46
47 This discovery process ensures that devices can be correctly detected even if
48 they are repurposed into another system or if their name changes (as in the
49 case of non-persisting names like ``/dev/sda1``)
50
51 The JSON configuration file used to map what devices go to what OSD will then
52 coordinate the mounting and symlinking as part of activation.
53
54 To ensure that the symlinks are always correct, if they exist in the OSD
55 directory, the symlinks will be re-done.
56
57 A systemd unit will capture the :term:`OSD id` and :term:`OSD uuid` and
58 persist it. Internally, the activation will enable it like::
59
60     systemctl enable ceph-volume@simple-$id-$uuid
61
62 For example::
63
64     systemctl enable ceph-volume@simple-0-8715BEB4-15C5-49DE-BA6F-401086EC7B41
65
66 Would start the discovery process for the OSD with an id of ``0`` and a UUID of
67 ``8715BEB4-15C5-49DE-BA6F-401086EC7B41``.
68
69
70 The systemd process will call out to activate passing the information needed to
71 identify the OSD and its devices, and it 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 and properly linked,
77 regardless of objectstore used (filestore or bluestore). The symbolic link will
78 **always** be re-done to ensure that the correct device is linked.
79
80 # start the ``ceph-osd@0`` systemd unit