]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
vstart.sh: do not init fsmap if "$new == 0" 13974/head
authorKefu Chai <kchai@redhat.com>
Wed, 22 Mar 2017 05:04:06 +0000 (13:04 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 23 Mar 2017 16:55:40 +0000 (00:55 +0800)
we cannot create a new cephfs using a non-empty pool without '--force'
option now, so the "ceph fs new" command fails with "vstart.sh -k".

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/vstart.sh

index 0f22393aa5851bfc6eee3ab56dcb68d5e9ed76e4..015db3ad04fd26acd0e8703ab6de36150f65964f 100755 (executable)
@@ -604,20 +604,22 @@ EOF
 }
 
 start_mds() {
-    if [ "$CEPH_NUM_FS" -gt "0" ] ; then
-        if [ "$CEPH_NUM_FS" -gt "1" ] ; then
-            ceph_adm fs flag set enable_multiple true --yes-i-really-mean-it
-        fi
+    if [ $new -eq 1 ]; then
+        if [ "$CEPH_NUM_FS" -gt "0" ] ; then
+            if [ "$CEPH_NUM_FS" -gt "1" ] ; then
+                ceph_adm fs flag set enable_multiple true --yes-i-really-mean-it
+            fi
 
-        local fs=0
-        for name in a b c d e f g h i j k l m n o p
-        do
-            ceph_adm osd pool create "cephfs_data_${name}" 8
-            ceph_adm osd pool create "cephfs_metadata_${name}" 8
-            ceph_adm fs new "cephfs_${name}" "cephfs_metadata_${name}" "cephfs_data_${name}"
-            fs=$(($fs + 1))
-            [ $fs -eq $CEPH_NUM_FS ] && break
-        done
+            local fs=0
+            for name in a b c d e f g h i j k l m n o p
+            do
+                ceph_adm osd pool create "cephfs_data_${name}" 8
+                ceph_adm osd pool create "cephfs_metadata_${name}" 8
+                ceph_adm fs new "cephfs_${name}" "cephfs_metadata_${name}" "cephfs_data_${name}"
+                fs=$(($fs + 1))
+                [ $fs -eq $CEPH_NUM_FS ] && break
+            done
+        fi
     fi
 
     local mds=0