aboutsummaryrefslogtreecommitdiff
path: root/docker/centos/binary/cinder-app/cinder-api/start.sh
diff options
context:
space:
mode:
authorRyan Hallisey <rhallise@redhat.com>2015-04-14 11:39:38 -0400
committerRyan Hallisey <rhallise@redhat.com>2015-06-18 13:46:49 -0400
commit793d68a29ca0a3724714b27441ddd87ecbe0e44d (patch)
treedbf0dbc7ed6d8ca644430b53aa50f37934d400c7 /docker/centos/binary/cinder-app/cinder-api/start.sh
parent0c5d6575ed7eb86886ae9e7e6ec693616db938d3 (diff)
downloadkolla-793d68a29ca0a3724714b27441ddd87ecbe0e44d.tar.gz
kolla-793d68a29ca0a3724714b27441ddd87ecbe0e44d.zip
Cinder container
Cinder is going to be split up into four containers. - cinder-api - cinder-scheduler - cinder-volume - cinder-backup Co-Authored-By: Daneyon Hansen <danehans@cisco.com> Co-Authored-By: Ian Main <imain@redhat.com> Implements: blueprint cinder-container Closes-bug: #1460136 Change-Id: I688471151ffa54d547b9aa0f2f2e2ea7f68f288d
Diffstat (limited to 'docker/centos/binary/cinder-app/cinder-api/start.sh')
-rwxr-xr-xdocker/centos/binary/cinder-app/cinder-api/start.sh73
1 files changed, 73 insertions, 0 deletions
diff --git a/docker/centos/binary/cinder-app/cinder-api/start.sh b/docker/centos/binary/cinder-app/cinder-api/start.sh
new file mode 100755
index 000000000..28293ac6c
--- /dev/null
+++ b/docker/centos/binary/cinder-app/cinder-api/start.sh
@@ -0,0 +1,73 @@
+#!/bin/bash
+
+set -e
+
+. /opt/kolla/kolla-common.sh
+. /opt/kolla/config-cinder.sh
+
+check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \
+ ADMIN_TENANT_NAME PUBLIC_IP CINDER_API_SERVICE_HOST \
+ KEYSTONE_AUTH_PROTOCOL KEYSTONE_ADMIN_SERVICE_PORT \
+ CINDER_KEYSTONE_USER CINDER_KEYSTONE_PASSWORD \
+ CINDER_API_LOG_FILE CINDER_API_SERVICE_LISTEN \
+ CINDER_API_SERVICE_PORT CINDER_API_SERVICE_LISTEN
+
+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}/v1/\$(tenant_id)s" \
+ -A "http://${CINDER_API_SERVICE_HOST}:${CINDER_API_SERVICE_PORT}/v1/\$(tenant_id)s" \
+ -I "http://${CINDER_API_SERVICE_HOST}:${CINDER_API_SERVICE_PORT}/v1/\$(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 \
+ "true"
+
+crudini --set $cfg \
+ DEFAULT \
+ enable_v2_api \
+ "true"
+
+echo "Starting cinder-api"
+exec /usr/bin/cinder-api --config-file $cfg