openstack-manuals/doc/training-guide/training-labs/Scripts/Glance/Glance.sh
Pranav Salunke 37f62041cb Added Training Labs Automation Scripts
Removed Unwanted White Spaces.Z
Removed Cirros Image from one of the sub folder.

These scripts are meant to automate deployment of
OpenStack for training and Lab sessions.

bp/training-manuals

Change-Id: I0f46d986d154a1993b014847c2181c7b59412c87
2013-10-05 15:37:58 +05:30

48 lines
1.8 KiB
Bash

#!/bin/sh
#
# About:Setup Dependences for Virtual Box 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 installaion, it #
# will configure Glance #
# #
###############################################################################
# Note: You DoNot Need Internet for this due to the magic of --download-only
echo "Internet connection is not required for this script to run"
glance_conf(){
#1. Install Glance
apt-get install -y glance
#2. Configure the Config Files
cp --no-preserve=mode,ownership Templates/glance-api.conf /etc/glance/glance-api.conf
cp --no-preserve=mode,ownership Templates/glance-api-paste.ini /etc/glance/glance-api-paste.ini
cp --no-preserve=mode,ownership Templates/glance-registry-paste.ini /etc/glance/glance-registry-paste.ini
cp --no-preserve=mode,ownership Templates/glance-registry.conf /etc/glance/glance-registry.conf
#3. Restart Glance Services
service glance-api restart
service glance-registry restart
#5. Sync Glance Database
glance-manage db_sync
#4. Upload Cirros Image to Glance
source ../Keystone/Scripts/Credentials.sh
wget http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-disk.img
glance image-create --name myFirstImage --is-public true --container-format bare --disk-format qcow2 < cirros-0.3.1-x86_64-disk.img
#5. Check The Image
glance image-list
}
echo "Running Glance Configuration"
glance_conf