Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / doc / ceph-volume / systemd.rst
1 .. _ceph-volume-systemd:
2
3 systemd
4 =======
5 As part of the activation process (either with :ref:`ceph-volume-lvm-activate`
6 or :ref:`ceph-volume-simple-activate`), systemd units will get enabled that
7 will use the OSD id and uuid as part of their name. These units will be run
8 when the system boots, and will proceed to activate their corresponding
9 volumes via their sub-command implementation.
10
11 The API for activation is a bit loose, it only requires two parts: the
12 subcommand to use and any extra meta information separated by a dash. This
13 convention makes the units look like::
14
15     ceph-volume@{command}-{extra metadata}
16
17 The *extra metadata* can be anything needed that the subcommand implementing
18 the processing might need. In the case of :ref:`ceph-volume-lvm` and
19 :ref:`ceph-volume-simple`, both look to consume the :term:`OSD id` and :term:`OSD uuid`,
20 but this is not a hard requirement, it is just how the sub-commands are
21 implemented.
22
23 Both the command and extra metadata gets persisted by systemd as part of the
24 *"instance name"* of the unit.  For example an OSD with an ID of 0, for the
25 ``lvm`` sub-command would look like::
26
27     systemctl enable ceph-volume@lvm-0-0A3E1ED2-DA8A-4F0E-AA95-61DEC71768D6
28
29 The enabled unit is a :term:`systemd oneshot` service, meant to start at boot
30 after the local filesystem is ready to be used.
31
32
33 Failure and Retries
34 -------------------
35 It is common to have failures when a system is coming up online. The devices
36 are sometimes not fully available and this unpredictable behavior may cause an
37 OSD to not be ready to be used.
38
39 There are two configurable environment variables used to set the retry
40 behavior:
41
42 * ``CEPH_VOLUME_SYSTEMD_TRIES``: Defaults to 30
43 * ``CEPH_VOLUME_SYSTEMD_INTERVAL``: Defaults to 5
44
45 The *"tries"* is a number that sets the maximum amount of times the unit will
46 attempt to activate an OSD before giving up.
47
48 The *"interval"* is a value in seconds that determines the waiting time before
49 initiating another try at activating the OSD.