From a29434460e869b7bb397044d8f073531e4ee112d Mon Sep 17 00:00:00 2001 From: Ivan Kolodyazhny Date: Tue, 23 Jun 2015 19:09:34 +0300 Subject: [PATCH] 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 --- doc/source/configuration.rst | 7 +++++++ lib/cinder | 29 +++++++++++++++++------------ lib/tempest | 9 +++++++++ 3 files changed, 33 insertions(+), 12 deletions(-) diff --git a/doc/source/configuration.rst b/doc/source/configuration.rst index 983f5c0aae..3bd246d870 100644 --- a/doc/source/configuration.rst +++ b/doc/source/configuration.rst @@ -587,6 +587,13 @@ with ``VOLUME_BACKING_FILE_SIZE``. 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 ~~~~~~~~ diff --git a/lib/cinder b/lib/cinder index 26277ccaba..f0b0f1d7e5 100644 --- a/lib/cinder +++ b/lib/cinder @@ -27,6 +27,9 @@ set +o xtrace # 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 CINDER_DRIVER=${CINDER_DRIVER:-default} 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 DEFAULT periodic_interval $CINDER_PERIODIC_INTERVAL # 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 - # supported. - iniset $CINDER_CONF DEFAULT enable_v1_api true + # Juno. + if [[ ${CINDER_ENABLE_V1_API} = True ]]; then + 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" @@ -326,12 +332,13 @@ function create_cinder_accounts { if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then - get_or_create_service "cinder" "volume" "Cinder Volume Service" - 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" - + if [[ ${CINDER_ENABLE_V1_API} = True ]]; then + get_or_create_service "cinder" "volume" "Cinder Volume Service" + 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" + fi get_or_create_service "cinderv2" "volumev2" "Cinder Volume Service V2" get_or_create_endpoint "volumev2" "$REGION_NAME" \ "$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 for be in ${CINDER_ENABLED_BACKENDS//,/ }; do be_name=${be##*:} - # FIXME(jamielennox): Remove --os-volume-api-version pinning when - # 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} + openstack volume type create --os-volume-api-version 2 --property volume_backend_name="${be_name}" ${be_name} done fi } diff --git a/lib/tempest b/lib/tempest index d372e0f6ca..3624b9605e 100644 --- a/lib/tempest +++ b/lib/tempest @@ -494,6 +494,15 @@ function configure_tempest { iniset $TEMPEST_CONFIG volume-feature-enabled backup False 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`` if [[ -n "$CINDER_ENABLED_BACKENDS" ]] && [[ $CINDER_ENABLED_BACKENDS =~ .*,.* ]]; then iniset $TEMPEST_CONFIG volume-feature-enabled multi_backend "True"