You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixed sysvmadm helper script (responsible for restarting/recreating VRs when needed on upgraded setups due to template changes) to have -v option. When -v is specified, all VPCs in the system will get restarted. As a part of the restart, VPC routers will get recreated
Copy file name to clipboardExpand all lines: setup/bindir/cloud-sysvmadm.in
+99-3Lines changed: 99 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -23,13 +23,14 @@
23
23
#set -x
24
24
25
25
usage() {
26
-
printf"\nThe tool stopping/starting running system vms and domain routers \n\nUsage: %s: [-d] [-u] [-p] [-m] [-s] [-r] [-a] [-t] [-n] [-z]\n\n -d - cloud DB server ip address, defaulted to localhost if not specified \n -u - user name to access cloud DB, defaulted to "root" if not specified \n -p - cloud DB user password, defaulted to no password if not specified \n\n -m - the ip address of management server, defaulted to localhost if not specified\n\n -s - stop then start all running SSVMs and Console Proxies \n -r - stop then start all running Virtual Routers\n -a - stop then start all running SSVMs, Console Proxies, and Virtual Routers \n -n - restart all Guest networks \n -t - number of parallel threads used for stopping Domain Routers. Default is 10.\n -l - log file location. Default is cloud.log under current directory.\n -z - do restart only for the instances in the specific zone. If not specified, restart will apply to instances in all zones\n\n"$(basename $0)>&2
26
+
printf "\nThe tool stopping/starting running system vms and domain routers \n\nUsage: %s: [-d] [-u] [-p] [-m] [-s] [-r] [-a] [-t] [-n] [-z] [-v]\n\n -d - cloud DB server ip address, defaulted to localhost if not specified \n -u - user name to access cloud DB, defaulted to "root" if not specified \n -p - cloud DB user password, defaulted to no password if not specified \n\n -m - the ip address of management server, defaulted to localhost if not specified\n\n -s - stop then start all running SSVMs and Console Proxies \n -r - stop then start all running Virtual Routers\n -a - stop then start all running SSVMs, Console Proxies, and Virtual Routers \n -n - restart all Guest networks \n -t - number of parallel threads used for stopping Domain Routers. Default is 10.\n -l - log file location. Default is cloud.log under current directory.\n -z - do restart only for the instances in the specific zone. If not specified, restart will apply to instances in all zones\n -v - do restart all VPCs in the entire system\n\n" $(basename $0) >&2
27
27
}
28
28
29
29
30
30
system=
31
31
router=
32
32
all=
33
+
vpc=
33
34
db=localhost
34
35
ms=localhost
35
36
user=root
@@ -42,7 +43,7 @@ inzone=""
42
43
43
44
44
45
45
-
whilegetopts'sarhnd:m:u:p:t:l:z:' OPTION
46
+
whilegetopts'sarhnvd:m:u:p:t:l:z:' OPTION
46
47
do
47
48
case$OPTIONin
48
49
s) system=1
@@ -53,6 +54,8 @@ do
53
54
;;
54
55
a) all=1
55
56
;;
57
+
v) vpc=1
58
+
;;
56
59
d) db="$OPTARG"
57
60
;;
58
61
u) user="$OPTARG"
@@ -317,6 +320,92 @@ restart_network(){
317
320
318
321
}
319
322
323
+
324
+
restart_vpc(){
325
+
echo -e "INFO: Restarting vpc with id $1"
326
+
echo"INFO: Restarting vpc with id $1">>$LOGFILE
327
+
jobid=`curl -sS "http://$ms:8096/?command=restartVPC&id=$1&response=json"| sed 's/\"//g'| sed 's/ //g'| sed 's/{//g'| sed 's/}//g'| awk -F: {'print $3'}`
328
+
if [ "$jobid"=="" ];then
329
+
echo"ERROR: Failed to restart vpc with id $1">>$LOGFILE
330
+
echo 2
331
+
return
332
+
fi
333
+
334
+
jobresult=$(query_async_job_result $jobid)
335
+
336
+
if [ "$jobresult"!="1" ];then
337
+
echo -e "ERROR: Failed to restart vpc with id $1 \n"
338
+
echo"ERROR: Failed to restart vpc with id $1">>$LOGFILE
339
+
else
340
+
echo -e "INFO: Successfully restarted vpc with id $1 \n"
341
+
echo"INFO: Successfully restarted vpc with id $1">>$LOGFILE
342
+
fi
343
+
}
344
+
345
+
346
+
restart_vpcs(){
347
+
vpcs=(`mysql -h $db --user=$user --password=$password --skip-column-names -U cloud -e "select id from vpc WHERE removed is null$zone"`)
0 commit comments