]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mkcephfs: take optional crush map on command line
authorSage Weil <sage@newdream.net>
Tue, 3 Mar 2009 18:32:50 +0000 (10:32 -0800)
committerSage Weil <sage@newdream.net>
Tue, 3 Mar 2009 18:42:21 +0000 (10:42 -0800)
src/cosd.cluster.conf
src/mkcephfs

index 65091157fd109e6a526bb9c8ee469ef1a877bd37..1c982abd07a292d373d454fae74e948a6a317093 100644 (file)
@@ -4,6 +4,7 @@
        conf file = /home/sage/ceph/src/cosd.ceph.conf
        log sym dir = /home/sage/ceph/src/out
        log dir = /data/$host
+       crush map = cm.txt
 
 [mon]
 [mon0]
index c7e1a091466838ec2b82e92faa9015e2001fbcdb..b16c3fbe3e2f30f3ecdf151632c270f8e628218d 100755 (executable)
@@ -24,6 +24,7 @@ allhosts=0
 clobber=""
 mkbtrfs=0
 numosd=
+usecrushmap=
 
 while [ $# -ge 1 ]; do
 case $1 in
@@ -42,9 +43,15 @@ case $1 in
            conf=$1
            ;;
     --numosd)
+           [ "$2" == "" ] && usage_exit
            shift
            numosd=$1
            ;;
+    --crushmap)
+           [ "$2" == "" ] && usage_exit
+           shift
+           usecrushmap=$1
+           ;;
     *)
            echo unrecognized option \'$1\'
            usage_exit
@@ -77,6 +84,14 @@ if [[ $what =~ "mon0" ]]; then
        echo max osd in $conf is $maxosd, num osd is $numosd
     fi
     $BINDIR/osdmaptool --clobber --createsimple $numosd $osdmap || exit 1
+
+    # import crush map?
+    get_conf crushmapsrc "$usecrushmap" "crush map" mon0 mon global
+    if [[ $crushmapsrc != "" ]]; then
+       crushmap="/tmp/crushmap.$$"
+       $BINDIR/crushtool -c $crushmapsrc -o $crushmap
+       $BINDIR/osdmaptool --clobber --import-crush $crushmap $osdmap
+    fi
 fi
 
 # create monitors, osds