blob: ccddea1cc8497ec639a64ea4ee3b228a8acca1f7 [file] [log] [blame]
Jesse Andrewsba23cc72011-09-11 03:22:13 -07001#!/usr/bin/env bash
2
Jesse Andrews6f3baaf2011-09-12 11:59:38 -07003# **stack.sh** is rackspace cloudbuilder's opinionated openstack dev installation.
Jesse Andrewsba23cc72011-09-11 03:22:13 -07004
Jesse Andrews30f68e92011-09-13 00:59:54 -07005# Settings/Options
Jesse Andrewsd74257d2011-09-13 01:24:50 -07006# ================
Jesse Andrews30f68e92011-09-13 00:59:54 -07007
Jesse Andrewsd74257d2011-09-13 01:24:50 -07008# This script is customizable through setting environment variables. If you
9# want to override a setting you can either::
10#
11# export MYSQL_PASS=anothersecret
12# ./stack.sh
13#
14# or run on a single line ``MYSQL_PASS=simple ./stack.sh``
Anthony Young963d2eb2011-09-13 17:29:02 -070015# or simply ``./stack.sh``
Jesse Andrewsd74257d2011-09-13 01:24:50 -070016
17# This script exits on an error so that errors don't compound and you see
18# only the first error that occured.
Jesse Andrewsba23cc72011-09-11 03:22:13 -070019set -o errexit
20
Jesse Andrewsd74257d2011-09-13 01:24:50 -070021# Print the commands being run so that we can see the command that triggers
22# an error. It is also useful for following allowing as the install occurs.
Jesse Andrewsba23cc72011-09-11 03:22:13 -070023set -o xtrace
24
Jesse Andrewsd74257d2011-09-13 01:24:50 -070025# Important paths: ``DIR`` is where we are executing from and ``DEST`` is
26# where we are installing openstack.
Jesse Andrewsba23cc72011-09-11 03:22:13 -070027DIR=`pwd`
28DEST=/opt
Jesse Andrewsba23cc72011-09-11 03:22:13 -070029
Jesse Andrews6f3baaf2011-09-12 11:59:38 -070030# Set the destination directories for openstack projects
Jesse Andrewsba23cc72011-09-11 03:22:13 -070031NOVA_DIR=$DEST/nova
32DASH_DIR=$DEST/dash
33GLANCE_DIR=$DEST/glance
34KEYSTONE_DIR=$DEST/keystone
35NOVACLIENT_DIR=$DEST/python-novaclient
36API_DIR=$DEST/openstackx
37NOVNC_DIR=$DEST/noVNC
Anthony Younga8416442011-09-13 20:07:44 -070038
39# Specify which services to launch. These generally correspond to screen tabs
Anthony Young927a6562011-09-14 01:58:01 -070040ENABLED_SERVICES=${ENABLED_SERVICES:-g-api,g-reg,key,n-api,n-cpu,n-net,n-sch,n-vnc,dash}
Jesse Andrewsba23cc72011-09-11 03:22:13 -070041
Jesse Andrewsd74257d2011-09-13 01:24:50 -070042# Use the first IP unless an explicit is set by ``HOST_IP`` environment variable
Jesse Andrewsba23cc72011-09-11 03:22:13 -070043if [ ! -n "$HOST_IP" ]; then
44 HOST_IP=`LC_ALL=C ifconfig | grep -m 1 'inet addr:'| cut -d: -f2 | awk '{print $1}'`
45fi
46
Jesse Andrewsd74257d2011-09-13 01:24:50 -070047# Nova network configuration
Jesse Andrewsba23cc72011-09-11 03:22:13 -070048INTERFACE=${INTERFACE:-eth0}
49FLOATING_RANGE=${FLOATING_RANGE:-10.6.0.0/27}
50FIXED_RANGE=${FIXED_RANGE:-10.0.0.0/24}
Jesse Andrewsba23cc72011-09-11 03:22:13 -070051NET_MAN=${NET_MAN:-VlanManager}
Anthony Younga8416442011-09-13 20:07:44 -070052EC2_DMZ_HOST=${EC2_DMZ_HOST:-$HOST_IP}
Jesse Andrews30f68e92011-09-13 00:59:54 -070053
Jesse Andrewsd74257d2011-09-13 01:24:50 -070054# If you are using FlatDHCP on multiple hosts, set the ``FLAT_INTERFACE``
55# variable but make sure that the interface doesn't already have an
56# ip or you risk breaking things.
Jesse Andrewsba23cc72011-09-11 03:22:13 -070057# FLAT_INTERFACE=eth0
58
Jesse Andrewsd74257d2011-09-13 01:24:50 -070059# Nova hypervisor configuration
60LIBVIRT_TYPE=${LIBVIRT_TYPE:-qemu}
61
Anthony Younga8416442011-09-13 20:07:44 -070062# Mysql connection info
Anthony Young320412b2011-09-14 02:39:10 -070063MYSQL_USER=${MYSQL_USER:-root}
Anthony Young1c364642011-09-13 20:21:42 -070064MYSQL_PASS=${MYSQL_PASS:-nova}
Anthony Younga8416442011-09-13 20:07:44 -070065MYSQL_HOST=${MYSQL_HOST:-localhost}
66# don't specify /db in this string, so we can use it for multiple services
Anthony Youngfdaf21a2011-09-13 20:11:42 -070067BASE_SQL_CONN=${BASE_SQL_CONN:-mysql://$MYSQL_USER:$MYSQL_PASS@$MYSQL_HOST}
Anthony Younga8416442011-09-13 20:07:44 -070068
69# Rabbit connection info
70RABBIT_HOST=${RABBIT_HOST:-localhost}
Jesse Andrewsba23cc72011-09-11 03:22:13 -070071
Anthony Young377aae62011-09-14 09:55:31 -070072# Glance connection info. Note the port must be specified.
73GLANCE_HOSTPORT=${GLANCE_HOSTPORT:-0.0.0.0:9292}
74
Jesse Andrews30f68e92011-09-13 00:59:54 -070075# Install Packages
Jesse Andrewsd74257d2011-09-13 01:24:50 -070076# ================
Jesse Andrews30f68e92011-09-13 00:59:54 -070077#
78# Openstack uses a fair number of other projects.
79
Jesse Andrewsd74257d2011-09-13 01:24:50 -070080# Seed configuration with mysql password so that apt-get install doesn't
81# prompt us for a password upon install.
Jesse Andrews18d350d2011-09-12 21:46:12 -070082cat <<MYSQL_PRESEED | sudo debconf-set-selections
Jesse Andrews1c1d1502011-09-12 19:29:56 -070083mysql-server-5.1 mysql-server/root_password password $MYSQL_PASS
84mysql-server-5.1 mysql-server/root_password_again password $MYSQL_PASS
85mysql-server-5.1 mysql-server/start_on_boot boolean true
86MYSQL_PRESEED
Jesse Andrews2caf8fd2011-09-12 16:15:11 -070087
Jesse Andrews75a37652011-09-12 17:09:08 -070088# install apt requirements
Jesse Andrews18d350d2011-09-12 21:46:12 -070089sudo apt-get install -y -q `cat $DIR/apts/* | cut -d\# -f1`
Jesse Andrewsba23cc72011-09-11 03:22:13 -070090
Jesse Andrews75a37652011-09-12 17:09:08 -070091# install python requirements
Anthony Young1bbd9e02011-09-12 23:59:19 -070092sudo PIP_DOWNLOAD_CACHE=/var/cache/pip pip install `cat $DIR/pips/*`
Jesse Andrewsba23cc72011-09-11 03:22:13 -070093
Jesse Andrews61632572011-09-12 17:40:00 -070094# git clone only if directory doesn't exist already
95function git_clone {
96 if [ ! -d $2 ]; then
97 git clone $1 $2
98 fi
99}
100
Jesse Andrews75a37652011-09-12 17:09:08 -0700101# compute service
Jesse Andrews61632572011-09-12 17:40:00 -0700102git_clone https://github.com/cloudbuilders/nova.git $NOVA_DIR
Jesse Andrews75a37652011-09-12 17:09:08 -0700103# image catalog service
Jesse Andrews61632572011-09-12 17:40:00 -0700104git_clone https://github.com/cloudbuilders/glance.git $GLANCE_DIR
Jesse Andrews75a37652011-09-12 17:09:08 -0700105# unified auth system (manages accounts/tokens)
Jesse Andrews61632572011-09-12 17:40:00 -0700106git_clone https://github.com/cloudbuilders/keystone.git $KEYSTONE_DIR
Jesse Andrews75a37652011-09-12 17:09:08 -0700107# a websockets/html5 or flash powered VNC console for vm instances
Jesse Andrews61632572011-09-12 17:40:00 -0700108git_clone https://github.com/cloudbuilders/noVNC.git $NOVNC_DIR
Jesse Andrews75a37652011-09-12 17:09:08 -0700109# django powered web control panel for openstack
Jesse Andrews61632572011-09-12 17:40:00 -0700110git_clone https://github.com/cloudbuilders/openstack-dashboard.git $DASH_DIR
Jesse Andrews75a37652011-09-12 17:09:08 -0700111# python client library to nova that dashboard (and others) use
Jesse Andrews61632572011-09-12 17:40:00 -0700112git_clone https://github.com/cloudbuilders/python-novaclient.git $NOVACLIENT_DIR
Jesse Andrews75a37652011-09-12 17:09:08 -0700113# openstackx is a collection of extensions to openstack.compute & nova
114# that is *deprecated*. The code is being moved into python-novaclient & nova.
Jesse Andrews61632572011-09-12 17:40:00 -0700115git_clone https://github.com/cloudbuilders/openstackx.git $API_DIR
Jesse Andrewsba23cc72011-09-11 03:22:13 -0700116
Jesse Andrews30f68e92011-09-13 00:59:54 -0700117# Initialization
Jesse Andrewsd74257d2011-09-13 01:24:50 -0700118# ==============
Jesse Andrews30f68e92011-09-13 00:59:54 -0700119
Jesse Andrews75a37652011-09-12 17:09:08 -0700120# setup our checkouts so they are installed into python path
Jesse Andrewsd74257d2011-09-13 01:24:50 -0700121# allowing ``import nova`` or ``import glance.client``
Jesse Andrews18d350d2011-09-12 21:46:12 -0700122cd $NOVACLIENT_DIR; sudo python setup.py develop
123cd $KEYSTONE_DIR; sudo python setup.py develop
124cd $GLANCE_DIR; sudo python setup.py develop
125cd $API_DIR; sudo python setup.py develop
126cd $DASH_DIR/django-openstack; sudo python setup.py develop
127cd $DASH_DIR/openstack-dashboard; sudo python setup.py develop
Jesse Andrewsba23cc72011-09-11 03:22:13 -0700128
Jesse Andrews75a37652011-09-12 17:09:08 -0700129# attempt to load modules: kvm (hardware virt) and nbd (network block
130# device - used to manage qcow images)
Jesse Andrews18d350d2011-09-12 21:46:12 -0700131sudo modprobe nbd || true
132sudo modprobe kvm || true
Jesse Andrews4d6cb142011-09-12 23:48:30 -0700133# user needs to be member of libvirtd group for nova-compute to use libvirt
134sudo usermod -a -G libvirtd `whoami`
Jesse Andrews75a37652011-09-12 17:09:08 -0700135# if kvm wasn't running before we need to restart libvirt to enable it
Jesse Andrews18d350d2011-09-12 21:46:12 -0700136sudo /etc/init.d/libvirt-bin restart
Jesse Andrewsba23cc72011-09-11 03:22:13 -0700137
Jesse Andrewsdfcd2002011-09-13 13:17:22 -0700138## FIXME(ja): should LIBVIRT_TYPE be kvm if kvm module is loaded?
Jesse Andrewsbe395c12011-09-12 19:11:30 -0700139
Jesse Andrewsdfcd2002011-09-13 13:17:22 -0700140# add useful screenrc
141cp $DIR/files/screenrc ~/.screenrc
Jesse Andrews6f3baaf2011-09-12 11:59:38 -0700142
Jesse Andrewsdfcd2002011-09-13 13:17:22 -0700143# TODO: update current user to allow sudo for all commands in files/sudo/*
144
Jesse Andrewsba23cc72011-09-11 03:22:13 -0700145
Jesse Andrewsd74257d2011-09-13 01:24:50 -0700146# Dashboard
147# ---------
148#
149# Setup the django application to serve via apache/wsgi
Jesse Andrews75a37652011-09-12 17:09:08 -0700150
151# Dash currently imports quantum even if you aren't using it. Instead
152# of installing quantum we can create a simple module that will pass the
153# initial imports
Anthony Young5d4843c2011-09-13 17:22:18 -0700154sudo mkdir -p $DASH_DIR/openstack-dashboard/quantum || true
155sudo touch $DASH_DIR/openstack-dashboard/quantum/__init__.py
156sudo touch $DASH_DIR/openstack-dashboard/quantum/client.py
Jesse Andrews1c1d1502011-09-12 19:29:56 -0700157
Jesse Andrews75a37652011-09-12 17:09:08 -0700158cd $DASH_DIR/openstack-dashboard
Anthony Young5d4843c2011-09-13 17:22:18 -0700159sudo cp local/local_settings.py.example local/local_settings.py
Jesse Andrews75a37652011-09-12 17:09:08 -0700160dashboard/manage.py syncdb
161
Jesse Andrewsdfcd2002011-09-13 13:17:22 -0700162# create an empty directory that apache uses as docroot
Anthony Young5d4843c2011-09-13 17:22:18 -0700163sudo mkdir -p $DASH_DIR/.blackhole
Jesse Andrews1c1d1502011-09-12 19:29:56 -0700164
Anthony Young76d5dc72011-09-13 17:00:00 -0700165## Configure apache's 000-default to run dashboard
166sudo cp $DIR/files/000-default.template /etc/apache2/sites-enabled/000-default
Anthony Young4da66862011-09-13 17:08:12 -0700167sudo sed -e "s,%DASH_DIR%,$DASH_DIR,g" -i /etc/apache2/sites-enabled/000-default
Jesse Andrews18d350d2011-09-12 21:46:12 -0700168
Jesse Andrewsdfcd2002011-09-13 13:17:22 -0700169# ``python setup.py develop`` left some files owned by root in ``DASH_DIR`` and
Jesse Andrews18d350d2011-09-12 21:46:12 -0700170# others by the original owner. We need to change the owner to apache so
171# dashboard can run
172sudo chown -R www-data:www-data $DASH_DIR
Jesse Andrews75a37652011-09-12 17:09:08 -0700173
Anthony Young3859f732011-09-14 02:33:43 -0700174# Update the DB to give user ‘$MYSQL_USER’@’%’ full control of the all databases:
Anthony Young10791a12011-09-14 09:40:58 -0700175sudo mysql -uroot -p$MYSQL_PASS -e "GRANT ALL PRIVILEGES ON *.* TO '$MYSQL_USER'@'%' identified by '$MYSQL_PASS';"
Anthony Young3859f732011-09-14 02:33:43 -0700176
Anthony Young80638e52011-09-14 01:29:05 -0700177# Edit /etc/mysql/my.cnf to change ‘bind-address’ from localhost (127.0.0.1) to any (0.0.0.0) and restart the mysql service:
178sudo sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf
179sudo service mysql restart
Jesse Andrewsdfcd2002011-09-13 13:17:22 -0700180
Jesse Andrewsd74257d2011-09-13 01:24:50 -0700181# Glance
182# ------
183
Jesse Andrewsdfcd2002011-09-13 13:17:22 -0700184# Glance uses ``/var/lib/glance`` and ``/var/log/glance`` by default, so
185# we need to insure that our user has permissions to use them.
Jesse Andrews9053d6a2011-09-12 22:13:11 -0700186sudo mkdir -p /var/log/glance
Jesse Andrewsdfcd2002011-09-13 13:17:22 -0700187sudo chown -R `whoami` /var/log/glance
188sudo mkdir -p /var/lib/glance
189sudo chown -R `whoami` /var/lib/glance
Jesse Andrews75a37652011-09-12 17:09:08 -0700190
Jesse Andrewsdfcd2002011-09-13 13:17:22 -0700191# Delete existing images/database as glance will recreate the db on startup
192rm -rf /var/lib/glance/images/*
Anthony Youngb6838a12011-09-13 17:13:32 -0700193# (re)create glance database
Anthony Youngfdaf21a2011-09-13 20:11:42 -0700194mysql -u$MYSQL_USER -p$MYSQL_PASS -e 'DROP DATABASE glance;' || true
195mysql -u$MYSQL_USER -p$MYSQL_PASS -e 'CREATE DATABASE glance;'
Anthony Youngb6838a12011-09-13 17:13:32 -0700196# Copy over our glance-registry.conf
Anthony Youngaf9de3d2011-09-13 19:45:18 -0700197GLANCE_CONF=$GLANCE_DIR/etc/glance-registry.conf
Anthony Young79918c52011-09-13 19:43:14 -0700198cp $DIR/files/glance-registry.conf $GLANCE_CONF
Anthony Younga8416442011-09-13 20:07:44 -0700199sudo sed -e "s,%SQL_CONN%,$BASE_SQL_CONN/glance,g" -i $GLANCE_CONF
Jesse Andrews75a37652011-09-12 17:09:08 -0700200
Jesse Andrewsd74257d2011-09-13 01:24:50 -0700201# Nova
202# ----
203
Jesse Andrewsba23cc72011-09-11 03:22:13 -0700204function add_nova_flag {
205 echo "$1" >> $NOVA_DIR/bin/nova.conf
206}
207
Jesse Andrews75a37652011-09-12 17:09:08 -0700208# (re)create nova.conf
209rm -f $NOVA_DIR/bin/nova.conf
210add_nova_flag "--verbose"
211add_nova_flag "--nodaemon"
212add_nova_flag "--dhcpbridge_flagfile=$NOVA_DIR/bin/nova.conf"
213add_nova_flag "--network_manager=nova.network.manager.$NET_MAN"
214add_nova_flag "--my_ip=$HOST_IP"
215add_nova_flag "--public_interface=$INTERFACE"
216add_nova_flag "--vlan_interface=$INTERFACE"
Anthony Younga8416442011-09-13 20:07:44 -0700217add_nova_flag "--sql_connection=$BASE_SQL_CONN/nova"
Jesse Andrews75a37652011-09-12 17:09:08 -0700218add_nova_flag "--libvirt_type=$LIBVIRT_TYPE"
219add_nova_flag "--osapi_extensions_path=$API_DIR/extensions"
220add_nova_flag "--vncproxy_url=http://$HOST_IP:6080"
Anthony Young1f81db62011-09-13 03:35:00 -0700221add_nova_flag "--vncproxy_wwwroot=$NOVNC_DIR/"
Jesse Andrews75a37652011-09-12 17:09:08 -0700222add_nova_flag "--api_paste_config=$KEYSTONE_DIR/examples/paste/nova-api-paste.ini"
223add_nova_flag "--image_service=nova.image.glance.GlanceImageService"
Anthony Younga8416442011-09-13 20:07:44 -0700224add_nova_flag "--image_service=nova.image.glance.GlanceImageService"
225add_nova_flag "--ec2_dmz_host=$EC2_DMZ_HOST"
226add_nova_flag "--rabbit_host=$RABBIT_HOST"
Anthony Young377aae62011-09-14 09:55:31 -0700227add_nova_flag "--glance_api_servers=$GLANCE_HOSTPORT"
Jesse Andrews75a37652011-09-12 17:09:08 -0700228if [ -n "$FLAT_INTERFACE" ]; then
229 add_nova_flag "--flat_interface=$FLAT_INTERFACE"
Jesse Andrewsba23cc72011-09-11 03:22:13 -0700230fi
231
Jesse Andrews75a37652011-09-12 17:09:08 -0700232# create a new named screen to store things in
233screen -d -m -S nova -t nova
234sleep 1
Jesse Andrewsba23cc72011-09-11 03:22:13 -0700235
Jesse Andrewsdfcd2002011-09-13 13:17:22 -0700236# setup nova instance directory
237mkdir -p $NOVA_DIR/instances
238
239# if there is a partition labeled nova-instances use it (ext filesystems
240# can be labeled via e2label)
241## FIXME: if already mounted this blows up...
242if [ -L /dev/disk/by-label/nova-instances ]; then
243 sudo mount -L nova-instances $NOVA_DIR/instances
244 sudo chown -R `whoami` $NOVA_DIR/instances
245fi
246
Jesse Andrews75a37652011-09-12 17:09:08 -0700247# Clean out the instances directory
248rm -rf $NOVA_DIR/instances/*
249
250# delete traces of nova networks from prior runs
251killall dnsmasq || true
252rm -rf $NOVA_DIR/networks
253mkdir -p $NOVA_DIR/networks
254
255# (re)create nova database
Anthony Youngfdaf21a2011-09-13 20:11:42 -0700256mysql -u$MYSQL_USER -p$MYSQL_PASS -e 'DROP DATABASE nova;' || true
257mysql -u$MYSQL_USER -p$MYSQL_PASS -e 'CREATE DATABASE nova;'
Jesse Andrewse8d9cd82011-09-13 15:16:26 -0700258$NOVA_DIR/bin/nova-manage db sync
259
260# create a small network
261$NOVA_DIR/bin/nova-manage network create private $FIXED_RANGE 1 32
262
263# create some floating ips
264$NOVA_DIR/bin/nova-manage floating create $FLOATING_RANGE
265
266# Keystone
267# --------
268
269# (re)create keystone database
Anthony Youngfdaf21a2011-09-13 20:11:42 -0700270mysql -u$MYSQL_USER -p$MYSQL_PASS -e 'DROP DATABASE keystone;' || true
271mysql -u$MYSQL_USER -p$MYSQL_PASS -e 'CREATE DATABASE keystone;'
Jesse Andrews75a37652011-09-12 17:09:08 -0700272
Anthony Young3a093122011-09-13 19:01:45 +0000273# FIXME (anthony) keystone should use keystone.conf.example
274KEYSTONE_CONF=$KEYSTONE_DIR/etc/keystone.conf
275cp $DIR/files/keystone.conf $KEYSTONE_CONF
Anthony Younga8416442011-09-13 20:07:44 -0700276sudo sed -e "s,%SQL_CONN%,$BASE_SQL_CONN/keystone,g" -i $KEYSTONE_CONF
Anthony Young3a093122011-09-13 19:01:45 +0000277
Jesse Andrews75a37652011-09-12 17:09:08 -0700278# initialize keystone with default users/endpoints
Jesse Andrews73e27b82011-09-12 17:55:00 -0700279BIN_DIR=$KEYSTONE_DIR/bin bash $DIR/files/keystone_data.sh
Jesse Andrews75a37652011-09-12 17:09:08 -0700280
Jesse Andrews75a37652011-09-12 17:09:08 -0700281
Jesse Andrewsd74257d2011-09-13 01:24:50 -0700282# Launch Services
283# ===============
Jesse Andrews30f68e92011-09-13 00:59:54 -0700284
Jesse Andrews1c1d1502011-09-12 19:29:56 -0700285# nova api crashes if we start it with a regular screen command,
286# so send the start command by forcing text into the window.
Jesse Andrewsdfcd2002011-09-13 13:17:22 -0700287# Only run the services specified in ``ENABLED_SERVICES``
288
289NL=`echo -ne '\015'`
290
Jesse Andrews1c1d1502011-09-12 19:29:56 -0700291function screen_it {
Anthony Young292e46d2011-09-13 11:28:56 -0700292 if [[ "$ENABLED_SERVICES" =~ "$1" ]]; then
293 screen -S nova -X screen -t $1
294 screen -S nova -p $1 -X stuff "$2$NL"
295 fi
Jesse Andrews1c1d1502011-09-12 19:29:56 -0700296}
297
Jesse Andrews75a37652011-09-12 17:09:08 -0700298screen_it g-api "cd $GLANCE_DIR; bin/glance-api --config-file=etc/glance-api.conf"
299screen_it g-reg "cd $GLANCE_DIR; bin/glance-registry --config-file=etc/glance-registry.conf"
Jesse Andrews4d6cb142011-09-12 23:48:30 -0700300# keystone drops a keystone.log where if it is run, so change the path to
301# where it can write
Anthony Young3a093122011-09-13 19:01:45 +0000302screen_it key "cd /tmp; $KEYSTONE_DIR/bin/keystone --config-file $KEYSTONE_CONF"
Jesse Andrews55508d62011-09-12 19:00:28 -0700303screen_it n-api "$NOVA_DIR/bin/nova-api"
304screen_it n-cpu "$NOVA_DIR/bin/nova-compute"
305screen_it n-net "$NOVA_DIR/bin/nova-network"
306screen_it n-sch "$NOVA_DIR/bin/nova-scheduler"
Anthony Young1f81db62011-09-13 03:35:00 -0700307# nova-vncproxy binds a privileged port, and so needs sudo
308screen_it n-vnc "sudo $NOVA_DIR/bin/nova-vncproxy"
Anthony Young8fbba912011-09-13 09:20:58 -0700309screen_it dash "sudo /etc/init.d/apache2 restart; sudo tail -f /var/log/apache2/error.log"
Jesse Andrews75a37652011-09-12 17:09:08 -0700310
Jesse Andrewsd74257d2011-09-13 01:24:50 -0700311# Install Images
312# ==============
Jesse Andrewse49b8bd2011-09-12 18:08:04 -0700313
Jesse Andrews30f68e92011-09-13 00:59:54 -0700314# Downloads a tty image (ami/aki/ari style), then extracts it. Upon extraction
315# we upload to glance with the glance cli tool.
Jesse Andrewse49b8bd2011-09-12 18:08:04 -0700316
317mkdir -p $DEST/images
318cd $DEST/images
Jesse Andrewse49b8bd2011-09-12 18:08:04 -0700319if [ ! -f $DEST/tty.tgz ]; then
Jesse Andrewsbe395c12011-09-12 19:11:30 -0700320 wget -c http://images.ansolabs.com/tty.tgz -O $DEST/tty.tgz
Jesse Andrewse49b8bd2011-09-12 18:08:04 -0700321fi
322
323# extract ami-tty/image, aki-tty/image & ari-tty/image
Jesse Andrewsbe395c12011-09-12 19:11:30 -0700324tar -zxf $DEST/tty.tgz
Jesse Andrewse49b8bd2011-09-12 18:08:04 -0700325
Jesse Andrewsbe395c12011-09-12 19:11:30 -0700326# add images to glance
327# FIXME: kernel/ramdisk is hardcoded - use return result from add
Jesse Andrewse49b8bd2011-09-12 18:08:04 -0700328glance add name="tty-kernel" is_public=true container_format=aki disk_format=aki < aki-tty/image
329glance add name="tty-ramdisk" is_public=true container_format=ari disk_format=ari < ari-tty/image
330glance add name="tty" is_public=true container_format=ami disk_format=ami kernel_id=1 ramdisk_id=2 < ami-tty/image