#intel nodes int_nodes="[1,1],[1,3],[1,5],[1,7],[2,2],[2,4],[2,6],[2,8],[3,1],[3,3],[3,5],[3,7],[4,2],[4,4],[4,6],[4,8],[5,1],[5,3],[5,5],[5,7],[6,2],[6,4],[6,6],[6,8],[7,1],[7,3],[7,5],[7,7],[8,2],[8,4],[8,6],[8,8]" int_nodes="[1,1],[1,3],[1,5],[1,7],[2,2],[2,4],[2,6],[2,8],[3,1],[3,3],[3,5],[3,7],[4,2],[4,4],[4,6],[4,8],[5,1],[5,3],[5,5],[5,7],[6,2],[6,4],[6,6],[6,8],[7,3],[7,5],[7,7],[8,4],[8,6],[8,8]" # Atheros nodes ath_nodes="[1,2],[1,4],[1,6],[1,8],[2,1],[2,3],[2,5],[3,2],[3,4],[3,6],[3,8],[4,1],[4,3],[4,5],[4,7],[5,2],[5,4],[5,6],[5,8],[6,1],[6,3],[6,5],[6,7],[7,2],[7,4],[7,6],[8,1],[8,3],[8,5],[8,7]" # All all_nodes="$int_nodes $ath_nodes" #echo `pidof nodehandler` #echo `ps -fp $(pgrep -d, -x nodehandler)` #t = `pidof nodehandler` #Check for an existing instance of frisbeed #If exists, increment mcast address and launch a new frisbeed to serve the second #frisbee session if [ `pidof nodehandler` -ne " " ] then echo "Nodes already being imaged : Please try later" exit 1 fi # Set up pxe links on repository2 for pxe boot #c = `echo "`hostname -d | cut -f1 -d'.'`"` echo "$1" > node node_x=`cut -f1 -d',' node` node_y=`cut -f2 -d',' node` node_id="node"$node_x"-"$node_y echo " Node ID is $node_id" echo " X coordinate of node is $node_x, Y co-ordinate of node is $node_y" echo " my console is `hostname -d | cut -f1 -d'.'` " case `hostname -d | cut -f1 -d'.'` in sb1) subnet_ip="10.11.0.0" ;; sb2) subnet_ip="10.12.0.0" ;; sb3) subnet_ip="10.13.0.0" ;; sb4) subnet_ip="10.14.0.0" ;; sb5) subnet_ip="10.15.0.0" ;; sb6) subnet_ip="10.16.0.0" ;; sb7) subnet_ip="10.17.0.0" ;; grid) subnet_ip="10.10.0.0" ;; esac echo "My subnet number is $subnet_ip" echo "The nodes given are $1" wget -O - 'http://pxe:5012/pxe/setBootImage?img=orbit-1.1.4&node=${node_id}&ip=$subnet_ip' # Reset the selected nodes using cmc service wget -O - 'http://cmc:5012/cmc/allReset' function imagenodes() { echo "Imaging nodes: $1 with image $2" nodehandler system:exp:imageNode -- --nodes "[$1]" --image $2 echo " done." exit 0 } function usage() { echo "Usage: $0 {atheros|intel|all} image_file_path" >&2 echo "for example:" >&2 echo " $0 all tmp/image-tridencom-test.ndz" >&2 } if [ $# -ne 2 ] then echo "ERROR: Wrong number of arguments: $1" usage exit 1 fi image=$2 case "$1" in intel) imagenodes $int_nodes $image ;; atheros) imagenodes $ath_nodes $image ;; all) imagenodes "$int_nodes,$ath_nodes" $image ;; *) imagenodes $1 $image exit 1 ;; esac