From edb9fed9aca8452e54624d9da109cdd7cabcf30c Mon Sep 17 00:00:00 2001 From: Mark Asselstine Date: Mon, 30 Apr 2018 14:51:41 -0400 Subject: python-cinder: uprev to latest stable/pike Requires the introduction of python-oauth2client and python-google-api-python-client packages/recipes. As with other openstack component uprev's we move some of the initialization from the first run scripts to the cinder-init.service which is run on first boot. This allows for someone to disable the default configuration by not including the cinder-init package in their image. The initialization is done following the guide at: At this point we have cinder up and running, which we can verify using the "openstack volume service list" command. root@controller:~# openstack volume service list +------------------+----------------------+------+---------+-------+----------------------------+ | Binary | Host | Zone | Status | State | Updated At | +------------------+----------------------+------+---------+-------+----------------------------+ | cinder-backup | controller | nova | enabled | down | 2018-04-30T15:31:08.330770 | | cinder-volume | controller@nfsdriver | nova | enabled | down | 2018-04-30T15:31:10.477678 | | cinder-scheduler | controller | nova | enabled | down | 2018-04-30T15:31:10.653041 | +------------------+----------------------+------+---------+-------+----------------------------+ We will have to adjust the configuration for a compute node but at this point we are concentrating on the initial configuration for the controller image. Signed-off-by: Mark Asselstine Signed-off-by: Bruce Ashfield --- .../python/python-cinder/cinder-init | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 meta-openstack/recipes-devtools/python/python-cinder/cinder-init (limited to 'meta-openstack/recipes-devtools/python/python-cinder/cinder-init') diff --git a/meta-openstack/recipes-devtools/python/python-cinder/cinder-init b/meta-openstack/recipes-devtools/python/python-cinder/cinder-init new file mode 100644 index 0000000..e1a5758 --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-cinder/cinder-init @@ -0,0 +1,57 @@ +#!/bin/bash +# +# Basic cinder setup based on: +# https://docs.openstack.org/cinder/pike/install/cinder-controller-install-ubuntu.html +# +# Prerequisites: keystone must be available and bootstrapped +# + +# Substitutions setup at do_intall() +DB_USER=%DB_USER% +CINDER_USER=%CINDER_USER% +CINDER_GROUP=%CINDER_GROUP% +CONTROLLER_IP=%CONTROLLER_IP% +ADMIN_USER=%ADMIN_USER% +ADMIN_PASSWORD=%ADMIN_PASSWORD% +ADMIN_ROLE=%ADMIN_ROLE% +SYSCONFDIR=%SYSCONFDIR% + +sudo -u postgres psql -c "CREATE DATABASE \"cinder\"" 2> /dev/null +sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE \"cinder\" TO ${DB_USER}" 2> /dev/null + +source ${SYSCONFDIR}/keystone/admin-openrc + +openstack user create --domain default --password ${ADMIN_PASSWORD} ${CINDER_USER} + +# Ensure the 'service' project exists +openstack project show service > /dev/null 2>&1 +if [ $? -ne 0 ]; then + openstack project create service --domain default +fi +openstack role add --project service --user ${CINDER_USER} ${ADMIN_ROLE} + +# Create cinderv2 service and service endpoints +openstack service create --name cinderv2 --description "OpenStack Block Storage" volumev2 +openstack endpoint create --region RegionOne volumev2 public http://${CONTROLLER_IP}:8776/v2/%\(project_id\)s +openstack endpoint create --region RegionOne volumev2 internal http://${CONTROLLER_IP}:8776/v2/%\(project_id\)s +openstack endpoint create --region RegionOne volumev2 admin http://${CONTROLLER_IP}:8776/v2/%\(project_id\)s + +# Create cinderv3 service and service endpoints +openstack service create --name cinderv3 --description "OpenStack Block Storage" volumev3 +openstack endpoint create --region RegionOne volumev3 public http://${CONTROLLER_IP}:8776/v3/%\(project_id\)s +openstack endpoint create --region RegionOne volumev3 internal http://${CONTROLLER_IP}:8776/v3/%\(project_id\)s +openstack endpoint create --region RegionOne volumev3 admin http://${CONTROLLER_IP}:8776/v3/%\(project_id\)s + +sudo -u ${CINDER_USER} cinder-manage db sync + +# Enable cinder services now that they are configured +systemctl enable cinder-api +systemctl enable cinder-volume +systemctl enable cinder-backup +systemctl enable cinder-scheduler + +# Start our services +systemctl start cinder-api +systemctl start cinder-volume +systemctl start cinder-backup +systemctl start cinder-scheduler -- cgit v1.2.3-54-g00ecf