1 | #!/bin/bash
|
---|
2 | default_image="orbit-parallel"
|
---|
3 |
|
---|
4 | # Set up pxe links on repository2 for pxe boot
|
---|
5 |
|
---|
6 | echo "$1" > node
|
---|
7 |
|
---|
8 | node_x=`cut -f1 -d',' node`
|
---|
9 |
|
---|
10 | node_y=`cut -f2 -d',' node`
|
---|
11 |
|
---|
12 | node_id="node"$node_x"-"$node_y
|
---|
13 |
|
---|
14 | #echo " Node ID is $node_id"
|
---|
15 |
|
---|
16 | #echo " X coordinate of node is $node_x, Y co-ordinate of node is $node_y"
|
---|
17 |
|
---|
18 | #echo " my console is `hostname -d | cut -f1 -d'.'` "
|
---|
19 |
|
---|
20 |
|
---|
21 |
|
---|
22 | sub=`/sbin/ifconfig eth1 | grep 'inet addr' | cut -c21-26`
|
---|
23 |
|
---|
24 | subnet_ip=$sub$node_x"."$node_y
|
---|
25 |
|
---|
26 |
|
---|
27 | echo "My subnet number is $subnet_ip"
|
---|
28 |
|
---|
29 | #echo "The nodes given are $1"
|
---|
30 |
|
---|
31 | wget -O - "http://pxe:5012/pxe/setBootImage?img=$default_image&node=$node_id&ip=$subnet_ip"
|
---|
32 |
|
---|
33 | # Reset the selected nodes using cmc service
|
---|
34 |
|
---|
35 | wget -O - "http://cmc:5012/cmc/on?x=$node_x&y=$node_y"
|
---|
36 |
|
---|
37 | wget -O - "http://cmc:5012/cmc/reset?x=$node_x&y=$node_y"
|
---|
38 |
|
---|
39 | sleep 120
|
---|
40 |
|
---|
41 | # Launch the frisbee server
|
---|
42 |
|
---|
43 | wget -O - "http://frisbee:5012/frisbee/getAddress?img=$2" > PORT
|
---|
44 |
|
---|
45 | port=`cut -c 11-15 PORT`
|
---|
46 |
|
---|
47 | wget -O - "http://pxe:5012/pxe/clearBootImage?node=$node_id&ip=$subnet_ip"
|
---|
48 |
|
---|
49 |
|
---|
50 | #sleep 180
|
---|
51 |
|
---|
52 | export GEXEC_SVRS="$node_id"
|
---|
53 |
|
---|
54 | export LD_ASSUME_KERNEL="2.4.2"
|
---|
55 |
|
---|
56 | cd /etc
|
---|
57 |
|
---|
58 | gexec -n 0 frisbee -p $port -m 224.0.0.2 -i $subnet_ip /dev/hda
|
---|
59 |
|
---|
60 | wget -O - "http://cmc:5012/cmc/reset?x=$node_x&y=$node_y"
|
---|