From d5528a7e8e3b8289288d5a0a55d57d9935a3966c Mon Sep 17 00:00:00 2001 From: Yaarit Hatuka Date: Fri, 18 Sep 2020 03:25:56 +0000 Subject: [PATCH] ceph.spec.in, debian/control: add smartmontools and nvme-cli dependencies These packages are needed in order to scrape device health metrics from devices used by OSD and MON daemons. smartmontools' smartctl is what we use in order to scrape devices' SMART attributes and general health metrics. In addition, we use nvme-cli tool on NVMe devices, which fetches vendor specific NVMe related health metrics. Ceph rely on these tools for proper functioning of the underlying layers of devicehealth mgr module, and other mgr modules which use devicehealth functionality (such as diskprediction_local, telemetry, dashboard). Essentially, most of devicehealth commands rely on proper functioning of smartctl, otherwise they lack the device health metrics. For example, in case smartctl is missing, the commands: ceph device scrape-daemon-health-metrics ceph device scrape-health-metrics [] will not be able to scrape health metrics, and the command: ceph device predict-life-expectancy will not provide any meaningful output (since there are no metrics). In short, when we scrape a device by its daemon (be it an OSD or a MON): ceph device scrape-daemon-health-metrics The devicehealth module command eventually invokes a block_device_get_metrics() call in either osd/OSD.cc or mon/Monitor.cc, which wraps calls to both block_device_run_smartctl() (spawns smartctl) block_device_run_vendor_nvme() (spawns nvme) in common/blkdev.cc. Minimum version requirements: 'smartmontools' is the package name, which contains two utility programs: 'smartd' and 'smartctl'. Ceph uses the latter. Version 6.7 of smartctl first introduced the --json option (beta), which allows to output the metrics in a JSON format. Since then a few adjustments were made and the feature officially launched in smartctl version 7.0. Since we rely on the JSON format to process the metrics, we must have smartmontools' smartctl version >= 7. That said, we choose not to specify smartmontools version here on purpose, since there might be a scenario where: We specified smartmontools version to be >= 7. smartmontools 7 is not available yet in rhel 8 / centos 8. A user installs via rpm ceph-osd, for example. smartmontools will not be installed (since version >= 7 is not available in this repo yet). Then the user upgrades to 8.3 (which should have smartmontools >= 7), but smartmontools will not get upgraded (since it's not installed). In the scenario where we do not specify a version, smartmontools 6.6 will be installed, but it will be upgraded to >= 7 when a user upgrades (and if it's a fresh installation - version >= 7 would be installed anyway). nvme-cli does not have a minimum version. We use 'Recommends' for both rpm and deb packages since we do not want the installation to fail in case of conflicts. 'Recommends' weakens the dependency to be installed in case possible, but ignores it in cases of conflicts with other dependencies. It's worth mentioning that smartmontools and nvme-cli dependencies exist in ceph-container builds. We add them here for the cases of bare metal installations. In the future we will add a separate package (with smartmontools and nvme-cli dependencies) that can be installed on any node (running rbd-mirror, rgw, mds, mgr, etc.), in order to be able to collect the health metrics of its devices and offer their life expectancy prediction. Fixes: https://tracker.ceph.com/issues/47479 Signed-off-by: Yaarit Hatuka --- ceph.spec.in | 8 ++++++++ debian/control | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/ceph.spec.in b/ceph.spec.in index 8d9d58d8e8392..58fca75882bec 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -445,6 +445,10 @@ Group: System/Filesystems %endif Provides: ceph-test:/usr/bin/ceph-monstore-tool Requires: ceph-base = %{_epoch_prefix}%{version}-%{release} +%if 0%{?weak_deps} +Recommends: nvme-cli +Recommends: smartmontools +%endif %description mon ceph-mon is the cluster monitor daemon for the Ceph distributed file system. One or more instances of ceph-mon form a Paxos part-time @@ -699,6 +703,10 @@ Requires: lvm2 Requires: sudo Requires: libstoragemgmt Requires: python%{python3_pkgversion}-ceph-common = %{_epoch_prefix}%{version}-%{release} +%if 0%{?weak_deps} +Recommends: nvme-cli +Recommends: smartmontools +%endif %description osd ceph-osd is the object storage daemon for the Ceph distributed file system. It is responsible for storing objects on a local file system diff --git a/debian/control b/debian/control index 509aa78dec1d0..19aa7a8464a5a 100644 --- a/debian/control +++ b/debian/control @@ -364,6 +364,8 @@ Depends: ceph-base (= ${binary:Version}), ${shlibs:Depends}, Replaces: ceph (<< 10), ceph-test (<< 12.2.2-14) Breaks: ceph (<< 10), ceph-test (<< 12.2.2-14) +Recommends: nvme-cli, + smartmontools, Description: monitor server for the ceph storage system Ceph is a massively scalable, open-source, distributed storage system that runs on commodity hardware and delivers object, @@ -397,6 +399,8 @@ Depends: ceph-base (= ${binary:Version}), ${shlibs:Depends}, Replaces: ceph (<< 10), ceph-test (<< 12.2.2-14) Breaks: ceph (<< 10), ceph-test (<< 12.2.2-14) +Recommends: nvme-cli, + smartmontools, Description: OSD server for the ceph storage system Ceph is a massively scalable, open-source, distributed storage system that runs on commodity hardware and delivers object, -- 2.39.5