Files
training-guides/labs/Scripts/Cinder/Cinder.sh
Pranav Salunke 72cd9532b3 Move Training Labs Folder
Training Labs folder was kept inside the training-guides folder since the
project was sheltered under openStack manuals project. To keep the content
more organized, moving the folder to appropriate location would be necessary.

blueprint openstack-training-labs
blueprint training-manuals

Change-Id: I4007c3fb64e76cda798ffe6cb68557f462ad07ff
2014-06-12 12:52:25 +05:30

49 lines
1.8 KiB
Bash

#!/bin/sh
#
# 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 Cinder related packages and after installation, it #
# will configure Cinder, populate the database. #
# #
###############################################################################
# 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)
install_cinder() {
# 1. Install Cinder
apt-get install -y cinder-api cinder-scheduler cinder-volume iscsitarget open-iscsi iscsitarget-dkms
# 2. Configure iscsi services
sed -i 's/false/true/g' /etc/default/iscsitarget
# 3. Restart the services
service iscsitarget start
service open-iscsi start
# 4. Install the templates
cp --no-preserve=mode,ownership "$SCRIPT_DIR/Templates/api-paste.ini" /etc/cinder/api-paste.ini
cp --no-preserve=mode,ownership "$SCRIPT_DIR/Templates/cinder.conf" /etc/cinder/cinder.conf
# 5. MySQL database
cinder-manage db sync
# 6. Format the disks -- see if something else is available instead of
# fdisk
bash format_volumes # Need expert advice on this ....
pvcreate /dev/sdb
vgcreate cinder-volumes /dev/sdb
# 7. Restart Cinder related services
for i in $( ls /etc/init.d/cinder-* ); do $i restart; done
}
install_cinder