Skip to content

Commit 0973d47

Browse files
author
Tim Pouyer
committed
Fix data disk size issue
Add support for running Docker within LXD Containers Update virtualbox guest images to latest version Add Docker Heat plugins to heat server
1 parent 4283f90 commit 0973d47

16 files changed

Lines changed: 138 additions & 114 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
.idea
44
stackinabox.iml
55
demo_key.priv
6-
build/
6+
builds/
77
images/

lxc-cloud-images/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Vagrant
2+
.DS_Store
3+
*.xz
4+
*.xz.*

lxc-cloud-images/import-images.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
echo "downloading trusty-server-cloudimg-amd64-root.tar.xz image archive for import"
3+
wget -nv https://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-root.tar.xz
4+
glance image-create --name 'ubuntu-1404-server-cloudimg-amd64' \
5+
--container-format bare \
6+
--disk-format raw \
7+
--visibility public \
8+
--min-disk 1 \
9+
--property architecture=x86_64 \
10+
--property hypervisor_type=lxc \
11+
--property os_distro=ubuntu \
12+
--property os_version=14.04 \
13+
--property vm_mode=exe < trusty-server-cloudimg-amd64-root.tar.xz
14+
15+
echo "downloading xenial-server-cloudimg-amd64-root.tar.xz image archive for import"
16+
wget -nv https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-root.tar.xz
17+
glance image-create --name 'ubuntu-1604-server-cloudimg-amd64' \
18+
--container-format bare \
19+
--disk-format raw \
20+
--visibility public \
21+
--min-disk 1 \
22+
--property architecture=x86_64 \
23+
--property hypervisor_type=lxc \
24+
--property os_distro=ubuntu \
25+
--property os_version=16.04 \
26+
--property vm_mode=exe < xenial-server-cloudimg-amd64-root.tar.xz
27+
28+
# glance image-create --name 'centos-6-amd64' \
29+
# --container-format bare \
30+
# --disk-format raw \
31+
# --visibility public \
32+
# --min-disk 1 \
33+
# --property architecture=x86_64 \
34+
# --property hypervisor_type=lxc \
35+
# --property os_distro=centos \
36+
# --property os_version=6 \
37+
# --property vm_mode=exe < centos-6-amd64-root.tar.gz

scripts/docker/heat.sh

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

3+
# set release branch to retrieve from git
4+
RELEASE_BRANCH=${1:-master}
5+
36
cd /tmp
4-
git clone -b stable/liberty https://github.com/openstack/heat.git
7+
git clone -b $RELEASE_BRANCH https://github.com/openstack/heat.git
58
cd heat/contrib/heat_docker/
69
sudo pip install -r requirements.txt
710
sudo mkdir -p /var/lib/heat
@@ -11,5 +14,9 @@ sudo sed -i 's|rpc_backend = rabbit|rpc_backend = rabbit \
1114
plugin_dirs = /var/lib/heat|g' /etc/heat/heat.conf
1215
sudo chown -R vagrant:vagrant /var/lib/heat
1316

14-
/vagrant/scripts/minimize/clean.sh
15-
17+
source /home/vagrant/admin-openrc.sh labstack
18+
nova flavor-key m1.tiny set lxd_docker_allowed=true
19+
nova flavor-key m1.small set lxd_docker_allowed=true
20+
nova flavor-key m1.medium set lxd_docker_allowed=true
21+
nova flavor-key m1.large set lxd_docker_allowed=true
22+
nova flavor-key m1.xlarge set lxd_docker_allowed=true

scripts/lxd/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

scripts/stackinabox/devstack

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@
1111
start() {
1212

1313
# allow OpenStack nodes to route packets out to NATed network on HOST
14-
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
14+
iptables -t nat -A POSTROUTING -o enp0s3 -j MASQUERADE
15+
16+
# set floating ip network (external network) to mtu of 1450
17+
ip link set dev enp0s9 mtu 1450
1518

1619
# attach stack-volumes
17-
losetup /dev/loop0 /opt/stack/data/stack-volumes-lvmdriver-1-backing-file
20+
losetup /dev/loop0 /opt/stack/data/stack-volumes-default-backing-file
21+
losetup /dev/loop1 /opt/stack/data/stack-volumes-lvmdriver-1-backing-file
1822

1923
echo 'Starting DevStack' >&2
20-
su -c "screen -dm -c /opt/stack/devstack/stack-screenrc" -s /bin/sh vagrant
24+
su -c "/opt/stack/devstack/stack-noscreenrc" -s /bin/sh vagrant
2125
echo 'DevStack started' >&2
2226
}
2327

scripts/stackinabox/devstack2

Lines changed: 0 additions & 52 deletions
This file was deleted.

scripts/stackinabox/init.sh

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,15 @@ echo Updating...
2323
sudo apt-get -y update
2424
sudo apt-get install -y zfsutils-linux git
2525

26-
echo Creating ZFS for lxd
27-
sudo zpool create -m /lxd -f lxd sdb
26+
echo "Creating ZFS for lxd"
27+
sudo zpool create -m /var/lib/lxd -f lxd sdb
28+
sudo zpool set feature@lz4_compress=enabled lxd
29+
sudo zfs set compression=lz4 lxd
30+
sudo touch /etc/init/zpool-import.conf
31+
sudo sed -i 's/modprobe zfs zfs_autoimport_disable=1/modprobe zfs zfs_autoimport_disable=0/g' /etc/init/zpool-import.conf
32+
sudo sed -i 's/# By default this script does nothing./zfs mount -a/g' /etc/rc.local
33+
34+
echo "Install LXD and initialize with ZFS storage-pool 'lxd' for backend"
2835
sudo apt-get install -y lxd
2936
sudo lxd init --auto --storage-backend zfs --storage-pool lxd
3037

@@ -83,7 +90,7 @@ initial-interval 1;
8390
backoff-cutoff 2;
8491
interface "enp0s3"
8592
{
86-
prepend domain-name-servers 192.168.27.1, 8.8.8.8, 8.8.4.4;
93+
prepend domain-name-servers 192.168.27.100, 8.8.8.8, 8.8.4.4;
8794
request subnet-mask,
8895
broadcast-address,
8996
time-offset,
@@ -108,7 +115,7 @@ sudo chown -R vagrant:vagrant /opt/stack
108115
git clone https://git.openstack.org/openstack-dev/devstack.git /opt/stack/devstack -b "${RELEASE_BRANCH}"
109116
#need to do below to stop devstack failing on test-requirements for lxd
110117
echo "Cloning nova-lxd repo from branch \"${RELEASE_BRANCH}\""
111-
git clone https://github.com/openstack/nova-lxd /opt/stack/nova-lxd -b "${RELEASE_BRANCH}"
118+
git clone https://github.com/stackinabox/nova-lxd /opt/stack/nova-lxd -b "${RELEASE_BRANCH}"
112119
rm -f /opt/stack/nova-lxd/test-requirements.txt
113120
# add local.conf to /opt/devstack folder
114121
cp /vagrant/scripts/stackinabox/local.conf /opt/stack/devstack/
@@ -121,6 +128,7 @@ sed -i "s@RELEASE_BRANCH=@RELEASE_BRANCH=$RELEASE_BRANCH@" /opt/stack/devstack/l
121128
sudo ifconfig enp0s9 0.0.0.0
122129
sudo ifconfig enp0s9 promisc
123130
sudo ip link set dev enp0s9 up
131+
sudo ip link set dev enp0s9 mtu 1450
124132
# gentelmen start your engines
125133
echo "Installing DevStack"
126134
cd /opt/stack/devstack
@@ -142,6 +150,7 @@ sudo bash -c 'cat >> /etc/network/interfaces' <<'EOF'
142150
auto enp0s9
143151
iface enp0s9 inet manual
144152
address 0.0.0.0
153+
mtu 1450
145154
up ifconfig $IFACE 0.0.0.0 up
146155
up ip link set $IFACE promisc on
147156
down ip link set $IFACE promisc off
@@ -160,7 +169,7 @@ sudo ip link set dev enp0s8 mtu $MTU
160169

161170
cp /vagrant/scripts/stackinabox/stack-noscreenrc /opt/stack/devstack/stack-noscreenrc
162171
chmod 755 /opt/stack/devstack/stack-noscreenrc
163-
sudo cp /vagrant/scripts/stackinabox/devstack2 /etc/init.d/devstack
172+
sudo cp /vagrant/scripts/stackinabox/devstack /etc/init.d/devstack
164173
sudo chmod +x /etc/init.d/devstack
165174
sudo update-rc.d devstack start 98 2 3 4 5 . stop 02 0 1 6 .
166175

scripts/stackinabox/local.conf

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ FORCE=yes
1717
RECLONE=False
1818
OFFLINE=False
1919
ERROR_ON_CLONE=False
20-
#REGION_NAME=labstack
2120

2221
#
2322
# set current branch
@@ -27,7 +26,7 @@ RELEASE_BRANCH=
2726
#
2827
# Allow services to be hosted on additional machines
2928
#
30-
MULTI_HOST=False
29+
MULTI_HOST=True
3130

3231
#
3332
# Set OS User DevStack run's under
@@ -37,14 +36,12 @@ STACK_USER=vagrant
3736
#
3837
# Use LXD Virtualization Driver
3938
#
40-
enable_plugin nova-lxd https://github.com/openstack/nova-lxd "stable/mitaka"
39+
enable_plugin nova-lxd https://github.com/stackinabox/nova-lxd.git $RELEASE_BRANCH
4140

4241
GIT_BASE=https://github.com
4342
DEVSTACK_INSTALL_DIR=/opt/stack/devstack
4443

4544
# Database Type
46-
#DATABASE_TYPE=mysql
47-
#enable_service mysql
4845
DATABASE_TYPE=postgres
4946
enable_service postgres
5047

@@ -58,7 +55,7 @@ DEST=/opt/stack
5855
LOGDAYS=1
5956
VERBOSE=True
6057
LOG_COLOR=True
61-
LOGFILE=$DEST/logs/stack.sh.log
58+
LOGFILE=$DEST/logs/stack.log
6259
USE_SCREEN=False
6360
SCREEN_LOGDIR=$DEST/logs
6461
ENABLE_DEBUG_LOG_LEVEL=True
@@ -150,8 +147,8 @@ enable_service c-bak
150147
CINDER_SECURE_DELETE=False
151148
VOLUME_BACKING_FILE_SIZE=50000M
152149

153-
LIVE_MIGRATION_AVAILABLE=False
154-
USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION=False
150+
LIVE_MIGRATION_AVAILABLE=True
151+
USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION=True
155152

156153
#
157154
# Enable Glance - OpenStack Image Service
@@ -181,7 +178,6 @@ disable_service tempest
181178
#
182179
# set current branch
183180
#
184-
CEILOMETER_BRANCH=$RELEASE_BRANCH
185181
CINDER_BRANCH=$RELEASE_BRANCH
186182
GLANCE_BRANCH=$RELEASE_BRANCH
187183
HEAT_BRANCH=$RELEASE_BRANCH
@@ -209,17 +205,19 @@ metadata_host=$HOST_IP
209205
notification_driver=nova.openstack.common.notifier.rpc_notifier,messagingv2
210206
notification_topics=notifications,trackinstance
211207

212-
[[post-config|$NEUTRON_CONF]]
213-
[database]
214-
min_pool_size = 5
215-
max_pool_size = 50
216-
max_overflow = 50
217-
218208
[[post-config|$NEUTRON_CONF]]
219209
[DEFAULT]
210+
advertise_mtu=true
211+
global_physnet_mtu=1550
212+
dns_domain=stackinabox.io
220213
notification_driver=neutron.openstack.common.notifier.rpc_notifier,messagingv2
221214
notification_topics=notifications,trackinstance
222215

216+
[database]
217+
min_pool_size=10
218+
max_pool_size=50
219+
max_overflow=50
220+
223221

224222
[[post-config|$CINDER_CONF]]
225223
[DEFAULT]
@@ -230,3 +228,6 @@ notification_topics=notifications,trackinstance
230228
[agent]
231229
tunnel_types=vxlan
232230
vxlan_udp_port=8472
231+
232+
[ml2]
233+
path_mtu=1550

scripts/stackinabox/post-config.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ sudo iptables -t nat -A POSTROUTING -o enp0s3 -j MASQUERADE
77

88
sudo ip link set dev enp0s3 mtu $MTU
99
sudo ip link set dev enp0s8 mtu $MTU
10+
sudo ip link set dev enp0s9 mtu 1450
1011

1112
source /home/vagrant/demo-openrc.sh labstack
1213
echo "recreating router"

0 commit comments

Comments
 (0)