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]
80 The ``mgr/devicehealth/warn_threshold`` controls how soon an expected
81 device failure must be before we generate a health warning.
83 The stored life expectancy of all devices can be checked, and any
84 appropriate health alerts generated, with::
86 ceph device check-health
91 If the ``mgr/devicehealth/self_heal`` option is enabled (it is by
92 default), then for devices that are expected to fail soon the module
93 will automatically migrate data away from them by marking the devices
96 The ``mgr/devicehealth/mark_out_threshold`` controls how soon an
97 expected device failure must be before we automatically mark an osd