From cd7ccb3d2868ab7c916f87c5417acd9a2bb410b7 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 4 Nov 2021 10:25:18 -0500 Subject: [PATCH] mgr/rook: include drivegroups in 'orch ls' result Signed-off-by: Sage Weil --- src/pybind/mgr/rook/module.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/rook/module.py b/src/pybind/mgr/rook/module.py index 294d1ffbf0039..4cab22e3496c6 100644 --- a/src/pybind/mgr/rook/module.py +++ b/src/pybind/mgr/rook/module.py @@ -364,6 +364,9 @@ class RookOrchestrator(MgrModule, orchestrator.Orchestrator): ) if service_type == 'osd' or service_type is None: # OSDs + # FIXME: map running OSDs back to their respective services... + + # the catch-all unmanaged all_osds = self.rook_cluster.get_osds() svc = 'osd' spec[svc] = orchestrator.ServiceDescription( @@ -373,8 +376,17 @@ class RookOrchestrator(MgrModule, orchestrator.Orchestrator): ), size=len(all_osds), last_refresh=now, - running= sum(osd.status.phase == 'Running' for osd in all_osds) + running= sum(osd.status.phase == 'Running' for osd in all_osds) ) + + # drivegroups + for name, dg in self._drive_group_map.items(): + spec[f'osd.{name}'] = orchestrator.ServiceDescription( + spec=dg, + last_refresh=now, + size=0, + running=0, + ) if service_type == 'rbd-mirror' or service_type is None: # rbd-mirrors -- 2.39.5