|
...
|
...
|
@@ -4,12 +4,17 @@
|
|
4
|
4
|
|
|
5
|
5
|
# FIXME: commands should be: stack.sh should allow specifying a subset of services
|
|
6
|
6
|
|
|
|
7
|
+# Settings/Options
|
|
|
8
|
+# ----------------
|
|
|
9
|
+
|
|
7
|
10
|
# Quit script on error
|
|
8
|
11
|
set -o errexit
|
|
9
|
12
|
|
|
10
|
13
|
# Log commands as they are run for debugging
|
|
11
|
14
|
set -o xtrace
|
|
12
|
15
|
|
|
|
16
|
+# Important paths: `DIR` is where we are executing from and `DEST` is where we
|
|
|
17
|
+# are installing openstack.
|
|
13
|
18
|
DIR=`pwd`
|
|
14
|
19
|
DEST=/opt
|
|
15
|
20
|
|
|
...
|
...
|
@@ -33,6 +38,7 @@ FLOATING_RANGE=${FLOATING_RANGE:-10.6.0.0/27}
|
|
33
|
33
|
FIXED_RANGE=${FIXED_RANGE:-10.0.0.0/24}
|
|
34
|
34
|
LIBVIRT_TYPE=${LIBVIRT_TYPE:-qemu}
|
|
35
|
35
|
NET_MAN=${NET_MAN:-VlanManager}
|
|
|
36
|
+
|
|
36
|
37
|
# NOTE(vish): If you are using FlatDHCP on multiple hosts, set the interface
|
|
37
|
38
|
# below but make sure that the interface doesn't already have an
|
|
38
|
39
|
# ip or you risk breaking things.
|
|
...
|
...
|
@@ -43,6 +49,11 @@ MYSQL_PASS=${MYSQL_PASS:-nova}
|
|
43
|
43
|
SQL_CONN=${SQL_CONN:-mysql://root:$MYSQL_PASS@localhost/nova}
|
|
44
|
44
|
# TODO: set rabbitmq conn string explicitly as well
|
|
45
|
45
|
|
|
|
46
|
+# Install Packages
|
|
|
47
|
+# ----------------
|
|
|
48
|
+#
|
|
|
49
|
+# Openstack uses a fair number of other projects.
|
|
|
50
|
+
|
|
46
|
51
|
# seed configuration with mysql password
|
|
47
|
52
|
cat <<MYSQL_PRESEED | sudo debconf-set-selections
|
|
48
|
53
|
mysql-server-5.1 mysql-server/root_password password $MYSQL_PASS
|
|
...
|
...
|
@@ -79,6 +90,9 @@ git_clone https://github.com/cloudbuilders/python-novaclient.git $NOVACLIENT_DIR
|
|
79
|
79
|
# that is *deprecated*. The code is being moved into python-novaclient & nova.
|
|
80
|
80
|
git_clone https://github.com/cloudbuilders/openstackx.git $API_DIR
|
|
81
|
81
|
|
|
|
82
|
+# Initialization
|
|
|
83
|
+# --------------
|
|
|
84
|
+
|
|
82
|
85
|
# setup our checkouts so they are installed into python path
|
|
83
|
86
|
# allowing `import nova` or `import glance.client`
|
|
84
|
87
|
cd $NOVACLIENT_DIR; sudo python setup.py develop
|
|
...
|
...
|
@@ -123,7 +137,7 @@ cd $DASH_DIR/openstack-dashboard
|
|
123
|
123
|
cp local/local_settings.py.example local/local_settings.py
|
|
124
|
124
|
dashboard/manage.py syncdb
|
|
125
|
125
|
|
|
126
|
|
-# ---- Setup Apache ----
|
|
|
126
|
+# setup apache
|
|
127
|
127
|
# create an empty directory to use as our
|
|
128
|
128
|
mkdir $DASH_DIR/.blackhole
|
|
129
|
129
|
|
|
...
|
...
|
@@ -208,6 +222,9 @@ sudo chown -R `whoami` /var/lib/glance
|
|
208
|
208
|
rm -rf /var/lib/glance/images/*
|
|
209
|
209
|
rm -f $GLANCE_DIR/glance.sqlite
|
|
210
|
210
|
|
|
|
211
|
+# Launching Services
|
|
|
212
|
+# ------------------
|
|
|
213
|
+
|
|
211
|
214
|
# nova api crashes if we start it with a regular screen command,
|
|
212
|
215
|
# so send the start command by forcing text into the window.
|
|
213
|
216
|
function screen_it {
|
|
...
|
...
|
@@ -227,12 +244,14 @@ screen_it n-sch "$NOVA_DIR/bin/nova-scheduler"
|
|
227
|
227
|
screen_it n-vnc "$NOVA_DIR/bin/nova-vncproxy"
|
|
228
|
228
|
screen_it dash "sudo /etc/init.d/apache2 restart; tail -f /var/log/apache2/error.log"
|
|
229
|
229
|
|
|
|
230
|
+# Installing Images
|
|
|
231
|
+# -----------------
|
|
230
|
232
|
|
|
231
|
|
-# ---- download an install images ----
|
|
|
233
|
+# Downloads a tty image (ami/aki/ari style), then extracts it. Upon extraction
|
|
|
234
|
+# we upload to glance with the glance cli tool.
|
|
232
|
235
|
|
|
233
|
236
|
mkdir -p $DEST/images
|
|
234
|
237
|
cd $DEST/images
|
|
235
|
|
-# prepare initial images for loading into glance
|
|
236
|
238
|
if [ ! -f $DEST/tty.tgz ]; then
|
|
237
|
239
|
wget -c http://images.ansolabs.com/tty.tgz -O $DEST/tty.tgz
|
|
238
|
240
|
fi
|