]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/rook: List nfs services in orch ls
authorVarsha Rao <varao@redhat.com>
Wed, 4 Nov 2020 10:16:23 +0000 (15:46 +0530)
committerVarsha Rao <varao@redhat.com>
Thu, 10 Dec 2020 07:58:17 +0000 (13:28 +0530)
Fixes: https://tracker.ceph.com/issues/48071
Signed-off-by: Varsha Rao <varao@redhat.com>
src/pybind/mgr/rook/module.py

index 362319a8f694a60bd8831f029512e0dd1df18b6a..1f775eefc2c28d8664c43523fa6b31ae4840514c 100644 (file)
@@ -351,6 +351,28 @@ class RookOrchestrator(MgrModule, orchestrator.Orchestrator):
                 last_refresh=now,
             )
 
+        # CephNFSes
+        all_nfs = self.rook_cluster.rook_api_get(
+            "cephnfses/")
+        self.log.warning('CephNFS %s' % all_nfs)
+        for nfs in all_nfs.get('items', []):
+            nfs_name = nfs['metadata']['name']
+            svc = 'nfs.' + nfs_name
+            if svc in spec:
+                continue
+            active = nfs['spec'].get('server', {}).get('active')
+            spec[svc] = orchestrator.ServiceDescription(
+                    spec=NFSServiceSpec(
+                        service_id=nfs_name,
+                        pool=nfs['spec']['rados']['pool'],
+                        namespace=nfs['spec']['rados'].get('namespace', None),
+                        placement=PlacementSpec(count=active),
+                        ),
+                    size=active,
+                    container_image_name=image_name,
+                    last_refresh=now,
+                    )
+
         for dd in self._list_daemons():
             if dd.service_name() not in spec:
                 continue