]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
vstart: support creating multiple cephfs filesystems 7998/head
authorJohn Spray <john.spray@redhat.com>
Wed, 16 Mar 2016 12:52:58 +0000 (12:52 +0000)
committerJohn Spray <john.spray@redhat.com>
Wed, 16 Mar 2016 13:07:22 +0000 (13:07 +0000)
This is handy if you want to quickly create a cluster
with lots of filesystems, for playing with e.g. what
the ceph status output looks like when multiple filesystems
are in play.

This changes the default filesystem/pool names to be
e.g. cephfs_data_a instead of just `cephfs_data`, but anything
who relied on those names in a vstart environment houldn't have
been (this won't affect teuthology tests, of course, where we
still have a few annoying hardcoded pool names).

Signed-off-by: John Spray <john.spray@redhat.com>
src/vstart.sh

index 151ca1b2877e8ca37ea1114a501b376c5766ab67..918d7e8e5900574d44ef4a1063f75b96ac8fcac3 100755 (executable)
@@ -80,11 +80,13 @@ export DYLD_LIBRARY_PATH=$CEPH_LIB:$DYLD_LIBRARY_PATH
 [ -z "$CEPH_NUM_MON" ] && CEPH_NUM_MON="$MON"
 [ -z "$CEPH_NUM_OSD" ] && CEPH_NUM_OSD="$OSD"
 [ -z "$CEPH_NUM_MDS" ] && CEPH_NUM_MDS="$MDS"
+[ -z "$CEPH_NUM_FS"  ] && CEPH_NUM_FS="$FS"
 [ -z "$CEPH_NUM_RGW" ] && CEPH_NUM_RGW="$RGW"
 
 [ -z "$CEPH_NUM_MON" ] && CEPH_NUM_MON=3
 [ -z "$CEPH_NUM_OSD" ] && CEPH_NUM_OSD=3
 [ -z "$CEPH_NUM_MDS" ] && CEPH_NUM_MDS=3
+[ -z "$CEPH_NUM_FS"  ] && CEPH_NUM_FS=1
 [ -z "$CEPH_NUM_RGW" ] && CEPH_NUM_RGW=1
 
 [ -z "$CEPH_DIR" ] && CEPH_DIR="$PWD"
@@ -627,17 +629,24 @@ EOF
 fi
 
 if [ "$start_mds" -eq 1 -a "$CEPH_NUM_MDS" -gt 0 ]; then
-    cmd="$CEPH_ADM osd pool create cephfs_data 8"
-    echo $cmd
-    $cmd
+    if [ "$CEPH_NUM_FS" -gt "1" ] ; then
+        $CEPH_ADM fs flag set enable_multiple true
+    fi
 
-    cmd="$CEPH_ADM osd pool create cephfs_metadata 8"
-    echo $cmd
-    $cmd
+    fs=0
+    for name in a b c d e f g h i j k l m n o p
+    do
+        cmd="$CEPH_ADM osd pool create cephfs_data_${name} 8"
+        $cmd
 
-    cmd="$CEPH_ADM fs new cephfs cephfs_metadata cephfs_data"
-    echo $cmd
-    $cmd
+        cmd="$CEPH_ADM osd pool create cephfs_metadata_${name} 8"
+        $cmd
+
+        cmd="$CEPH_ADM fs new cephfs_${name} cephfs_metadata_${name} cephfs_data_${name}"
+        $cmd
+        fs=$(($fs + 1))
+        [ $fs -eq $CEPH_NUM_FS ] && break
+    done
 
     mds=0
     for name in a b c d e f g h i j k l m n o p