diff options
| author | Jenkins <jenkins@review.openstack.org> | 2015-06-19 14:49:10 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2015-06-19 14:49:10 +0000 |
| commit | 04f3223ec78eefb6082fb20c441eef2166e68f8d (patch) | |
| tree | 2a6e1588ffecf5253654a25bf3483eed2f8f95a0 /docker/centos/binary/cinder-app/cinder-api/start.sh | |
| parent | 2c48c8ef47151e3a2b2674b8fccad331e183a435 (diff) | |
| parent | 793d68a29ca0a3724714b27441ddd87ecbe0e44d (diff) | |
| download | kolla-04f3223ec78eefb6082fb20c441eef2166e68f8d.tar.gz kolla-04f3223ec78eefb6082fb20c441eef2166e68f8d.zip | |
Merge "Cinder container"
Diffstat (limited to 'docker/centos/binary/cinder-app/cinder-api/start.sh')
| -rwxr-xr-x | docker/centos/binary/cinder-app/cinder-api/start.sh | 73 |
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 |
