Disable Cinder v1 API support by default

Cinder API v1 will be removed Mitaka so we don't need to setup it be
default.

To enable Cinder API v1 you need to set CINDER_ENABLE_V1_API=True in
your Devstack config.

Related-Bug: #1467589

Depends-On: I6916eb3e4b7c85f37be8b365b11ca8b48f88177c
Change-Id: I0754e357433cfcd9fde7e937a4a1b440580b6289
This commit is contained in:
Ivan Kolodyazhny 2015-06-23 19:09:34 +03:00
parent f86d2e1a05
commit a29434460e
3 changed files with 33 additions and 12 deletions

View File

@ -587,6 +587,13 @@ with ``VOLUME_BACKING_FILE_SIZE``.
VOLUME_BACKING_FILE_SIZE=10250M VOLUME_BACKING_FILE_SIZE=10250M
Cinder v1 API is depricated and disabled by default. You can enable v1 API by
setting ``CINDER_ENABLE_V1_API`` to ``True``.
::
CINDER_ENABLE_V1_API=True
Keystone Keystone
~~~~~~~~ ~~~~~~~~

View File

@ -27,6 +27,9 @@ set +o xtrace
# Defaults # Defaults
# -------- # --------
# NOTE (e0ne): Cinder API v1 is deprecated and will be disabled by default.
CINDER_ENABLE_V1_API=$(trueorfalse False CINDER_ENABLE_V1_API)
# set up default driver # set up default driver
CINDER_DRIVER=${CINDER_DRIVER:-default} CINDER_DRIVER=${CINDER_DRIVER:-default}
CINDER_PLUGINS=$TOP_DIR/lib/cinder_plugins CINDER_PLUGINS=$TOP_DIR/lib/cinder_plugins
@ -225,9 +228,12 @@ function configure_cinder {
iniset $CINDER_CONF oslo_concurrency lock_path $CINDER_STATE_PATH iniset $CINDER_CONF oslo_concurrency lock_path $CINDER_STATE_PATH
iniset $CINDER_CONF DEFAULT periodic_interval $CINDER_PERIODIC_INTERVAL iniset $CINDER_CONF DEFAULT periodic_interval $CINDER_PERIODIC_INTERVAL
# NOTE(thingee): Cinder V1 API is deprecated and defaults to off as of # NOTE(thingee): Cinder V1 API is deprecated and defaults to off as of
# Juno. Keep it enabled so we can continue testing while it's still # Juno.
# supported. if [[ ${CINDER_ENABLE_V1_API} = True ]]; then
iniset $CINDER_CONF DEFAULT enable_v1_api true iniset $CINDER_CONF DEFAULT enable_v1_api true
else
iniset $CINDER_CONF DEFAULT enable_v1_api false
fi
iniset $CINDER_CONF DEFAULT os_region_name "$REGION_NAME" iniset $CINDER_CONF DEFAULT os_region_name "$REGION_NAME"
@ -326,12 +332,13 @@ function create_cinder_accounts {
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
if [[ ${CINDER_ENABLE_V1_API} = True ]]; then
get_or_create_service "cinder" "volume" "Cinder Volume Service" get_or_create_service "cinder" "volume" "Cinder Volume Service"
get_or_create_endpoint "volume" "$REGION_NAME" \ get_or_create_endpoint "volume" "$REGION_NAME" \
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s" \ "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s" \
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s" \ "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s" \
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s" "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s"
fi
get_or_create_service "cinderv2" "volumev2" "Cinder Volume Service V2" get_or_create_service "cinderv2" "volumev2" "Cinder Volume Service V2"
get_or_create_endpoint "volumev2" "$REGION_NAME" \ get_or_create_endpoint "volumev2" "$REGION_NAME" \
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v2/\$(tenant_id)s" \ "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v2/\$(tenant_id)s" \
@ -482,9 +489,7 @@ function create_volume_types {
local be be_name local be be_name
for be in ${CINDER_ENABLED_BACKENDS//,/ }; do for be in ${CINDER_ENABLED_BACKENDS//,/ }; do
be_name=${be##*:} be_name=${be##*:}
# FIXME(jamielennox): Remove --os-volume-api-version pinning when openstack volume type create --os-volume-api-version 2 --property volume_backend_name="${be_name}" ${be_name}
# osc supports volume type create on v2 api. bug #1475060
openstack volume type create --os-volume-api-version 1 --property volume_backend_name="${be_name}" ${be_name}
done done
fi fi
} }

View File

@ -494,6 +494,15 @@ function configure_tempest {
iniset $TEMPEST_CONFIG volume-feature-enabled backup False iniset $TEMPEST_CONFIG volume-feature-enabled backup False
fi fi
# Use only Cinder API v2
if [[ ${CINDER_ENABLE_V1_API} = True ]]; then
iniset $TEMPEST_CONFIG volume-feature-enabled api_v1 True
iniset $TEMPEST_CONFIG volume catalog_type volume
else
iniset $TEMPEST_CONFIG volume-feature-enabled api_v1 False
iniset $TEMPEST_CONFIG volume catalog_type volumev2
fi
# Using ``CINDER_ENABLED_BACKENDS`` # Using ``CINDER_ENABLED_BACKENDS``
if [[ -n "$CINDER_ENABLED_BACKENDS" ]] && [[ $CINDER_ENABLED_BACKENDS =~ .*,.* ]]; then if [[ -n "$CINDER_ENABLED_BACKENDS" ]] && [[ $CINDER_ENABLED_BACKENDS =~ .*,.* ]]; then
iniset $TEMPEST_CONFIG volume-feature-enabled multi_backend "True" iniset $TEMPEST_CONFIG volume-feature-enabled multi_backend "True"