Scraping health metrics of mon devices was introduced in Nautilus, then
disabled (only in Nautilus) since the 'tell' mechanism of mons was not
reliable.
This commit fixes a bug when filtering the daemons on the device to be
scrapped (and allows scraping osd devices solely).
When:
$ ceph device scrape-health-metrics seagate_123
Error EAGAIN: device seagate_123 not claimed by any active OSD daemons
But:
$ ceph device ls
DEVICE HOST:DEV DAEMONS LIFE EXPECTANCY
seagate_123 hostname:sdc osd.1
See:
Introducing the feature in Nautilus:
PR: https://github.com/ceph/ceph/pull/24151
commit:
8d786003a44313c85c038cbdc9bd9875da197ab1
Disabling the feature in Nautilus:
PR: https://github.com/ceph/ceph/pull/31446
commit:
d592e56e74d94c6a05b9240fcb0031868acefbab
This issue exists only in Nautilus and does not require fixes in any other branch.
Fixes: https://tracker.ceph.com/issues/46871
Signed-off-by: Yaarit Hatuka <yaarit@redhat.com>
r = self.get("device " + devid)
if not r or 'device' not in r.keys():
return -errno.ENOENT, '', 'device ' + devid + ' not found'
- daemons = [d for d in r['device'].get('daemons', []) if not d.startswith('osd.')]
+ daemons = [d for d in r['device'].get('daemons', []) if d.startswith('osd.')]
if not daemons:
return (-errno.EAGAIN, '',
'device ' + devid + ' not claimed by any active OSD daemons')