Skip to content

Commit 36682dd

Browse files
author
Tim Pouyer
committed
Fix startup issues with devstack
Ensure reliable services
1 parent 5731026 commit 36682dd

File tree

5 files changed

+115
-137
lines changed

5 files changed

+115
-137
lines changed

scripts/stackinabox/devstack2

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ start() {
1414
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
1515

1616
# attach stack-volumes
17-
losetup /dev/loop0 /opt/stack/data/stack-volumes-lvmdriver-1-backing-file
17+
losetup /dev/loop0 /opt/stack/data/stack-volumes-default-backing-file
18+
losetup /dev/loop1 /opt/stack/data/stack-volumes-lvmdriver-1-backing-file
1819

1920
echo 'Starting DevStack' >&2
20-
su -c "screen -dm -c /opt/stack/devstack/stack-noscreenrc" -s /bin/sh vagrant
21+
su -c "/opt/stack/devstack/stack-noscreenrc" -s /bin/sh vagrant
2122
echo 'DevStack started' >&2
2223
}
2324

scripts/stackinabox/init.sh

Lines changed: 47 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
# set release branch to retrieve from git
44
RELEASE_BRANCH=${1:-master}
5+
MTU=${2:-1500}
56

67
echo ""
78
echo ""
@@ -34,7 +35,7 @@ sudo add-apt-repository cloud-archive:liberty
3435
# comment above ppa and uncomment below to get development lxd builds
3536
sudo add-apt-repository ppa:ubuntu-lxc/lxd-git-master
3637
sudo apt-get -qqy update
37-
sudo apt-get -qqy install python-pip python-dev git #cgroup-lite cgmanager libpam-cgm
38+
sudo apt-get -qqy install python-pip python-dev git libvirt-bin #cgroup-lite cgmanager libpam-cgm
3839
sudo pip install -U pbr
3940
sudo pip install -U pip
4041
#sudo pip install -U requests==2.5.3
@@ -44,23 +45,40 @@ sudo pip install -U requests==2.8.1
4445
sudo pip install 'uwsgi'
4546
sudo chmod +x /usr/local/bin/uwsgi
4647

48+
sudo update-alternatives --install /bin/sh sh /bin/bash 100
49+
50+
# We need swap space to do any sort of scale testing with the Vagrant config.
51+
# Without this, we quickly run out of RAM and the kernel starts whacking things.
52+
sudo rm -f /swapfile1
53+
sudo dd if=/dev/zero of=/swapfile1 bs=1024 count=8388608
54+
sudo chown root:root /swapfile1
55+
sudo chmod 0600 /swapfile1
56+
sudo mkswap /swapfile1
57+
sudo swapon /swapfile1
58+
4759
# Disable firewall (this is not production)
4860
sudo ufw disable
4961

62+
# To permit IP packets pass through different networks,
63+
# the network card should be configured with routing capability.
64+
sudo echo "net.ipv4.ip_forward = 1" | sudo tee --append /etc/sysctl.conf > /dev/null
65+
sudo echo "net.ipv4.conf.all.rp_filter=0" | sudo tee --append /etc/sysctl.conf > /dev/null
66+
sudo echo "net.ipv4.conf.default.rp_filter=0" | sudo tee --append /etc/sysctl.conf > /dev/null
67+
sudo echo "net.ipv6.conf.all.disable_ipv6 = 1" | sudo tee --append /etc/sysctl.conf > /dev/null
68+
sudo echo "net.ipv6.conf.default.disable_ipv6 = 1" | sudo tee --append /etc/sysctl.conf > /dev/null
69+
sudo echo "net.ipv6.conf.lo.disable_ipv6 = 1" | sudo tee --append /etc/sysctl.conf > /dev/null
70+
sudo sysctl -p
71+
72+
# allow OpenStack nodes to route packets out through NATed network on HOST (this is the vagrant managed nic)
73+
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
74+
5075
# Update host configuration
51-
sudo hostname "stackinabox"
52-
sudo bash -c "echo 'stackinabox' > /etc/hostname"
76+
sudo bash -c "echo 'openstack.stackinabox.io' > /etc/hostname"
77+
#export eth1=`ifconfig eth1 | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'`
5378
sudo bash -c 'cat > /etc/hosts' <<EOF
54-
127.0.1.1 stackinabox stackinabox
55-
127.0.0.1 localhost localdomain
56-
57-
# The following lines are desirable for IPv6 capable hosts
58-
::1 ip6-localhost ip6-loopback
59-
fe00::0 ip6-localnet
60-
ff00::0 ip6-mcastprefix
61-
ff02::1 ip6-allnodes
62-
ff02::2 ip6-allrouters
63-
ff02::3 ip6-allhosts
79+
127.0.0.1 localhost.localdomain localhost openstack.stackinabox.io openstack
80+
192.168.27.100 openstack.stackinabox.io openstack
81+
6482
EOF
6583

6684
# speed up DNS resolution
@@ -74,9 +92,9 @@ backoff-cutoff 2;
7492
link-timeout 10;
7593
interface "eth0"
7694
{
77-
supersede host-name "stackinabox";
78-
supersede domain-name "";
79-
prepend domain-name-servers 127.0.0.1;
95+
supersede host-name "openstack.stackinabox.io";
96+
supersede domain-name "stackinabox.io";
97+
prepend domain-name-servers 192.168.27.1, 8.8.8.8, 8.8.4.4;
8098
request subnet-mask,
8199
broadcast-address,
82100
routers,
@@ -89,18 +107,6 @@ interface "eth0"
89107
}
90108
EOF
91109

92-
sudo service hostname restart
93-
94-
# To permit IP packets pass through different networks,
95-
# the network card should be configured with routing capability.
96-
sudo echo "net.ipv4.ip_forward = 1" | sudo tee --append /etc/sysctl.conf > /dev/null
97-
sudo echo "net.ipv4.conf.all.rp_filter=0" | sudo tee --append /etc/sysctl.conf > /dev/null
98-
sudo echo "net.ipv4.conf.default.rp_filter=0" | sudo tee --append /etc/sysctl.conf > /dev/null
99-
sudo sysctl -p
100-
101-
# allow OpenStack nodes to route packets out through NATed network on HOST (this is the vagrant managed nic)
102-
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
103-
104110
# Restart networking
105111
sudo /etc/init.d/networking restart
106112

@@ -159,24 +165,20 @@ EOF
159165
# Install NTP
160166
sudo apt-get install -y ntp
161167

162-
# Set ntp.ubuntu.com as the direct source of time.
163-
# Also provide local time source in case of network interruption.
164-
sudo sed -i 's/server ntp.ubuntu.com/ \
165-
server ntp.ubuntu.com \
166-
server 0.pool.ntp.org \
167-
server 1.pool.ntp.org \
168-
server 2.pool.ntp.org \
169-
server 127.127.1.0 \
170-
fudge 127.127.1.0 stratum 10/g' /etc/ntp.conf
171-
168+
# stop ntp service so we can set the pool to use
172169
sudo service ntp stop
173170

174-
# initialize local time with value from pool.ntp.org
175-
sudo ntpdate pool.ntp.org
171+
# Set ntp.ubuntu.com as the direct source of time.
172+
sudo ntpdate us.pool.ntp.org
176173

177174
# restart the NTP service
178175
sudo service ntp restart
179176

177+
# Configure MTU on VM interfaces. Also requires manually configuring the same MTU on
178+
# the equivalent 'vboxnet' interfaces on the host. i.e. sudo ip link set dev vboxnet0 mtu $MTU
179+
# sudo ip link set dev eth1 mtu $MTU
180+
# sudo ip link set dev eth2 mtu $MTU
181+
180182
# Restart networking
181183
sudo /etc/init.d/networking restart
182184

@@ -229,16 +231,18 @@ sudo update-rc.d devstack start 98 2 3 4 5 . stop 02 0 1 6 .
229231

230232
# install 'shellinabox' to make using this image on windows easier
231233
# shellinabox will be available at http://192.168.27.100:4200
232-
sudo apt-get install -y shellinabox
233-
sudo sed -i 's/--no-beep/--no-beep --disable-ssl/g' /etc/default/shellinabox
234-
sudo /etc/init.d/shellinabox restart
234+
# sudo apt-get install -y shellinabox
235+
# sudo sed -i 's/--no-beep/--no-beep --disable-ssl/g' /etc/default/shellinabox
236+
# sudo /etc/init.d/shellinabox restart
235237

236238
# wait for openstack to startup
237239
sleep 60
238240

239241
# clean up after ourselves
240242
/vagrant/scripts/minimize/clean.sh
241243

244+
sudo rm -rf /var/lib/apt/lists/*
245+
242246
sudo btrfs quota enable /var/lib/lxd
243247

244248
# restart

scripts/stackinabox/local.conf

Lines changed: 38 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ HOST_IP_IFACE=eth1
1010
HOST_IP=192.168.27.100
1111
PUBLIC_NETWORK_GATEWAY=172.24.4.2
1212
FLOATING_RANGE=172.24.4.0/24
13-
Q_FLOATING_ALLOCATION_POOL=start=172.24.4.3,end=172.24.4.26
13+
Q_FLOATING_ALLOCATION_POOL=start=172.24.4.3,end=172.24.4.254
1414

1515
FORCE=yes
1616
RECLONE=False
@@ -40,50 +40,13 @@ enable_plugin nova-lxd https://github.com/tpouyer/nova-lxd.git merging
4040
#PYLXD_BRANCH=0.19
4141
#enable_plugin nova-lxd https://github.com/lxc/nova-lxd.git
4242

43-
#
44-
# Include the Barbican key service
45-
#
46-
#enable_plugin barbican https://github.com/openstack/barbican.git $RELEASE_BRANCH
47-
48-
#
49-
# Include the Ceilometer monitoring service
50-
#
51-
#enable_plugin ceilometer https://github.com/openstack/ceilometer.git $RELEASE_BRANCH
52-
53-
#
54-
# Include the AODH alarming service
55-
#
56-
#enable_plugin aodh https://github.com/openstack/aodh.git $RELEASE_BRANCH
57-
#enable_service aodh-evaluator
58-
#enable_service aodh-notifier
59-
#enable_service aodh-api
60-
#disable_service ceilometer-alarm-notifier
61-
#disable_service ceilometer-alarm-evaluator
62-
63-
#
64-
# Include Trove DBaaS
65-
#
66-
#enable_plugin trove https://github.com/openstack/trove.git $RELEASE_BRANCH
67-
#enable_plugin trove-dashboard https://github.com/openstack/trove-dashboard.git
68-
69-
#
70-
# Include Designate DNSaaS
71-
#
72-
#enable_plugin designate https://github.com/openstack/designate.git $RELEASE_BRANCH
73-
#DESIGNATE_BRANCH=$RELEASE_BRANCH
74-
#DESIGNATEDASHBOARD_BRANCH=$DESIGNATE_BRANCH
75-
#DESIGNATE_DEFAULT_NS_RECORD=ns1.stackinabox.io
76-
77-
#GIT_BASE=https://github.com
43+
GIT_BASE=https://github.com
7844
DEVSTACK_INSTALL_DIR=/opt/stack/devstack
7945

8046
# Database Type
8147
DATABASE_TYPE=mysql
8248
enable_service mysql
8349

84-
# uncomment to get vm stats in screen
85-
#enable_service dstat
86-
8750
# RPC Backend
8851
enable_service rabbit
8952

@@ -95,7 +58,7 @@ LOGDAYS=1
9558
VERBOSE=True
9659
LOG_COLOR=True
9760
LOGFILE=$DEST/logs/stack.sh.log
98-
USE_SCREEN=True
61+
USE_SCREEN=False
9962
SCREEN_LOGDIR=$DEST/logs
10063
ENABLE_DEBUG_LOG_LEVEL=True
10164

@@ -120,19 +83,10 @@ RABBIT_PASSWORD=labstack
12083
SERVICE_PASSWORD=labstack
12184
SERVICE_TOKEN=labstack
12285

123-
#
124-
# Enable Glance - OpenStack Image Service
125-
#
126-
enable_service g-api
127-
enable_service g-reg
128-
12986
#
13087
# Enable Keystone - OpenStack Identity Service
13188
#
13289
enable_service key
133-
#enable_service ldap
134-
#KEYSTONE_IDENTITY_BACKEND=ldap
135-
#KEYSTONE_CLEAR_LDAP=yes
13690
KEYSTONE_TOKEN_FORMAT=UUID
13791
KEYSTONE_CATALOG_BACKEND=sql
13892

@@ -146,11 +100,13 @@ enable_service n-cpu
146100
enable_service n-cond
147101
enable_service n-sch
148102
enable_service n-cauth
149-
disable_service n-spice
103+
enable_service n-spice
150104
disable_service n-novnc
151105
disable_service n-xvnc
152106
#disable_service n-api-meta
153-
#enable_service n-sproxy
107+
enable_service n-sproxy
108+
109+
154110

155111
#
156112
# Enable Neutron (network) Service
@@ -162,18 +118,7 @@ enable_service q-agt
162118
enable_service q-dhcp
163119
enable_service q-l3
164120
enable_service q-meta
165-
disable_service q-metering
166-
167-
# uncomment any of below to turn on new neutron *aas services
168-
#enable_service q-lbaas
169-
#enable_service q-vpnaas
170-
#enable_service q-fwaas
171-
172-
#
173-
# Disable security groups
174-
#
175-
#Q_USE_SECGROUP=False
176-
#LIBVIRT_FIREWALL_DRIVER=nova.virt.firewall.NoopFirewallDriver
121+
enable_service q-metering
177122

178123
#
179124
# Enable security groups
@@ -205,6 +150,12 @@ VOLUME_BACKING_FILE_SIZE=50000M
205150
LIVE_MIGRATION_AVAILABLE=False
206151
USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION=False
207152

153+
#
154+
# Enable Glance - OpenStack Image Service
155+
#
156+
enable_service g-api
157+
enable_service g-reg
158+
208159
#
209160
# Enable Heat (orchestration) Service
210161
#
@@ -224,6 +175,14 @@ enable_service horizon
224175
#
225176
disable_service tempest
226177

178+
#enable_plugin designate https://github.com/openstack/designate
179+
#DESIGNATE_BRANCH=master
180+
181+
enable_plugin kuryr http://git.openstack.org/openstack/kuryr
182+
enable_service kuryr
183+
enable_service etcd-server
184+
enable_service docker-engine
185+
227186
#
228187
# set current branch
229188
#
@@ -242,28 +201,37 @@ SWIFT_BRANCH=$RELEASE_BRANCH
242201
TROVE_BRANCH=$RELEASE_BRANCH
243202
OSLOMSG_BRANCH=$RELEASE_BRANCH
244203
SAHARA_BRANCH=$RELEASE_BRANCH
245-
DESIGNATE_BRANCH=$RELEASE_BRANCH
246204

247205
[[post-config|$NOVA_CONF]]
248206
[DEFAULT]
249207
tenant_network_type=vxlan
250208
scheduler_default_filters=AllHostsFilter
251209
instance_usage_audit=True
252210
API_RATE_LIMIT=False
253-
force_config_drive = False
254-
config_drive_format = vfat
255-
metadata_host = $HOST_IP
211+
force_config_drive=False
212+
config_drive_format=vfat
213+
metadata_host=$HOST_IP
214+
notification_driver=nova.openstack.common.notifier.rpc_notifier,messagingv2
215+
notification_topics=notifications,trackinstance
256216

257217
[[post-config|$NEUTRON_CONF]]
258218
[database]
259219
min_pool_size = 5
260220
max_pool_size = 50
261221
max_overflow = 50
262222

223+
[[post-config|$NEUTRON_CONF]]
224+
[DEFAULT]
225+
notification_driver=neutron.openstack.common.notifier.rpc_notifier,messagingv2
226+
notification_topics=notifications,trackinstance
227+
228+
229+
[[post-config|$CINDER_CONF]]
230+
[DEFAULT]
231+
notification_driver=cinder.openstack.common.notifier.rpc_notifier,messagingv2
232+
notification_topics=notifications,trackinstance
233+
263234
[[post-config|/$Q_PLUGIN_CONF_FILE]]
264235
[agent]
265236
tunnel_types=vxlan
266237
vxlan_udp_port=8472
267-
268-
[[post-config|$CINDER_CONF]]
269-
notification_driver=messagingv2

scripts/stackinabox/stack-noscreenrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#!/bin/bash
22

3+
/opt/stack/etcd/etcd-v2.2.2-linux-amd64/etcd --data-dir /opt/stack/etcd/db.etcd --advertise-client-urls http://0.0.0.0:4001 --listen-client-urls http://0.0.0.0:4001 >> /opt/stack/logs/etcd-server.log 2>&1 &
4+
5+
sudo /usr/bin/docker daemon -H tcp://0.0.0.0:2375 --cluster-store etcd://localhost:4001 >> /opt/stack/logs/docker-engine.log 2>&1 &
6+
7+
sudo PYTHONPATH=:/opt/stack/kuryr SERVICE_USER=admin SERVICE_PASSWORD=labstack SERVICE_TENANT_NAME=admin SERVICE_TOKEN=labstack IDENTIY_URL=http://127.0.0.1:5000/v2.0 python /opt/stack/kuryr/scripts/run_server.py --config-file /etc/kuryr/kuryr.conf >> /opt/stack/logs/ >> /opt/stack/logs/kuryr.log 2>&1 &
8+
39
/usr/local/bin/glance-registry --config-file=/etc/glance/glance-registry.conf >> /opt/stack/logs/g-reg.log 2>&1 &
410

511
/usr/local/bin/glance-api --config-file=/etc/glance/glance-api.conf >> /opt/stack/logs/g-api.log 2>&1 &
@@ -22,8 +28,12 @@
2228

2329
/usr/local/bin/nova-scheduler --config-file /etc/nova/nova.conf >> /opt/stack/logs/n-sch.log 2>&1 &
2430

31+
/usr/local/bin/nova-spicehtml5proxy --config-file /etc/nova/nova.conf --web /usr/share/spice-html5 >> /opt/stack/logs/n-spice.log 2>&1 &
32+
2533
/usr/local/bin/nova-consoleauth --config-file /etc/nova/nova.conf >> /opt/stack/logs/n-cauth.log 2>&1 &
2634

35+
/usr/local/bin/nova-serialproxy --config-file /etc/nova/nova.conf >> /opt/stack/logs/n-sproxy.log 2>&1 &
36+
2737
/usr/local/bin/nova-objectstore --config-file /etc/nova/nova.conf >> /opt/stack/logs/n-obj.log 2>&1 &
2838

2939
/usr/local/bin/nova-compute --config-file /etc/nova/nova.conf >> /opt/stack/logs/n-cpu.log 2>&1 &

0 commit comments

Comments
 (0)