
Adds basic skeleton/structure with stubs. Changes are done as per Roger Luethi's scripts. These changes are done to incorporate various features like logging, multi-os setup etc. These scripts may also target more virtualization products like KVM, LXC down the roadmap. blueprint openstack-training-labs Change-Id: I0bb33b518080f8a9b9c0e1624f43a66337eb8278
48 lines
1.9 KiB
Bash
48 lines
1.9 KiB
Bash
#!/bin/bash
|
|
#
|
|
# About: Set up dependencies for VirtualBox sandbox meant for OpenStack Labs.
|
|
#
|
|
# Contact: pranav@aptira.com
|
|
# Copyright: Aptira @aptira,aptira.com
|
|
# License: Apache Software License (ASL) 2.0
|
|
###############################################################################
|
|
# #
|
|
# This script will install Glance related packages and after installation, it #
|
|
# will configure Glance #
|
|
# #
|
|
###############################################################################
|
|
|
|
# Note: No Internet access required -- packages downloaded by PreInstall.sh
|
|
echo "Internet connection is not required for this script to run"
|
|
SCRIPT_DIR=$(cd $(dirname "$0") && pwd)
|
|
|
|
glance_conf() {
|
|
|
|
# 1. Install Glance
|
|
apt-get install -y glance
|
|
|
|
# 2. Install the config files
|
|
cp --no-preserve=mode,ownership "$SCRIPT_DIR/Templates/glance-api.conf" /etc/glance/glance-api.conf
|
|
cp --no-preserve=mode,ownership "$SCRIPT_DIR/Templates/glance-api-paste.ini" /etc/glance/glance-api-paste.ini
|
|
cp --no-preserve=mode,ownership "$SCRIPT_DIR/Templates/glance-registry-paste.ini" /etc/glance/glance-registry-paste.ini
|
|
cp --no-preserve=mode,ownership "$SCRIPT_DIR/Templates/glance-registry.conf" /etc/glance/glance-registry.conf
|
|
|
|
# 3. Restart Glance services
|
|
service glance-api restart
|
|
service glance-registry restart
|
|
|
|
# 4. Sync Glance database
|
|
glance-manage db_sync
|
|
|
|
# 5. Upload CirrOS image to Glance
|
|
source "$SCRIPT_DIR/../Keystone/Scripts/Credentials.sh"
|
|
# CirrOS image downloaded in PreInstall.sh
|
|
glance image-create --name myFirstImage --is-public true --container-format bare --disk-format qcow2 < "$SCRIPT_DIR"/cirros-*-x86_64-disk.img
|
|
|
|
# 6. Check the image
|
|
glance image-list
|
|
}
|
|
|
|
echo "Running Glance configuration"
|
|
glance_conf
|