From ec272b8fe4da85351d549022829c6a2329666376 Mon Sep 17 00:00:00 2001 From: Steven Dake Date: Fri, 7 Aug 2015 09:02:07 -0700 Subject: Remove config-internal from cinder Partially-Implements: blueprint remove-config-internal Change-Id: Ic6b7cb217a126c53c0055dbcac4d345583599eb1 --- .../cinder-app/cinder-api/config-internal.sh | 77 ---------- docker/common/cinder-app/cinder-api/start.sh | 2 +- .../cinder-app/cinder-backup/config-internal.sh | 47 ------ docker/common/cinder-app/cinder-backup/start.sh | 2 +- .../common/cinder-app/cinder-base/config-cinder.sh | 157 --------------------- .../cinder-app/cinder-scheduler/config-internal.sh | 35 ----- docker/common/cinder-app/cinder-scheduler/start.sh | 2 +- .../cinder-app/cinder-volume/config-internal.sh | 98 ------------- docker/common/cinder-app/cinder-volume/start.sh | 2 +- docker/common/cinder-app/cinder-volume/tgtd.sh | 17 --- .../cinder-volume/volume-group-create.sh | 22 --- 11 files changed, 4 insertions(+), 457 deletions(-) delete mode 100755 docker/common/cinder-app/cinder-api/config-internal.sh delete mode 100755 docker/common/cinder-app/cinder-backup/config-internal.sh delete mode 100755 docker/common/cinder-app/cinder-base/config-cinder.sh delete mode 100755 docker/common/cinder-app/cinder-scheduler/config-internal.sh delete mode 100755 docker/common/cinder-app/cinder-volume/config-internal.sh delete mode 100755 docker/common/cinder-app/cinder-volume/tgtd.sh delete mode 100755 docker/common/cinder-app/cinder-volume/volume-group-create.sh (limited to 'docker/common') diff --git a/docker/common/cinder-app/cinder-api/config-internal.sh b/docker/common/cinder-app/cinder-api/config-internal.sh deleted file mode 100755 index 158d1efe1..000000000 --- a/docker/common/cinder-app/cinder-api/config-internal.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash -set -e - -. /opt/kolla/kolla-common.sh -. /opt/kolla/config-cinder.sh - -check_required_vars ADMIN_TENANT_NAME \ - CINDER_API_SERVICE_HOST \ - CINDER_API_SERVICE_LISTEN \ - CINDER_API_SERVICE_PORT \ - CINDER_KEYSTONE_PASSWORD \ - CINDER_KEYSTONE_USER \ - KEYSTONE_ADMIN_SERVICE_HOST \ - KEYSTONE_ADMIN_SERVICE_PORT \ - KEYSTONE_AUTH_PROTOCOL \ - KEYSTONE_ADMIN_TOKEN \ - PUBLIC_IP - -fail_unless_os_service_running keystone - -cfg=/etc/cinder/cinder.conf - -# Set the auth credentials -export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}" -export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:${KEYSTONE_ADMIN_SERVICE_PORT}/v2.0" - -# Create Keystone User -crux user-create --update \ - -n "${CINDER_KEYSTONE_USER}" \ - -p "${CINDER_KEYSTONE_PASSWORD}" \ - -t "${ADMIN_TENANT_NAME}" \ - -r admin - -# Configure Keystone -crux endpoint-create --remove-all \ - -n cinder \ - -t volume \ - -P "http://${CINDER_API_SERVICE_HOST}:${CINDER_API_SERVICE_PORT}/v2/\$(tenant_id)s" \ - -A "http://${CINDER_API_SERVICE_HOST}:${CINDER_API_SERVICE_PORT}/v2/\$(tenant_id)s" \ - -I "http://${CINDER_API_SERVICE_HOST}:${CINDER_API_SERVICE_PORT}/v2/\$(tenant_id)s" - -crux endpoint-create --remove-all \ - -n cinderv2 \ - -t volumev2 \ - -P "http://${CINDER_API_SERVICE_HOST}:${CINDER_API_SERVICE_PORT}/v2/\$(tenant_id)s" \ - -A "http://${CINDER_API_SERVICE_HOST}:${CINDER_API_SERVICE_PORT}/v2/\$(tenant_id)s" \ - -I "http://${CINDER_API_SERVICE_HOST}:${CINDER_API_SERVICE_PORT}/v2/\$(tenant_id)s" - -# Logging -crudini --set $cfg \ - DEFAULT \ - log_file \ - "${CINDER_API_LOG_FILE}" - -# API Configuration -crudini --set $cfg \ - DEFAULT \ - osapi_volume_listen \ - "${CINDER_API_SERVICE_LISTEN}" - -crudini --set $cfg \ - DEFAULT \ - osapi_volume_listen_port \ - "${CINDER_API_SERVICE_PORT}" - -crudini --set $cfg \ - DEFAULT \ - enable_v1_api \ - "false" - -crudini --set $cfg \ - DEFAULT \ - enable_v2_api \ - "true" - -echo "Starting cinder-api" -exec /usr/bin/cinder-api --config-file $cfg diff --git a/docker/common/cinder-app/cinder-api/start.sh b/docker/common/cinder-app/cinder-api/start.sh index 4385d0631..e6f79b3a6 100755 --- a/docker/common/cinder-app/cinder-api/start.sh +++ b/docker/common/cinder-app/cinder-api/start.sh @@ -8,7 +8,7 @@ ARGS="" # Loading common functions. source /opt/kolla/kolla-common.sh -# Config-internal script exec out of this function, it does not return here. +# Execute config strategy set_configs # Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases diff --git a/docker/common/cinder-app/cinder-backup/config-internal.sh b/docker/common/cinder-app/cinder-backup/config-internal.sh deleted file mode 100755 index bd1dda9fa..000000000 --- a/docker/common/cinder-app/cinder-backup/config-internal.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -set -e - -. /opt/kolla/kolla-common.sh -. /opt/kolla/config-cinder.sh - -check_required_vars CINDER_BACKUP_API_CLASS \ - CINDER_BACKUP_MANAGER \ - CINDER_BACKUP_NAME_TEMPLATE \ - CINDER_BACKUP_DRIVER - -cfg=/etc/cinder/cinder.conf - -# volume backup configuration -crudini --set $cfg \ - DEFAULT \ - backup_driver \ - "${CINDER_BACKUP_DRIVER}" -crudini --set $cfg \ - DEFAULT \ - backup_topic \ - "cinder-backup" -crudini --set $cfg \ - DEFAULT \ - backup_manager \ - "${CINDER_BACKUP_MANAGER}" -crudini --set $cfg \ - DEFAULT \ - backup_api_class \ - "${CINDER_BACKUP_API_CLASS}" -crudini --set $cfg \ - DEFAULT \ - backup_name_template \ - "${CINDER_BACKUP_NAME_TEMPLATE}" - -# https://bugs.launchpad.net/kolla/+bug/1461635 -# Cinder requires mounting /dev in the cinder-volume, nova-compute, -# and libvirt containers. If /dev/pts/ptmx does not have proper permissions -# on the host, then libvirt will fail to boot an instance. -# This is a bug in Docker where it is not correctly mounting /dev/pts -# Tech Debt tracker: https://bugs.launchpad.net/kolla/+bug/1468962 -# **Temporary fix** -chmod 666 /dev/pts/ptmx - -echo "Starting cinder-backup" -exec /usr/bin/cinder-backup --config-file $cfg diff --git a/docker/common/cinder-app/cinder-backup/start.sh b/docker/common/cinder-app/cinder-backup/start.sh index 1cc902db6..748c47d91 100755 --- a/docker/common/cinder-app/cinder-backup/start.sh +++ b/docker/common/cinder-app/cinder-backup/start.sh @@ -8,7 +8,7 @@ ARGS="" # Loading common functions. source /opt/kolla/kolla-common.sh -# Config-internal script exec out of this function, it does not return here. +# Execute config strategy set_configs exec $CMD $ARGS diff --git a/docker/common/cinder-app/cinder-base/config-cinder.sh b/docker/common/cinder-app/cinder-base/config-cinder.sh deleted file mode 100755 index a49b17f07..000000000 --- a/docker/common/cinder-app/cinder-base/config-cinder.sh +++ /dev/null @@ -1,157 +0,0 @@ -#!/bin/sh - -set -e - -. /opt/kolla/kolla-common.sh - -check_required_vars ADMIN_TENANT_NAME \ - CINDER_API_VERSION \ - CINDER_DB_NAME \ - CINDER_DB_PASSWORD \ - CINDER_DB_USER \ - CINDER_KEYSTONE_PASSWORD \ - CINDER_KEYSTONE_USER \ - GLANCE_API_SERVICE_HOST \ - GLANCE_API_SERVICE_PORT \ - KEYSTONE_AUTH_PROTOCOL \ - KEYSTONE_PUBLIC_SERVICE_HOST \ - MARIADB_SERVICE_HOST \ - PUBLIC_IP \ - RABBITMQ_SERVICE_HOST \ - RABBITMQ_SERVICE_HOST \ - RABBITMQ_SERVICE_PORT \ - RABBIT_PASSWORD \ - RABBIT_USERID - -dump_vars - -cat > /openrc <> /etc/tgt/tgtd.conf -echo "include /var/lib/cinder/volumes/*" >> /etc/tgt/targets.conf - -echo "Starging iSCSI tgtd" -/opt/kolla/tgtd.sh - -echo "Starting cinder-volume" -exec /usr/bin/cinder-volume --config-file /etc/cinder/cinder.conf diff --git a/docker/common/cinder-app/cinder-volume/start.sh b/docker/common/cinder-app/cinder-volume/start.sh index f6acf61e0..424fdfa7c 100755 --- a/docker/common/cinder-app/cinder-volume/start.sh +++ b/docker/common/cinder-app/cinder-volume/start.sh @@ -8,7 +8,7 @@ ARGS="" # Loading common functions. source /opt/kolla/kolla-common.sh -# Config-internal script exec out of this function, it does not return here. +# Execute config strategy set_configs exec $CMD $ARGS diff --git a/docker/common/cinder-app/cinder-volume/tgtd.sh b/docker/common/cinder-app/cinder-volume/tgtd.sh deleted file mode 100755 index 33d9461a0..000000000 --- a/docker/common/cinder-app/cinder-volume/tgtd.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -set -e - -DESC="target framework daemon" -DAEMON=/usr/sbin/tgtd - -TGTD_CONFIG=/etc/tgt/targets.conf - -echo "Starting tgtd $DESC" -/usr/sbin/tgtd -echo "Set to offline" -tgtadm --op update --mode sys --name State -v offline -echo "Set tgt config" -tgt-admin -e -c $TGTD_CONFIG -echo "Set to ready" -tgtadm --op update --mode sys --name State -v ready diff --git a/docker/common/cinder-app/cinder-volume/volume-group-create.sh b/docker/common/cinder-app/cinder-volume/volume-group-create.sh deleted file mode 100755 index 338850c84..000000000 --- a/docker/common/cinder-app/cinder-volume/volume-group-create.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -# The script will create the cinder-volume volume group that will -# allow cinder to create volumes from a backing file. -# This is based off devstack. -set -e - -backing_file=/opt/data/cinder_volume - -check_required_vars CINDER_LVM_LO_VOLUME_SIZE CINDER_VOLUME_GROUP - -if ! vgs ${CINDER_VOLUME_GROUP}; then - [[ ! -f $backing_file ]] && truncate -s ${CINDER_LVM_LO_VOLUME_SIZE} $backing_file - vg_dev=`losetup -f --show $backing_file` - if ! vgs ${CINDER_VOLUME_GROUP}; then - vgcreate ${CINDER_VOLUME_GROUP} $vg_dev - fi -fi - -# Remove iscsi targets -cinder-rtstool get-targets | xargs -rn 1 cinder-rtstool delete - -- cgit v1.2.3