preparemon=0
numosd=
+useosdmap=
usecrushmapsrc=
usecrushmap=
verbose=0
numosd=$1
moreargs="$moreargs --numosd $1"
;;
+ --osdmap)
+ [ -z "$2" ] && usage_exit
+ shift
+ useosdmap=$1
+ moreargs="$moreargs --osdmap $1"
+ ;;
--crushmapsrc)
[ -z "$2" ] && usage_exit
shift
### prepare-mon ###
if [ $preparemon -eq 1 ]; then
- # build osdmap
- echo "Building osdmap"
- # find highest osd id - assumes the conf file complies with osd numbering requirements
- maxosd=`$CCONF -c $conf -l osd | grep -v ^osd\$ | cut -c 5- | sort -n | tail -1`
- echo " highest numbered osd in $conf is osd.$maxosd"
- lastosd=$(($maxosd + 1))
+ if [ -n "$useosdmap" ]; then
+ echo "Using osdmap $useosdmap"
+ cp $useosdmap $dir/osdmap
+ else
+ # build osdmap
+ echo "Building generic osdmap"
- if [ -z "$numosd" ]; then
- get_conf numosd "$lastosd" "num osd" mon global
- fi
- echo " num osd = $numosd"
+ # find highest osd id - assumes the conf file complies with osd numbering requirements
+ maxosd=`$CCONF -c $conf -l osd | grep -v ^osd\$ | cut -c 5- | sort -n | tail -1`
+ echo " highest numbered osd in $conf is osd.$maxosd"
+ lastosd=$(($maxosd + 1))
- $BINDIR/osdmaptool --createsimple $numosd $dir/osdmap
+ if [ -z "$numosd" ]; then
+ get_conf numosd "$lastosd" "num osd" mon global
+ fi
+ echo " num osd = $numosd"
+
+ $BINDIR/osdmaptool --createsimple $numosd $dir/osdmap
+ fi
# import crush map?
get_conf crushmapsrc "" "crush map src" mon global
$0 -d $dir --prepare-mon $moreargs
# mons
-
get_name_list "mon"
for name in $what; do
type=`echo $name | cut -c 1-3` # e.g. 'mon', if $name is 'mon1'