]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
vstart: do not attempt to re-initialize dashboard for existing cluster
authorJason Dillaman <dillaman@redhat.com>
Thu, 26 Jul 2018 13:31:32 +0000 (09:31 -0400)
committerJason Dillaman <dillaman@redhat.com>
Fri, 27 Jul 2018 12:05:43 +0000 (08:05 -0400)
The dashboard should only be initialized when the "-n" option is
specified to create a new cluster. This avoid errors when restarting
an existing cluster and it attempts to initialize the dashboard
again.

Fixes: https://tracker.ceph.com/issues/24019
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/vstart.sh

index fbb4aecca9daa0cb544e11f387406d71f80a2844..37151eee38b5243f3958e6534dc69487c5dffcec 100755 (executable)
@@ -709,30 +709,30 @@ start_mgr() {
             key_fn=$CEPH_DEV_DIR/mgr.$name/keyring
             $SUDO $CEPH_BIN/ceph-authtool --create-keyring --gen-key --name=mgr.$name $key_fn
             ceph_adm -i $key_fn auth add mgr.$name mon 'allow profile mgr' mds 'allow *' osd 'allow *'
-        fi
 
-        wconf <<EOF
+            wconf <<EOF
 [mgr.$name]
         host = $HOSTNAME
 EOF
 
-        if $with_mgr_dashboard ; then
-            ceph_adm config set mgr mgr/dashboard/$name/server_port $MGR_PORT
+            if $with_mgr_dashboard ; then
+                ceph_adm config set mgr mgr/dashboard/$name/server_port $MGR_PORT
+                if [ $mgr -eq 1 ]; then
+                    DASH_URLS="https://$IP:$MGR_PORT"
+                else
+                    DASH_URLS+=", https://$IP:$MGR_PORT"
+                fi
+            fi
+           MGR_PORT=$(($MGR_PORT + 1000))
+
+           ceph_adm config set mgr mgr/restful/$name/server_port $MGR_PORT
             if [ $mgr -eq 1 ]; then
-                DASH_URLS="https://$IP:$MGR_PORT"
+                RESTFUL_URLS="https://$IP:$MGR_PORT"
             else
-                DASH_URLS+=", https://$IP:$MGR_PORT"
+                RESTFUL_URLS+=", https://$IP:$MGR_PORT"
             fi
+           MGR_PORT=$(($MGR_PORT + 1000))
         fi
-       MGR_PORT=$(($MGR_PORT + 1000))
-
-       ceph_adm config set mgr mgr/restful/$name/server_port $MGR_PORT
-        if [ $mgr -eq 1 ]; then
-            RESTFUL_URLS="https://$IP:$MGR_PORT"
-        else
-            RESTFUL_URLS+=", https://$IP:$MGR_PORT"
-        fi
-       MGR_PORT=$(($MGR_PORT + 1000))
 
         echo "Starting mgr.${name}"
         run 'mgr' $CEPH_BIN/ceph-mgr -i $name $ARGS
@@ -740,22 +740,23 @@ EOF
 
     # use tell mgr here because the first mgr might not have activated yet
     # to register the python module commands.
-
-    # setting login credentials for dashboard
-    if $with_mgr_dashboard; then
-        ceph_adm tell mgr dashboard ac-user-create admin admin administrator
-        if ! ceph_adm tell mgr dashboard create-self-signed-cert;  then
-            echo dashboard module not working correctly!
+    if [ "$new" -eq 1 ]; then
+        # setting login credentials for dashboard
+        if $with_mgr_dashboard; then
+            ceph_adm tell mgr dashboard ac-user-create admin admin administrator
+            if ! ceph_adm tell mgr dashboard create-self-signed-cert;  then
+                echo dashboard module not working correctly!
+            fi
         fi
-    fi
 
-    if ceph_adm tell mgr restful create-self-signed-cert; then
-        SF=`mktemp`
-        ceph_adm restful create-key admin -o $SF
-        RESTFUL_SECRET=`cat $SF`
-        rm $SF
-    else 
-        echo MGR Restful is not working, perhaps the package is not installed?
+        if ceph_adm tell mgr restful create-self-signed-cert; then
+            SF=`mktemp`
+            ceph_adm restful create-key admin -o $SF
+            RESTFUL_SECRET=`cat $SF`
+            rm $SF
+        else
+            echo MGR Restful is not working, perhaps the package is not installed?
+        fi
     fi
 }
 
@@ -1132,13 +1133,15 @@ fi
 echo "started.  stop.sh to stop.  see out/* (e.g. 'tail -f out/????') for debug output."
 
 echo ""
-if $with_mgr_dashboard; then
-    echo "dashboard urls: $DASH_URLS"
-    echo "  w/ user/pass: admin / admin"
+if [ "$new" -eq 1 ]; then
+    if $with_mgr_dashboard; then
+        echo "dashboard urls: $DASH_URLS"
+        echo "  w/ user/pass: admin / admin"
+    fi
+    echo "restful urls: $RESTFUL_URLS"
+    echo "  w/ user/pass: admin / $RESTFUL_SECRET"
+    echo ""
 fi
-echo "restful urls: $RESTFUL_URLS"
-echo "  w/ user/pass: admin / $RESTFUL_SECRET"
-echo ""
 echo ""
 echo "export PYTHONPATH=./pybind:$PYTHONPATH"
 echo "export LD_LIBRARY_PATH=$CEPH_LIB"