-
Notifications
You must be signed in to change notification settings - Fork 0
/
boot_instances_5g.sh
executable file
·125 lines (91 loc) · 3.91 KB
/
boot_instances_5g.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#!/bin/bash
#Nova instance booting script for 5G components on Openstack host.
source ~/keystonerc_admin
echo -e "\nNova controller is booting INET-GW instance.."
echo '-------------------------------'
inet_access_pid=$(neutron port-list | awk '/inet_access/ {print $2}')
inet_mgmt_pid=$(neutron port-list | awk '/inet_mgmt/ {print $2}')
inet_net_a_pid=$(neutron port-list | awk '/inet_net_a/ {print $2}')
nova boot --flavor m1.blittle --image 5G_core_image \
--nic port-id=$inet_access_pid \
--nic port-id=$inet_mgmt_pid \
--nic port-id=$inet_net_a_pid \
--key-name SSH_key inet-gw
sleep 2s
echo -e "\nNova controller is booting MME1 instance.."
echo '----------------------------'
mme1_access_pid=$(neutron port-list | awk '/mme1_access/ {print $2}')
mme1_mgmt_pid=$(neutron port-list | awk '/mme1_mgmt/ {print $2}')
mme1_net_d_pid=$(neutron port-list | awk '/mme1_net_d/ {print $2}')
nova boot --flavor m1.blittle --image 5G_core_image \
--nic port-id=$mme1_access_pid \
--nic port-id=$mme1_mgmt_pid \
--nic port-id=$mme1_net_d_pid \
--key-name SSH_key mme1
sleep 2s
echo -e "\nNova controller is booting MME2 instance.."
echo '----------------------------'
mme2_access_pid=$(neutron port-list | awk '/mme2_access/ {print $2}')
mme2_mgmt_pid=$(neutron port-list | awk '/mme2_mgmt/ {print $2}')
mme2_net_d_pid=$(neutron port-list | awk '/mme2_net_d/ {print $2}')
nova boot --flavor m1.blittle --image 5G_core_image \
--nic port-id=$mme2_access_pid \
--nic port-id=$mme2_mgmt_pid \
--nic port-id=$mme2_net_d_pid \
--key-name SSH_key mme2
sleep 2s
echo -e "\nNova controller is booting MME-LB instance.."
echo '----------------------------'
mme_lb_access_pid=$(neutron port-list | awk '/mmelb_access/ {print $2}')
mme_lb_mgmt_pid=$(neutron port-list | awk '/mmelb_mgmt/ {print $2}')
mme_lb_net_d_pid=$(neutron port-list | awk '/mmelb_net_d/ {print $2}')
nova boot --flavor m1.blittle --image 5G_core_image \
--nic port-id=$mme_lb_access_pid \
--nic port-id=$mme_lb_mgmt_pid \
--nic port-id=$mme_lb_net_d_pid \
--key-name SSH_key mme-lb
sleep 2s
echo -e "\nNova controller is booting HSS instance.."
echo '-------------------------- '
hss_access_pid=$(neutron port-list | awk '/hss_access/ {print $2}')
hss_mgmt_pid=$(neutron port-list | awk '/hss_mgmt/ {print $2}')
nova boot --flavor m1.blittle --image 5G_core_image \
--nic port-id=$hss_access_pid \
--nic port-id=$hss_mgmt_pid \
--key-name SSH_key hss
sleep 2s
echo -e "\nNova controller is booting BT instance.."
echo '-------------------------------'
bt_access_pid=$(neutron port-list | awk '/bt_access/ {print $2}')
bt_mgmt_pid=$(neutron port-list | awk '/bt_mgmt/ {print $2}')
bt_net_d_pid=$(neutron port-list | awk '/bt_net_d/ {print $2}')
nova boot --flavor m1.blittle --image 5G_core_image \
--nic port-id=$bt_access_pid \
--nic port-id=$bt_mgmt_pid \
--nic port-id=$bt_net_d_pid \
--key-name SSH_key bt
sleep 2s
echo -e "\nNova controller is booting DP-SWITCH instance.."
echo '--------------------------------------'
switch1_access_pid=$(neutron port-list | awk '/switch1_access/ {print $2}')
switch1_mgmt_pid=$(neutron port-list | awk '/switch1_mgmt/ {print $2}')
switch1_net_a_pid=$(neutron port-list | awk '/switch1_net_a/ {print $2}')
switch1_net_d_pid=$(neutron port-list | awk '/switch1_net_d/ {print $2}')
nova boot --flavor m1.blittle --image 5G_core_image \
--nic port-id=$switch1_access_pid \
--nic port-id=$switch1_mgmt_pid \
--nic port-id=$switch1_net_a_pid \
--nic port-id=$switch1_net_d_pid \
--key-name SSH_key dp-switch1
sleep 2s
echo -e "\nNova controller is booting O5GC-GUI instance.."
echo '-------------------------------------'
gui_access_pid=$(neutron port-list | awk '/gui_access/ {print $2}')
gui_mgmt_pid=$(neutron port-list | awk '/gui_mgmt/ {print $2}')
nova boot --flavor m1.blittle --image 5G_core_image \
--nic port-id=$gui_access_pid \
--nic port-id=$gui_mgmt_pid \
--key-name SSH_key o5gc-gui
sleep 2s
nova list
echo -e '\nBooting completed.\n'