]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/rook: include drivegroups in 'orch ls' result
authorSage Weil <sage@newdream.net>
Thu, 4 Nov 2021 15:25:18 +0000 (10:25 -0500)
committerSage Weil <sage@newdream.net>
Mon, 8 Nov 2021 19:30:16 +0000 (13:30 -0600)
Signed-off-by: Sage Weil <sage@newdream.net>
src/pybind/mgr/rook/module.py

index 294d1ffbf0039c339bb3b6cc8b8fed2c7012bc40..4cab22e3496c658ba15eac3d15d3c92ab441b702 100644 (file)
@@ -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