From 975128e5de51e995295c96ef71266260a9545f7c Mon Sep 17 00:00:00 2001 From: sayalilunkad Date: Sat, 29 Nov 2014 16:32:20 +0530 Subject: [PATCH] Refactors cinder controller setup section in osbash This patch changes the sequence of some operations in the setup_setup_cinder_controller script, tweaks echo statements to match install-guides and adds links to the section in install-guides. Change-Id: I32797013fb2eec041b7abcd672d7ef2c651c98f7 --- labs/scripts/setup_cinder_controller.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/labs/scripts/setup_cinder_controller.sh b/labs/scripts/setup_cinder_controller.sh index 44e76000..68d7433b 100755 --- a/labs/scripts/setup_cinder_controller.sh +++ b/labs/scripts/setup_cinder_controller.sh @@ -10,7 +10,8 @@ exec_logfile indicate_current_auto #------------------------------------------------------------------------------ -# Set up Block Storage service controller (cinder controller node). +# Set up Block Storage service controller (cinder controller node) +# http://docs.openstack.org/icehouse/install-guide/install/apt/content/cinder-controller.html #------------------------------------------------------------------------------ echo "Installing cinder." @@ -19,9 +20,6 @@ sudo apt-get install -y cinder-api cinder-scheduler qemu-utils # to convert additional image types to bootable volumes. By default only # raw images can be converted. -echo "Setting up database for cinder." -setup_database cinder - function get_database_url { local db_user=$(service_to_db_user cinder) local db_password=$(service_to_db_password cinder) @@ -32,23 +30,27 @@ function get_database_url { database_url=$(get_database_url) -echo "Configuring cinder." +echo "Configuring [database] section in /etc/cinder/cinder.conf." echo "Setting database connection: $database_url." iniset_sudo /etc/cinder/cinder.conf database connection "$database_url" +echo "Setting up database for cinder." +setup_database cinder + echo "Creating the database tables for cinder." sudo cinder-manage db sync cinder_admin_user=$(service_to_user_name cinder) cinder_admin_password=$(service_to_user_password cinder) -echo "Creating cinder user and giving it admin role under service tenant." +echo "Creating cinder user." keystone user-create \ --name "$cinder_admin_user" \ --pass "$cinder_admin_password" \ --email "cinder@$MAIL_DOMAIN" +echo "Linking cinder user, service tenant and admin role." keystone user-role-add \ --user "$cinder_admin_user" \ --tenant "$SERVICE_TENANT_NAME" \ @@ -68,7 +70,7 @@ iniset_sudo $conf keystone_authtoken admin_tenant_name "$SERVICE_TENANT_NAME" iniset_sudo $conf keystone_authtoken admin_user "$cinder_admin_user" iniset_sudo $conf keystone_authtoken admin_password "$cinder_admin_password" -# Configure [DEFAULT] section. +# Configure [DEFAULT] section to use RabbitMQ message broker. iniset_sudo $conf DEFAULT rpc_backend cinder.openstack.common.rpc.impl_kombu iniset_sudo $conf DEFAULT rabbit_host controller-mgmt iniset_sudo $conf DEFAULT rabbit_port 5672 @@ -103,4 +105,3 @@ keystone endpoint-create \ echo "Restarting cinder service." sudo service cinder-scheduler restart sudo service cinder-api restart -