]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: "Please expand your cluster first" shouldn't be shown if cluster is... 45044/head
authorVolker Theile <vtheile@suse.com>
Thu, 17 Feb 2022 08:11:54 +0000 (09:11 +0100)
committerVolker Theile <vtheile@suse.com>
Thu, 17 Feb 2022 08:11:54 +0000 (09:11 +0100)
This PR will assume that a cluster is already up and fully running. If this should not be the expected behaviour, deployment tools have to set 'INSTALLED' explicitly. Without this assumption it might happen that upgraded and fully running clusters, e.g. Octopus -> Pacific, will show the 'Expand Cluster' on first log in.

cephadm will take care that the bootstrap phase will write the necessary key to show the 'Expand cluster' page.

Fixes: https://tracker.ceph.com/issues/54215
Signed-off-by: Volker Theile <vtheile@suse.com>
(cherry picked from commit 48fff60b63785ec07f71d3e59394b0c08357247c)

Conflicts:
src/cephadm/cephadm

Signed-off-by: Volker Theile <vtheile@suse.com>
src/cephadm/cephadm
src/pybind/mgr/dashboard/services/cluster.py

index bddcd46c82c3793026814d28b26a4d2780681e52..333fd2a9f4116032bc349e40dc94adff71dc2ebc 100755 (executable)
@@ -4646,6 +4646,9 @@ def command_bootstrap(ctx):
     logger.info('Enabling autotune for osd_memory_target')
     cli(['config', 'set', 'osd', 'osd_memory_target_autotune', 'true'])
 
+    # Notify the Dashboard to show the 'Expand cluster' page on first log in.
+    cli(['config-key', 'set', 'mgr/dashboard/cluster/status', 'INSTALLED'])
+
     logger.info('You can access the Ceph CLI with:\n\n'
                 '\tsudo %s shell --fsid %s -c %s -k %s\n' % (
                     sys.argv[0],
index aad517a21d68ad3f77d08742239b66c9e9eeea9c..a057f24381f78a406979c88de03651aa39fb473f 100644 (file)
@@ -12,7 +12,12 @@ class ClusterModel:
 
     status: Status
 
-    def __init__(self, status=Status.INSTALLED.name):
+    def __init__(self, status=Status.POST_INSTALLED.name):
+        """
+        :param status: The status of the cluster. Assume that the cluster
+            is already functional by default.
+        :type status: str
+        """
         self.status = self.Status[status]
 
     def dict(self):
@@ -23,4 +28,8 @@ class ClusterModel:
 
     @classmethod
     def from_db(cls):
-        return cls(status=mgr.get_store('cluster/status', cls.Status.INSTALLED.name))
+        """
+        Get the stored cluster status from the configuration key/value store.
+        If the status is not set, assume it is already fully functional.
+        """
+        return cls(status=mgr.get_store('cluster/status', cls.Status.POST_INSTALLED.name))