-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_boot.sh
executable file
·59 lines (36 loc) · 1.52 KB
/
test_boot.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
#!/bin/bash
#Task: Launch of instances
source ~/keystonerc_admin
ins1_name='ubuntu'
ins2_name='cirros'
nova flavor-create m1.little 6 1024 5 1 --swap 1024 --is-public True
nova flavor-create m1.mini 7 1024 10 1 --is-public True
nova flavor-create m1.midi 8 2048 10 1 --is-public True
echo "Neutron creates ports for "${ins1_name}" .."
echo '------------------------------'
neutron port-create internal_network --name c_port --fixed-ip ip_address=192.168.7.55
sleep 1s
echo "Neutron creates ports for "${ins2_name}".."
echo '------------------------------'
neutron port-create internal_network --name u_port --fixed-ip ip_address=192.168.7.66
sleep 1s
echo -e "\nNova controller is booting "${ins1_name}" ..."
echo '-------------------------------'
t1_int_pid=$(neutron port-list | awk '/u_port/ {print $2}')
#t1_ext2_pid=$(neutron port-list | awk '/t1_ext2/ {print $2}')
#t1_ext3_pid=$(neutron port-list | awk '/t1_ext3/ {print $2}')
nova boot --flavor m1.midi --image ubuntu16 \
--nic port-id=$t1_int_pid \
--key-name stack $ins1_name
sleep 2s
echo -e "\nNova controller is booting "${ins2_name}" ..."
echo '-------------------------------'
t2_int_pid=$(neutron port-list | awk '/c_port/ {print $2}')
#t2_ext2_pid=$(neutron port-list | awk '/t2_ext2/ {print $2}')
#t2_ext3_pid=$(neutron port-list | awk '/t2_ext3/ {print $2}')
#nova boot --flavor m1.tiny --image cirros \
--nic port-id=$t2_int_pid \
--key-name stack $ins2_name
echo -e "\n------------Updated Instance list----------"
sleep 2s
nova list