From: Nitzan Mordechai Date: Tue, 11 Mar 2025 15:37:07 +0000 (+0000) Subject: OSDMonitor: exclude destroyed OSDs from "ceph node ls" output X-Git-Tag: testing/wip-pdonnell-testing-20250429.182310-reef-debug~21^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=aa3443679f251a6eff876e75aa4a09890785a8df;p=ceph-ci.git OSDMonitor: exclude destroyed OSDs from "ceph node ls" output After destroying an OSD, the command "ceph node ls" still listed the destroyed OSD, causing confusion. This fix ensures that the status of the OSD is checked before adding it to the output, aligning its behavior with "ceph osd tree," which already displays the correct status. Fixes: https://tracker.ceph.com/issues/70400 Signed-off-by: Nitzan Mordechai (cherry picked from commit 97c43c728dc8e702ce19bc14f6aa9a4790c8415b) --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index f0bb6ba1a78..49f0b90b7cb 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -2247,6 +2247,9 @@ void OSDMonitor::print_nodes(Formatter *f) // not likely though continue; } + if (osdmap.is_destroyed(osd)) { + continue; + } osds[hostname->second].push_back(osd); }