openstack-manuals/doc/training-guide/training-labs/Scripts/Cinder/Cinder.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

49 lines
1.7 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 Cinder related packages and after installaion, it #
# will configure Cinder, populate the database. #
# #
###############################################################################
# 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"
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. Configure the templates
cp --no-preserve=mode,ownership Templates/api-paste.ini /etc/cinder/api-paste.ini
cp --no-preserve=mode,ownership Templates/cinder.conf /etc/cinder/cinder.conf
# 5. MySQL database
cinder-manage db sync
# 5. 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
# 6. Restart Cinder Related Services
for i in $( ls /etc/init.d/cinder-* ); do $i restart; done
}
Install_Cinder