]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/rook: show filesystems in 'orch ls'
authorSage Weil <sage@redhat.com>
Thu, 12 Mar 2020 18:41:37 +0000 (14:41 -0400)
committerSage Weil <sage@redhat.com>
Thu, 12 Mar 2020 21:10:35 +0000 (17:10 -0400)
The count vs size discrepancy is weird since rook things in terms of
ranks (*2 if standby) vs just a count.

Signed-off-by: Sage Weil <sage@redhat.com>
src/pybind/mgr/rook/module.py

index ef72d26f59b2e442af329adfdd7375c671fdd740..32af1bba2dace8490b2a5981f6ba3899398ea88f 100644 (file)
@@ -296,7 +296,30 @@ class RookOrchestrator(MgrModule, orchestrator.Orchestrator):
                 last_refresh=now,
             )
 
-        # FIXME: CephFilesystems
+        # CephFilesystems
+        all_fs = self.rook_cluster.rook_api_get(
+            "cephfilesystems/")
+        self.log.debug('CephFilesystems %s' % all_fs)
+        for fs in all_fs.get('items', []):
+            svc = 'mds.' + fs['metadata']['name']
+            if svc in spec:
+                continue
+            # FIXME: we are conflating active (+ standby) with count
+            active = fs['spec'].get('metadataServer', {}).get('activeCount', 1)
+            total_mds = active
+            if fs['spec'].get('metadataServer', {}).get('activeStandby', False):
+                total_mds = active * 2
+            spec[svc] = orchestrator.ServiceDescription(
+                service_name=svc,
+                spec=orchestrator.ServiceSpec(
+                    svc,
+                    placement=orchestrator.PlacementSpec(count=active),
+                ),
+                size=total_mds,
+                container_image_name=image_name,
+                last_refresh=now,
+            )
+
         # FIXME: CephObjectstores
 
         for dd in self._list_daemons():