mysql-izing for nova
This commit is contained in:
parent
be395c1e9a
commit
1c1d1505c7
4 changed files with 33 additions and 19 deletions
16
README
16
README
|
@ -2,15 +2,19 @@ Tool to build (nfs export) openstack dev environments
|
|||
|
||||
# Todo
|
||||
|
||||
* change method of invoking stack.sh to ./stack.sh all _or_ ./stack.sh nova-compute,nova-network,nova-api,nova-volume
|
||||
* move back to using sudo
|
||||
* move to mysql
|
||||
* extract image upload to a seperate script that supports generating images via debootstrap (ubuntu-vm-builder?)
|
||||
* Add volume support
|
||||
* Add quantum support
|
||||
* Add python-novaclient cli support
|
||||
* move to mysql
|
||||
* Add volume support
|
||||
* extract image upload to a seperate script that supports generating images via debootstrap (ubuntu-vm-builder?)
|
||||
* allow changing of git locations (specify different tag/branch or repos)
|
||||
* allow sql/rabbit connection to be specified via environment variables with sensible defaults
|
||||
* change method of invoking stack.sh to ./stack.sh all _or_ ./stack.sh nova-compute,nova-network,nova-api,nova-volume
|
||||
* Add quantum support
|
||||
* allow rabbit connection to be specified via environment variables with sensible defaults
|
||||
|
||||
# Done
|
||||
|
||||
* sqlconn can be set via env
|
||||
|
||||
# Future
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
dnsmasq-base
|
||||
kpartx
|
||||
mysql-server
|
||||
python-mysqldb
|
||||
kvm
|
||||
gawk
|
||||
iptables
|
||||
|
|
2
build.sh
2
build.sh
|
@ -13,7 +13,7 @@ if [ ! -d proto ]; then
|
|||
debootstrap natty proto
|
||||
cp files/sources.list proto/etc/apt/sources.list
|
||||
chroot proto apt-get update
|
||||
chroot proto apt-get install -y `cat apts/* | cut -d\# -f1 | egrep -v "(rabbitmq|libvirt-bin)"`
|
||||
chroot proto apt-get install -y `cat apts/* | cut -d\# -f1 | egrep -v "(rabbitmq|libvirt-bin|mysql-server)"`
|
||||
chroot proto pip install `cat pips/*`
|
||||
git clone https://github.com/cloudbuilders/nova.git proto/opt/nova
|
||||
git clone https://github.com/cloudbuilders/openstackx.git proto/opt/openstackx
|
||||
|
|
32
stack.sh
32
stack.sh
|
@ -38,10 +38,17 @@ NET_MAN=${NET_MAN:-VlanManager}
|
|||
# ip or you risk breaking things.
|
||||
# FLAT_INTERFACE=eth0
|
||||
|
||||
# TODO: set rabbitmq conn string explicitly as well
|
||||
# TODO: switch to mysql for all services
|
||||
SQL_CONN=${SQL_CONN:-sqlite:///$NOVA_DIR/nova.sqlite}
|
||||
MYSQL_PASS=${MYSQL_PASS:-nova}
|
||||
SQL_CONN=${SQL_CONN:-mysql://root:$MYSQL_PASS@localhost/nova}
|
||||
# TODO: set rabbitmq conn string explicitly as well
|
||||
|
||||
# seed configuration with mysql password
|
||||
cat <<MYSQL_PRESEED | debconf-set-selections
|
||||
mysql-server-5.1 mysql-server/root_password password $MYSQL_PASS
|
||||
mysql-server-5.1 mysql-server/root_password_again password $MYSQL_PASS
|
||||
mysql-server-5.1 mysql-server/start_on_boot boolean true
|
||||
MYSQL_PRESEED
|
||||
|
||||
# install apt requirements
|
||||
apt-get install -y -q `cat $DIR/apts/* | cut -d\# -f1`
|
||||
|
@ -107,7 +114,7 @@ fi
|
|||
mkdir $DASH_DIR/openstack-dashboard/quantum
|
||||
touch $DASH_DIR/openstack-dashboard/quantum/__init__.py
|
||||
touch $DASH_DIR/openstack-dashboard/quantum/client.py
|
||||
# local_settings has
|
||||
|
||||
cd $DASH_DIR/openstack-dashboard
|
||||
cp local/local_settings.py.example local/local_settings.py
|
||||
dashboard/manage.py syncdb
|
||||
|
@ -115,9 +122,9 @@ dashboard/manage.py syncdb
|
|||
# ## Setup Apache
|
||||
# create an empty directory to use as our
|
||||
mkdir $DASH_DIR/.blackhole
|
||||
|
||||
# FIXME(ja): can't figure out how to make $DASH_DIR work in sed, also install to available/a2e it
|
||||
cat $DIR/files/000-default.template | sed 's/%DASH_DIR%/\/opt\/dash/g' > /etc/apache2/sites-enabled/000-default
|
||||
|
||||
chown -R www-data:www-data $DASH_DIR
|
||||
|
||||
mkdir -p /var/log/glance
|
||||
|
@ -129,12 +136,6 @@ cp $DIR/files/screenrc ~/.screenrc
|
|||
|
||||
NL=`echo -ne '\015'`
|
||||
|
||||
function screen_it {
|
||||
# nova api crashes if we start it with a regular screen command,
|
||||
# so send the start command by forcing text into the window.
|
||||
screen -S nova -X screen -t $1
|
||||
screen -S nova -p $1 -X stuff "$2$NL"
|
||||
}
|
||||
|
||||
function add_nova_flag {
|
||||
echo "$1" >> $NOVA_DIR/bin/nova.conf
|
||||
|
@ -173,7 +174,8 @@ rm -rf $NOVA_DIR/networks
|
|||
mkdir -p $NOVA_DIR/networks
|
||||
|
||||
# (re)create nova database
|
||||
rm -f $NOVA_DIR/nova.sqlite
|
||||
mysql -p$MYSQL_PASS -e 'DROP DATABASE nova;'
|
||||
mysql -p$MYSQL_PASS -e 'CREATE DATABASE nova;'
|
||||
$NOVA_DIR/bin/nova-manage db sync
|
||||
|
||||
# initialize keystone with default users/endpoints
|
||||
|
@ -191,6 +193,13 @@ $NOVA_DIR/bin/nova-manage floating create $FLOATING_RANGE
|
|||
rm -rf /var/lib/glance/images/*
|
||||
rm -f $GLANCE_DIR/glance.sqlite
|
||||
|
||||
# nova api crashes if we start it with a regular screen command,
|
||||
# so send the start command by forcing text into the window.
|
||||
function screen_it {
|
||||
screen -S nova -X screen -t $1
|
||||
screen -S nova -p $1 -X stuff "$2$NL"
|
||||
}
|
||||
|
||||
screen_it g-api "cd $GLANCE_DIR; bin/glance-api --config-file=etc/glance-api.conf"
|
||||
screen_it g-reg "cd $GLANCE_DIR; bin/glance-registry --config-file=etc/glance-registry.conf"
|
||||
screen_it key "$KEYSTONE_DIR/bin/keystone --config-file $KEYSTONE_DIR/etc/keystone.conf"
|
||||
|
@ -202,7 +211,6 @@ screen_it n-vnc "$NOVA_DIR/bin/nova-vncproxy"
|
|||
screen_it dash "/etc/init.d/apache2 restart; tail -f /var/log/apache2/error.log"
|
||||
|
||||
|
||||
|
||||
# ---- download an install images ----
|
||||
|
||||
mkdir -p $DEST/images
|
||||
|
|
Loading…
Reference in a new issue