@@ -49,12 +49,14 @@ sudo update-alternatives --install /bin/sh sh /bin/bash 100
4949
5050# We need swap space to do any sort of scale testing with the Vagrant config.
5151# 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
52+ sudo rm -f /swapfile
53+ sudo fallocate -l 4G /swapfile
54+ sudo chmod 600 /swapfile
55+ sudo mkswap /swapfile
56+ sudo swapon /swapfile
57+ sudo echo " vm.swappiness = 10" | sudo tee --append /etc/sysctl.conf > /dev/null
58+ sudo echo " vm.vfs_cache_pressure = 50" | sudo tee --append /etc/sysctl.conf > /dev/null
59+ sudo echo " /swapfile none swap sw 0 0" | sudo tee --append /etc/fstab > /dev/null
5860
5961# Disable firewall (this is not production)
6062sudo ufw disable
@@ -73,14 +75,15 @@ sudo sysctl -p
7375sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
7476
7577# Update host configuration
76- sudo bash -c " echo 'openstack.stackinabox.io ' > /etc/hostname"
78+ sudo bash -c " echo 'openstack' > /etc/hostname"
7779# export eth1=`ifconfig eth1 | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'`
7880sudo bash -c ' cat > /etc/hosts' << EOF
79- 127.0.0.1 localhost.localdomain localhost openstack.stackinabox.io openstack
80- 192.168.27.100 openstack.stackinabox.io openstack
81-
81+ 127.0.0.1 localhost
82+ 192.168.27.100 openstack.stackinabox.io openstack
8283EOF
8384
85+ sudo hostname openstack
86+
8487# speed up DNS resolution
8588sudo bash -c ' cat > /etc/dhcp/dhclient.conf' << EOF
8689timeout 30;
@@ -92,24 +95,21 @@ backoff-cutoff 2;
9295link-timeout 10;
9396interface "eth0"
9497{
95- supersede host-name "openstack.stackinabox.io ";
96- supersede domain-name "stackinabox.io";
98+ # supersede host-name "openstack";
99+ # supersede domain-name "stackinabox.io";
97100 prepend domain-name-servers 192.168.27.1, 8.8.8.8, 8.8.4.4;
98- request subnet-mask,
99- broadcast-address,
101+ request subnet-mask,
102+ broadcast-address,
103+ time-offset,
100104 routers,
101- domain-name,
102- domain-name-servers,
103- host-name;
104- require routers,
105- subnet-mask,
106- domain-name-servers;
105+ domain-name,
106+ domain-name-servers,
107+ host-name,
108+ netbios-name-servers,
109+ netbios-scope;
107110}
108111EOF
109112
110- # Restart networking
111- sudo /etc/init.d/networking restart
112-
113113# enable cgroup memory limits
114114sudo sed -i ' s/GRUB_CMDLINE_LINUX_DEFAULT="/GRUB_CMDLINE_LINUX_DEFAULT="cgroup_enable=memory swapaccount=1 /g' /etc/default/grub
115115sudo sed -i ' s/GRUB_CMDLINE_LINUX="/GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1 /g' /etc/default/grub
@@ -163,16 +163,8 @@ iface br-ex inet static
163163EOF
164164
165165# Install NTP
166- sudo apt-get install -y ntp
167-
168- # stop ntp service so we can set the pool to use
169- sudo service ntp stop
170-
171- # Set ntp.ubuntu.com as the direct source of time.
172- sudo ntpdate us.pool.ntp.org
173-
174- # restart the NTP service
175- sudo service ntp restart
166+ # disabling b/c slow seed times at system startup are causing problems
167+ # sudo apt-get install -qqy ntp
176168
177169# Configure MTU on VM interfaces. Also requires manually configuring the same MTU on
178170# the equivalent 'vboxnet' interfaces on the host. i.e. sudo ip link set dev vboxnet0 mtu $MTU
@@ -230,27 +222,33 @@ sudo chmod +x /etc/init.d/devstack
230222sudo update-rc.d devstack start 98 2 3 4 5 . stop 02 0 1 6 .
231223
232224# install 'shellinabox' to make using this image on windows easier
233- # shellinabox will be available at http://192.168.27.100:4200
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
237-
238- # wait for openstack to startup
239- sleep 60
240-
241- # clean up after ourselves
242- /vagrant/scripts/minimize/clean.sh
225+ # shellinabox will be available at http://192.168.27.100:4200
226+ sudo apt-get install -y shellinabox
227+ sudo sed -i ' s/--no-beep/--no-beep --disable-ssl/g' /etc/default/shellinabox
228+ sudo /etc/init.d/shellinabox restart
243229
244230# install java (for use with udclient)
245- sudo apt-get update
246- sudo apt-get install -qqy default-jre
231+ wget http://artifacts.stackinabox.io/ibm/java-jre/latest.txt
232+ ARTIFACT_VERSION=$( cat latest.txt)
233+ ARTIFACT_DOWNLOAD_URL=http://artifacts.stackinabox.io/ibm/java-jre/$ARTIFACT_VERSION /ibm-java-jre-$ARTIFACT_VERSION -linux-x86_64.tgz
234+
235+ sudo mkdir -p /opt/java
236+ sudo wget $ARTIFACT_DOWNLOAD_URL
237+ sudo tar -zxf ibm-java-jre-$ARTIFACT_VERSION -linux-x86_64.tgz -C /opt/java/
247238sudo touch /etc/profile.d/java_home.sh
248239sudo bash -c ' cat >> /etc/profile.d/java_home.sh' << 'EOF '
249- export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/jre
240+ export JAVA_HOME=/opt/java/ibm-java-x86_64-71/jre
241+ export PATH=$JAVA_HOME/bin:$PATH
250242EOF
251243sudo chmod 755 /etc/profile.d/java_home.sh
252244
253245sudo btrfs quota enable /var/lib/lxd
254246
247+ # wait for openstack to startup
248+ sleep 60
249+
250+ # clean up after ourselves
251+ /vagrant/scripts/minimize/clean.sh
252+
255253# restart
256254# sudo shutdown -P now
0 commit comments