Old/Mobility/RunVMExperiment: runVM.pl

File runVM.pl, 4.0 KB (added by mrodoper, 16 years ago)
Line 
1
2## Author: Mete Rodoper
3# For more detail refer How to run a Virtual Mobility experiment on ORBIT
4
5
6#1) Image all grid nodes
7#2) Turn all grid nodes on
8#3) Run CreateMobilitySetup
9#4) Install ath0 ports to nodes
10#5) Copy the Click files to nodes
11#6) Run "click-install mob*.click"
12
13system("orbit load all click-2.4.26-20051204.ndz"); # Imaging all nodes for Virtual Mobility
14
15system("orbit tell on all grip"); # Turning all nodes on
16
17system("CreateMobilitySetup"); #Create Mobility Script for preparing Click Router Files
18
19open(VMGenList,"ls VM*.txt |");
20@genVMList = <VMGenList>;
21print " @genVMList";
22open(VMList,"listofvms.txt");
23@allVMtxtFiles = <VMList>;
24print " @allVMtxtFiles";
25
26$count=1;
27
28while($count < @genVMList + 1) # Turn the ath0 interface up for all path nodes used during the experiment
29{
30
31 open(myInput, "<VM$count.txt");
32 while(<myInput>)
33 {
34 my($line) = $_;
35
36 chomp($line); # Remove the spaces
37
38 @myArrayNum1 = split(/-/, $line);
39 @myArrayNum2 = split(/e/, $myArrayNum1[0]);
40 $firstNumber=$myArrayNum2[1];
41 $secondNumber=$myArrayNum1[1];
42
43 system("ssh root\@node$firstNumber-$secondNumber modprobe ath_pci");
44 system("ssh root\@node$firstNumber-$secondNumber ifconfig ath0 up");
45 system("ssh root\@node$firstNumber-$secondNumber exit");
46
47 }
48
49 $count = $count + 1;
50}
51
52open(myInput, "<listofvms.txt"); # Turn the ath0 interface up for all vm nodes used during the experiment
53while(<myInput>)
54{
55 my($line) = $_;
56
57 chomp($line); # Remove the spaces
58
59 @myArrayNum1 = split(/-/, $line);
60 @myArrayNum2 = split(/e/, $myArrayNum1[0]);
61 $firstNumber=$myArrayNum2[1];
62 $secondNumber=$myArrayNum1[1];
63
64 system("ssh root\@node$firstNumber-$secondNumber modprobe ath_pci");
65 system("ssh root\@node$firstNumber-$secondNumber ifconfig ath0 up");
66 system("ssh root\@node$firstNumber-$secondNumber exit");
67}
68$count=1;
69
70while($count < @genVMList + 1) # Copy click router files to all path nodes used during the experiment
71{
72
73 open(myInput, "<VM$count.txt");
74 while(<myInput>)
75 {
76
77 my($line) = $_;
78 chomp($line); # Remove the spaces
79
80 @myArrayNum1 = split(/-/, $line);
81 @myArrayNum2 = split(/e/, $myArrayNum1[0]);
82 $firstNumber=$myArrayNum2[1];
83 $secondNumber=$myArrayNum1[1];
84
85
86 system("scp EthernetAddresses/mob_node_src_generated_Node_$firstNumber_$secondNumber.click setup.sh root\@node$firstNumber-$secondNumber:~");
87 }
88
89 $count = $count + 1;
90}
91
92$mycounter=1;
93open(myInput, "<listofvms.txt");
94while(<myInput>) # Copy click router files to all vm nodes used during the experiment
95{
96 my($line) = $_;
97 chomp($line); # Remove the spaces
98
99 @myArrayNum1 = split(/-/, $line);
100 @myArrayNum2 = split(/e/, $myArrayNum1[0]);
101 $firstNumber=$myArrayNum2[1];
102 $secondNumber=$myArrayNum1[1];
103
104 system("scp EthernetAddresses/mob_server_src_generated_VM$mycounter.click setup.sh root\@node$firstNumber-$secondNumber:~");
105 $mycounter++;
106}
107
108$count=1;
109
110while($count < @genVMList + 1) # Run Click Router Scripts for all path nodes used during the experiment
111{
112
113 open(myInput, "<VM$count.txt");
114 while(<myInput>)
115 {
116 my($line) = $_;
117
118 chomp($line); # Remove the spaces
119
120 @myArrayNum1 = split(/-/, $line);
121 @myArrayNum2 = split(/e/, $myArrayNum1[0]);
122 $firstNumber=$myArrayNum2[1];
123 $secondNumber=$myArrayNum1[1];
124
125 system("ssh root\@node$firstNumber-$secondNumber click-install mob*.click");
126 system("ssh root\@node$firstNumber-$secondNumber exit");
127
128 }
129
130 $count = $count + 1;
131}
132
133open(myInput, "<listofvms.txt"); # Run Click Router Scripts for all vm nodes used during the experiment
134while(<myInput>)
135{
136 my($line) = $_;
137
138 chomp($line); # Remove the spaces
139
140 @myArrayNum1 = split(/-/, $line);
141 @myArrayNum2 = split(/e/, $myArrayNum1[0]);
142 $firstNumber=$myArrayNum2[1];
143 $secondNumber=$myArrayNum1[1];
144
145 system("ssh root\@node$firstNumber-$secondNumber click-install mob*.click");
146 system("ssh root\@node$firstNumber-$secondNumber exit");
147}