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.
11 You can query which storage devices are in use with::
15 You can also list devices by daemon or by host::
17 ceph device ls-by-daemon <daemon>
18 ceph device ls-by-host <host>
20 For any individual device, you can query information about its
21 location and how it is being consumed with::
23 ceph device info <devid>
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.
37 You can enable or disable health monitoring with::
39 ceph device monitoring on
43 ceph device monitoring off
49 If monitoring is enabled, metrics will automatically be scraped at regular intervals. That interval can be configured with::
51 ceph config set mgr mgr/devicehealth/scrape_frequency <seconds>
53 The default is to scrape once every 24 hours.
55 You can manually trigger a scrape of all devices with::
57 ceph device scrape-health-metrics
59 A single device can be scraped with::
61 ceph device scrape-health-metrics <device-id>
63 Or a single daemon's devices can be scraped with::
65 ceph device scrape-daemon-health-metrics <who>
67 The stored health metrics for a device can be retrieved (optionally
68 for a specific timestamp) with::
70 ceph device get-health-metrics <devid> [sample-timestamp]
75 Ceph can predict life expectancy and device failures based on the
76 health metrics it collects. There are three modes:
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
84 The prediction mode can be configured with::
86 ceph config set global device_failure_prediction_mode <mode>
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::
94 You can also query the metadata for a specific device with::
96 ceph device info <devid>
98 You can explicitly force prediction of a device's life expectancy with::
100 ceph device predict-life-expectancy <devid>
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::
106 ceph device set-life-expectancy <devid> <from> [<to>]
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.
115 The ``mgr/devicehealth/warn_threshold`` controls how soon an expected
116 device failure must be before we generate a health warning.
118 The stored life expectancy of all devices can be checked, and any
119 appropriate health alerts generated, with::
121 ceph device check-health
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
131 The ``mgr/devicehealth/mark_out_threshold`` controls how soon an
132 expected device failure must be before we automatically mark an osd