]> git.proxmox.com Git - ceph.git/blob - ceph/doc/rados/operations/devices.rst
import ceph nautilus 14.2.2
[ceph.git] / ceph / doc / rados / operations / devices.rst
1 Device Management
2 =================
3
4 Ceph tracks which hardware storage devices (e.g., HDDs, SSDs) are consumed by
5 which daemons, and collects health metrics about those devices in order to
6 provide tools to predict and/or automatically respond to hardware failure.
7
8 Device tracking
9 ---------------
10
11 You can query which storage devices are in use with::
12
13 ceph device ls
14
15 You can also list devices by daemon or by host::
16
17 ceph device ls-by-daemon <daemon>
18 ceph device ls-by-host <host>
19
20 For any individual device, you can query information about its
21 location and how it is being consumed with::
22
23 ceph device info <devid>
24
25
26 Enabling monitoring
27 -------------------
28
29 Ceph can also monitor health metrics associated with your device. For
30 example, SATA hard disks implement a standard called SMART that
31 provides a wide range of internal metrics about the device's usage and
32 health, like the number of hours powered on, number of power cycles,
33 or unrecoverable read errors. Other device types like SAS and NVMe
34 implement a similar set of metrics (via slightly different standards).
35 All of these can be collected by Ceph via the ``smartctl`` tool.
36
37 You can enable or disable health monitoring with::
38
39 ceph device monitoring on
40
41 or::
42
43 ceph device monitoring off
44
45
46 Scraping
47 --------
48
49 If monitoring is enabled, metrics will automatically be scraped at regular intervals. That interval can be configured with::
50
51 ceph config set mgr mgr/devicehealth/scrape_frequency <seconds>
52
53 The default is to scrape once every 24 hours.
54
55 You can manually trigger a scrape of all devices with::
56
57 ceph device scrape-health-metrics
58
59 A single device can be scraped with::
60
61 ceph device scrape-health-metrics <device-id>
62
63 Or a single daemon's devices can be scraped with::
64
65 ceph device scrape-daemon-health-metrics <who>
66
67 The stored health metrics for a device can be retrieved (optionally
68 for a specific timestamp) with::
69
70 ceph device get-health-metrics <devid> [sample-timestamp]
71
72 Failure prediction
73 ------------------
74
75 Ceph can predict life expectancy and device failures based on the
76 health metrics it collects. There are three modes:
77
78 * *none*: disable device failure prediction.
79 * *local*: use a pre-trained prediction model from the ceph-mgr daemon
80 * *cloud*: share device health and performance metrics an external
81 cloud service run by ProphetStor, using either their free service or
82 a paid service with more accurate predictions
83
84 The prediction mode can be configured with::
85
86 ceph config set global device_failure_prediction_mode <mode>
87
88 Prediction normally runs in the background on a periodic basis, so it
89 may take some time before life expectancy values are populated. You
90 can see the life expectancy of all devices in output from::
91
92 ceph device ls
93
94 You can also query the metadata for a specific device with::
95
96 ceph device info <devid>
97
98 You can explicitly force prediction of a device's life expectancy with::
99
100 ceph device predict-life-expectancy <devid>
101
102 If you are not using Ceph's internal device failure prediction but
103 have some external source of information about device failures, you
104 can inform Ceph of a device's life expectancy with::
105
106 ceph device set-life-expectancy <devid> <from> [<to>]
107
108 Life expectancies are expressed as a time interval so that
109 uncertainty can be expressed in the form of a wide interval. The
110 interval end can also be left unspecified.
111
112 Health alerts
113 -------------
114
115 The ``mgr/devicehealth/warn_threshold`` controls how soon an expected
116 device failure must be before we generate a health warning.
117
118 The stored life expectancy of all devices can be checked, and any
119 appropriate health alerts generated, with::
120
121 ceph device check-health
122
123 Automatic Mitigation
124 --------------------
125
126 If the ``mgr/devicehealth/self_heal`` option is enabled (it is by
127 default), then for devices that are expected to fail soon the module
128 will automatically migrate data away from them by marking the devices
129 "out".
130
131 The ``mgr/devicehealth/mark_out_threshold`` controls how soon an
132 expected device failure must be before we automatically mark an osd
133 "out".