mirror of
https://github.com/ceph/ceph
synced 2025-03-19 08:57:29 +00:00
Merge pull request #44221 from BenoitKnecht/ceph-mon-device-metrics
mon: Abort device health when device not found Reviewed-by: Yaarit Hatuka <yaarit@redhat.com>
This commit is contained in:
commit
0a23e6d341
@ -421,6 +421,11 @@ int Monitor::do_admin_command(
|
||||
cmd_getval(cmdmap, "devid", want_devid);
|
||||
|
||||
string devname = store->get_devname();
|
||||
if (devname.empty()) {
|
||||
err << "could not determine device name for " << store->get_path();
|
||||
r = -ENOENT;
|
||||
goto abort;
|
||||
}
|
||||
set<string> devnames;
|
||||
get_raw_devices(devname, &devnames);
|
||||
json_spirit::mObject json_map;
|
||||
|
@ -57,6 +57,10 @@ class MonitorDBStore
|
||||
return devname;
|
||||
}
|
||||
|
||||
std::string get_path() {
|
||||
return path;
|
||||
}
|
||||
|
||||
std::shared_ptr<PriorityCache::PriCache> get_priority_cache() const {
|
||||
return db->get_priority_cache();
|
||||
}
|
||||
|
@ -20,7 +20,10 @@ LockPersonality=true
|
||||
MemoryDenyWriteExecute=true
|
||||
# Need NewPrivileges via `sudo smartctl`
|
||||
NoNewPrivileges=false
|
||||
PrivateDevices=yes
|
||||
# We need access to block devices to check the health of the disk backing the
|
||||
# monitor DB store. It can be set to `true` if you're not interested in that
|
||||
# feature.
|
||||
PrivateDevices=false
|
||||
PrivateTmp=true
|
||||
ProtectControlGroups=true
|
||||
ProtectHome=true
|
||||
|
Loading…
Reference in New Issue
Block a user