1 | #intel nodes
|
---|
2 | 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]"
|
---|
3 | 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]"
|
---|
4 | # Atheros nodes
|
---|
5 |
|
---|
6 | 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]"
|
---|
7 | # All
|
---|
8 |
|
---|
9 | all_nodes="$int_nodes $ath_nodes"
|
---|
10 |
|
---|
11 | #echo `pidof nodehandler`
|
---|
12 | #echo `ps -fp $(pgrep -d, -x nodehandler)`
|
---|
13 | #t = `pidof nodehandler`
|
---|
14 |
|
---|
15 | #Check for an existing instance of frisbeed
|
---|
16 |
|
---|
17 | #If exists, increment mcast address and launch a new frisbeed to serve the second
|
---|
18 | #frisbee session
|
---|
19 |
|
---|
20 | if [ `pidof nodehandler` -ne " " ]
|
---|
21 | then
|
---|
22 | echo "Nodes already being imaged : Please try later"
|
---|
23 | exit 1
|
---|
24 | fi
|
---|
25 |
|
---|
26 |
|
---|
27 |
|
---|
28 |
|
---|
29 | # Set up pxe links on repository2 for pxe boot
|
---|
30 | #c = `echo "`hostname -d | cut -f1 -d'.'`"`
|
---|
31 |
|
---|
32 | echo "$1" > node
|
---|
33 |
|
---|
34 | node_x=`cut -f1 -d',' node`
|
---|
35 |
|
---|
36 | node_y=`cut -f2 -d',' node`
|
---|
37 |
|
---|
38 | node_id="node"$node_x"-"$node_y
|
---|
39 |
|
---|
40 | echo " Node ID is $node_id"
|
---|
41 |
|
---|
42 | echo " X coordinate of node is $node_x, Y co-ordinate of node is $node_y"
|
---|
43 |
|
---|
44 | echo " my console is `hostname -d | cut -f1 -d'.'` "
|
---|
45 |
|
---|
46 | case `hostname -d | cut -f1 -d'.'` in
|
---|
47 |
|
---|
48 | sb1)
|
---|
49 |
|
---|
50 | subnet_ip="10.11.0.0"
|
---|
51 | ;;
|
---|
52 |
|
---|
53 | sb2)
|
---|
54 |
|
---|
55 | subnet_ip="10.12.0.0"
|
---|
56 | ;;
|
---|
57 |
|
---|
58 | sb3)
|
---|
59 |
|
---|
60 | subnet_ip="10.13.0.0"
|
---|
61 | ;;
|
---|
62 |
|
---|
63 | sb4)
|
---|
64 |
|
---|
65 | subnet_ip="10.14.0.0"
|
---|
66 | ;;
|
---|
67 |
|
---|
68 | sb5)
|
---|
69 |
|
---|
70 | subnet_ip="10.15.0.0"
|
---|
71 | ;;
|
---|
72 |
|
---|
73 | sb6)
|
---|
74 |
|
---|
75 | subnet_ip="10.16.0.0"
|
---|
76 | ;;
|
---|
77 |
|
---|
78 | sb7)
|
---|
79 | subnet_ip="10.17.0.0"
|
---|
80 | ;;
|
---|
81 |
|
---|
82 | grid)
|
---|
83 |
|
---|
84 | subnet_ip="10.10.0.0"
|
---|
85 | ;;
|
---|
86 |
|
---|
87 | esac
|
---|
88 |
|
---|
89 | echo "My subnet number is $subnet_ip"
|
---|
90 |
|
---|
91 | echo "The nodes given are $1"
|
---|
92 |
|
---|
93 | wget -O - 'http://pxe:5012/pxe/setBootImage?img=orbit-1.1.4&node=${node_id}&ip=$subnet_ip'
|
---|
94 |
|
---|
95 | # Reset the selected nodes using cmc service
|
---|
96 |
|
---|
97 | wget -O - 'http://cmc:5012/cmc/allReset'
|
---|
98 |
|
---|
99 | function imagenodes()
|
---|
100 | {
|
---|
101 | echo "Imaging nodes: $1 with image $2"
|
---|
102 | nodehandler system:exp:imageNode -- --nodes "[$1]" --image $2
|
---|
103 | echo " done."
|
---|
104 | exit 0
|
---|
105 | }
|
---|
106 |
|
---|
107 | function usage()
|
---|
108 | {
|
---|
109 | echo "Usage: $0 {atheros|intel|all} image_file_path" >&2
|
---|
110 | echo "for example:" >&2
|
---|
111 | echo " $0 all tmp/image-tridencom-test.ndz" >&2
|
---|
112 | }
|
---|
113 |
|
---|
114 | if [ $# -ne 2 ]
|
---|
115 | then
|
---|
116 | echo "ERROR: Wrong number of arguments: $1"
|
---|
117 | usage
|
---|
118 | exit 1
|
---|
119 | fi
|
---|
120 |
|
---|
121 | image=$2
|
---|
122 |
|
---|
123 |
|
---|
124 |
|
---|
125 | case "$1" in
|
---|
126 |
|
---|
127 | intel)
|
---|
128 | imagenodes $int_nodes $image
|
---|
129 | ;;
|
---|
130 | atheros)
|
---|
131 | imagenodes $ath_nodes $image
|
---|
132 | ;;
|
---|
133 | all)
|
---|
134 | imagenodes "$int_nodes,$ath_nodes" $image
|
---|
135 | ;;
|
---|
136 | *)
|
---|
137 | imagenodes $1 $image
|
---|
138 | exit 1
|
---|
139 | ;;
|
---|
140 |
|
---|
141 |
|
---|
142 | esac
|
---|
143 |
|
---|