This repository was archived by the owner on May 21, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevstack-vm.sh
More file actions
executable file
·139 lines (115 loc) · 4.65 KB
/
devstack-vm.sh
File metadata and controls
executable file
·139 lines (115 loc) · 4.65 KB
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
126
127
128
129
130
131
132
133
134
135
136
137
138
#!/bin/bash
set -ex
case `whoami` in
root)
# set up stack user
useradd -m -s /bin/bash stack
echo -e "stack ALL=(ALL) NOPASSWD:ALL\nDefaults:stack !requiretty" > /etc/sudoers.d/0-stack
chmod 0777 $0
su -l stack `pwd`/$0
;;
stack)
host_ip="10.10.0.4"
network_interface=ens192
GIT_BASE="https://github.com"
DEBIAN_FRONTEND=noninteractive sudo apt-get -qqy update || sudo yum update -qy
DEBIAN_FRONTEND=noninteractive sudo apt-get install -qqy git htop || sudo yum install -qy git htop
sudo chown stack:stack /home/stack
cd /home/stack
git clone --branch=stable/newton $GIT_BASE/openstack-dev/devstack.git
cd devstack
cat > local.conf <<EOF
[[local|localrc]]
HOST_IP=$host_ip
SERVICE_HOST=$host_ip
MYSQL_HOST=$host_ip
RABBIT_HOST=$host_ip
GLANCE_HOSTPORT=$host_ip:9292
ADMIN_PASSWORD=password
DATABASE_PASSWORD=password
RABBIT_PASSWORD=password
SERVICE_PASSWORD=password
SERVICE_TOKEN=password
VOLUME_BACKING_FILE_SIZE=102400M
# Services:
## Enable Neutron networking
disable_service n-net
enable_service q-svc
enable_service q-agt
enable_service q-dhcp
enable_service q-l3
enable_service q-meta
## Disable tempest
disable_service tempest
## Neutron options
Q_USE_SECGROUP=True
FIXED_RANGE=10.0.0.0/24
FLOATING_RANGE=172.18.161.0/24
PUBLIC_NETWORK_GATEWAY=172.18.161.1
PUBLIC_INTERFACE=$network_interface
Q_FLOATING_ALLOCATION_POOL=start=172.18.161.11,end=172.18.161.254
# Open vSwitch provider networking configuration
Q_USE_PROVIDERNET_FOR_PUBLIC=True
OVS_PHYSICAL_BRIDGE=br-ex
PUBLIC_BRIDGE=br-ex
OVS_BRIDGE_MAPPINGS=public:br-ex
# Workaround until this newton/stable bug is fixed: https://bugs.launchpad.net/devstack/+bug/1667545
REQUIREMENTS_BRANCH=refs/changes/27/454927/1
# Speedups
GIT_BASE="$GIT_BASE"
EOF
cat > post-stack.sh <<EOF
source ./openrc admin demo
#Bosh
openstack quota set demo --instances 25
openstack quota set demo --cores 25
openstack quota set demo --volumes 20
openstack quota set demo --ram 122880
cat > id_bosh_rsa.pub <<EOF2
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDjiROOp2ClfiN0/9k+le/jMqHTI0/akgggCZ2hDf9aGhNFaVwdnU/yrKtCIobYv6LPX/uwQBwXUgWQ5ezlffe79RWJs7OQYEsN8aOSlqcBqfap0f2K0sQpU9jYvJuUdOw/pzpHAGo5yFlW8oCSJke/DU3LGqJkw/CVOCq1pohczVgYiBia0Un4l9CceT22bb2ZxMfy26jw0VtX4cC2UtVyfXI9xjaqbzFCJwQcIe8ECom0e7RLF0aglCSs+gwoRg/HK7NjnFPLVL0CuB4aBD+B6eLtI0LxB1ixcsnRi/UXeLFKfs+jwysUEgcN1H5pY8N/X44yNQ+OkMXZ/7PwpH/d vcap@bosh-init
EOF2
openstack keypair create --public-key=id_bosh_rsa.pub bosh
openstack security group create bosh
openstack security group rule create bosh --protocol=tcp --dst-port=22
openstack security group rule create bosh --protocol=tcp --dst-port=6868
openstack security group rule create bosh --protocol=tcp --dst-port=25555
openstack security group rule create bosh --protocol=tcp --src-group=bosh
openstack security group rule create bosh --protocol=udp --src-group=bosh
openstack security group rule create bosh --protocol=icmp #debugging
openstack floating ip create public --floating-ip-address 172.18.161.252
openstack floating ip create public --floating-ip-address 172.18.161.253
openstack floating ip create public --floating-ip-address 172.18.161.254
#Concourse
openstack security group rule create bosh --protocol=tcp --dst-port=8080
#CloudFoundry
openstack security group create cf
openstack security group rule create cf --protocol=udp --dst-port=68
openstack security group rule create cf --protocol=udp --dst-port=3457
openstack security group rule create cf --protocol=icmp
openstack security group rule create cf --protocol=tcp --dst-port=22
openstack security group rule create cf --protocol=tcp --dst-port=80
openstack security group rule create cf --protocol=tcp --dst-port=443
openstack security group rule create cf --protocol=tcp --dst-port=4443
openstack security group rule create cf --protocol=tcp --src-group=cf
openstack security group rule create cf --protocol=udp --src-group=cf
openstack security group rule create bosh --protocol=tcp --src-group=cf
openstack security group rule create bosh --protocol=udp --src-group=cf
#Create minimal flavor
openstack flavor delete m1.small
openstack flavor delete m1.medium
openstack flavor delete m1.large
openstack flavor delete m1.xlarge
openstack flavor create m1.director --public --vcpus 1 --ram 2048 --disk 15
openstack flavor create m1.small --public --vcpus 1 --ram 1024 --disk 10
openstack flavor create m1.medium --public --vcpus 1 --ram 2048 --disk 10
openstack flavor create m1.large --public --vcpus 1 --ram 8192 --disk 15
openstack flavor create m1.xlarge --public --vcpus 1 --ram 16384 --disk 15
openstack flavor create r3.xlarge --public --vcpus 1 --ram 16384 --disk 10 --ephemeral 32
#output private net uuid
openstack network show private -c id
EOF
chmod +x post-stack.sh
./stack.sh
./post-stack.sh
;;
esac