Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
1046d94ec1
2 changed files with 31 additions and 42 deletions
66
stack.sh
66
stack.sh
|
@ -660,55 +660,41 @@ screen_it dash "cd $DASH_DIR && sudo /etc/init.d/apache2 restart; sudo tail -f /
|
||||||
# Install Images
|
# Install Images
|
||||||
# ==============
|
# ==============
|
||||||
|
|
||||||
# Upload a couple images to glance. **TTY** is a simple small image that use the
|
# Upload an image to glance.
|
||||||
# lets you login to it with username/password of user/password. TTY is useful
|
|
||||||
# for basic functionality. We all include an Ubuntu cloud build of **Natty**.
|
|
||||||
# Natty uses cloud-init, supporting login via keypair and sending scripts as
|
|
||||||
# userdata.
|
|
||||||
#
|
#
|
||||||
# Read more about cloud-init at https://help.ubuntu.com/community/CloudInit
|
# The default image is a small ***TTY*** testing image, which lets you login
|
||||||
|
# the username/password of root/password.
|
||||||
|
#
|
||||||
|
# TTY also uses cloud-init, supporting login via keypair and sending scripts as
|
||||||
|
# userdata. See https://help.ubuntu.com/community/CloudInit for more on cloud-init
|
||||||
|
#
|
||||||
|
# Override IMAGE_URLS if you would to launch a different image(s).
|
||||||
|
# Specify IMAGE_URLS as a comma-separated list of uec urls. Some other options include:
|
||||||
|
# natty: http://uec-images.ubuntu.com/natty/current/natty-server-cloudimg-amd64.tar.gz
|
||||||
|
# oneiric: http://uec-images.ubuntu.com/oneiric/current/oneiric-server-cloudimg-amd64.tar.gz
|
||||||
|
|
||||||
if [[ "$ENABLED_SERVICES" =~ "g-reg" ]]; then
|
if [[ "$ENABLED_SERVICES" =~ "g-reg" ]]; then
|
||||||
# create a directory for the downloadedthe images tarballs.
|
# Create a directory for the downloaded image tarballs.
|
||||||
mkdir -p $FILES/images
|
mkdir -p $FILES/images
|
||||||
|
|
||||||
# Debug Image (TTY)
|
for image_url in ${IMAGE_URLS//,/ }; do
|
||||||
# -----------------
|
# Downloads the image (uec ami+aki style), then extracts it.
|
||||||
|
IMAGE_FNAME=`echo "$image_url" | python -c "import sys; print sys.stdin.read().split('/')[-1]"`
|
||||||
# Downloads the image (ami/aki/ari style), then extracts it. Upon extraction
|
IMAGE_NAME=`echo "$IMAGE_FNAME" | python -c "import sys; print sys.stdin.read().split('.tar.gz')[0].split('.tgz')[0]"`
|
||||||
# we upload to glance with the glance cli tool. TTY is a stripped down
|
if [ ! -f $FILES/$IMAGE_FNAME ]; then
|
||||||
# version of ubuntu.
|
wget -c $image_url -O $FILES/$IMAGE_FNAME
|
||||||
if [ ! -f $FILES/tty.tgz ]; then
|
|
||||||
wget -c http://images.ansolabs.com/tty.tgz -O $FILES/tty.tgz
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# extract ami-tty/image, aki-tty/image & ari-tty/image
|
# Extract ami and aki files
|
||||||
tar -zxf $FILES/tty.tgz -C $FILES/images
|
tar -zxf $FILES/$IMAGE_FNAME -C $FILES/images
|
||||||
|
|
||||||
# Use glance client to add the kernel, ramdisk and finally the root
|
# Use glance client to add the kernel the root filesystem.
|
||||||
# filesystem. We parse the results of the uploads to get glance IDs of the
|
# We parse the results of the first upload to get the glance ID of the
|
||||||
# ramdisk and kernel and use them for the root filesystem.
|
# kernel for use when uploading the root filesystem.
|
||||||
RVAL=`glance add -A $SERVICE_TOKEN name="tty-kernel" is_public=true container_format=aki disk_format=aki < $FILES/images/aki-tty/image`
|
RVAL=`glance add -A $SERVICE_TOKEN name="$IMAGE_NAME-kernel" is_public=true container_format=aki disk_format=aki < $FILES/images/$IMAGE_NAME-vmlinuz*`
|
||||||
KERNEL_ID=`echo $RVAL | cut -d":" -f2 | tr -d " "`
|
KERNEL_ID=`echo $RVAL | cut -d":" -f2 | tr -d " "`
|
||||||
RVAL=`glance add -A $SERVICE_TOKEN name="tty-ramdisk" is_public=true container_format=ari disk_format=ari < $FILES/images/ari-tty/image`
|
glance add -A $SERVICE_TOKEN name="$IMAGE_NAME" is_public=true container_format=ami disk_format=ami kernel_id=$KERNEL_ID < $FILES/images/$IMAGE_NAME.img
|
||||||
RAMDISK_ID=`echo $RVAL | cut -d":" -f2 | tr -d " "`
|
done
|
||||||
glance add -A $SERVICE_TOKEN name="tty" is_public=true container_format=ami disk_format=ami kernel_id=$KERNEL_ID ramdisk_id=$RAMDISK_ID < $FILES/images/ami-tty/image
|
|
||||||
|
|
||||||
# Ubuntu 11.04 aka Natty
|
|
||||||
# ----------------------
|
|
||||||
|
|
||||||
# Downloaded from ubuntu enterprise cloud images. This
|
|
||||||
# image doesn't use the ramdisk functionality
|
|
||||||
if [ ! -f $FILES/natty.tgz ]; then
|
|
||||||
wget -c http://uec-images.ubuntu.com/natty/current/natty-server-cloudimg-amd64.tar.gz -O $FILES/natty.tgz
|
|
||||||
fi
|
|
||||||
|
|
||||||
tar -zxf $FILES/natty.tgz -C $FILES/images
|
|
||||||
|
|
||||||
RVAL=`glance add -A $SERVICE_TOKEN name="uec-natty-kernel" is_public=true container_format=aki disk_format=aki < $FILES/images/natty-server-cloudimg-amd64-vmlinuz-virtual`
|
|
||||||
KERNEL_ID=`echo $RVAL | cut -d":" -f2 | tr -d " "`
|
|
||||||
glance add -A $SERVICE_TOKEN name="uec-natty" is_public=true container_format=ami disk_format=ami kernel_id=$KERNEL_ID < $FILES/images/natty-server-cloudimg-amd64.img
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Fin
|
# Fin
|
||||||
|
|
3
stackrc
3
stackrc
|
@ -27,6 +27,9 @@ NOVACLIENT_BRANCH=master
|
||||||
OPENSTACKX_REPO=https://github.com/cloudbuilders/openstackx.git
|
OPENSTACKX_REPO=https://github.com/cloudbuilders/openstackx.git
|
||||||
OPENSTACKX_BRANCH=diablo
|
OPENSTACKX_BRANCH=diablo
|
||||||
|
|
||||||
|
# Specify a comma-separated list of uec images to download and install into glance.
|
||||||
|
IMAGE_URLS=http://smoser.brickies.net/ubuntu/ttylinux-uec/ttylinux-uec-amd64-11.2_2.6.35-15_1.tar.gz
|
||||||
|
|
||||||
# allow local overrides of env variables
|
# allow local overrides of env variables
|
||||||
if [ -f ./localrc ]; then
|
if [ -f ./localrc ]; then
|
||||||
source ./localrc
|
source ./localrc
|
||||||
|
|
Loading…
Reference in a new issue