Browse Source

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
tags/liberty-eol
Ivan Kolodyazhny 4 years ago
parent
commit
a29434460e
3 changed files with 33 additions and 12 deletions
  1. 7
    0
      doc/source/configuration.rst
  2. 17
    12
      lib/cinder
  3. 9
    0
      lib/tempest

+ 7
- 0
doc/source/configuration.rst View File

@@ -587,6 +587,13 @@ with ``VOLUME_BACKING_FILE_SIZE``.
587 587
         VOLUME_BACKING_FILE_SIZE=10250M
588 588
 
589 589
 
590
+Cinder v1 API is depricated and disabled by default. You can enable v1 API by
591
+setting ``CINDER_ENABLE_V1_API`` to ``True``.
592
+
593
+    ::
594
+        CINDER_ENABLE_V1_API=True
595
+
596
+
590 597
 Keystone
591 598
 ~~~~~~~~
592 599
 

+ 17
- 12
lib/cinder View File

@@ -27,6 +27,9 @@ set +o xtrace
27 27
 # Defaults
28 28
 # --------
29 29
 
30
+# NOTE (e0ne): Cinder API v1 is deprecated and will be disabled by default.
31
+CINDER_ENABLE_V1_API=$(trueorfalse False CINDER_ENABLE_V1_API)
32
+
30 33
 # set up default driver
31 34
 CINDER_DRIVER=${CINDER_DRIVER:-default}
32 35
 CINDER_PLUGINS=$TOP_DIR/lib/cinder_plugins
@@ -225,9 +228,12 @@ function configure_cinder {
225 228
     iniset $CINDER_CONF oslo_concurrency lock_path $CINDER_STATE_PATH
226 229
     iniset $CINDER_CONF DEFAULT periodic_interval $CINDER_PERIODIC_INTERVAL
227 230
     # NOTE(thingee): Cinder V1 API is deprecated and defaults to off as of
228
-    # Juno. Keep it enabled so we can continue testing while it's still
229
-    # supported.
230
-    iniset $CINDER_CONF DEFAULT enable_v1_api true
231
+    # Juno.
232
+    if [[ ${CINDER_ENABLE_V1_API} = True ]]; then
233
+        iniset $CINDER_CONF DEFAULT enable_v1_api true
234
+    else
235
+        iniset $CINDER_CONF DEFAULT enable_v1_api false
236
+    fi
231 237
 
232 238
     iniset $CINDER_CONF DEFAULT os_region_name "$REGION_NAME"
233 239
 
@@ -326,12 +332,13 @@ function create_cinder_accounts {
326 332
 
327 333
         if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
328 334
 
329
-            get_or_create_service "cinder" "volume" "Cinder Volume Service"
330
-            get_or_create_endpoint "volume" "$REGION_NAME" \
331
-                "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s" \
332
-                "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s" \
333
-                "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s"
334
-
335
+            if [[ ${CINDER_ENABLE_V1_API} = True ]]; then
336
+                get_or_create_service "cinder" "volume" "Cinder Volume Service"
337
+                get_or_create_endpoint "volume" "$REGION_NAME" \
338
+                    "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s" \
339
+                    "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s" \
340
+                    "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s"
341
+            fi
335 342
             get_or_create_service "cinderv2" "volumev2" "Cinder Volume Service V2"
336 343
             get_or_create_endpoint "volumev2" "$REGION_NAME" \
337 344
                 "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v2/\$(tenant_id)s" \
@@ -482,9 +489,7 @@ function create_volume_types {
482 489
         local be be_name
483 490
         for be in ${CINDER_ENABLED_BACKENDS//,/ }; do
484 491
             be_name=${be##*:}
485
-            # FIXME(jamielennox): Remove --os-volume-api-version pinning when
486
-            # osc supports volume type create on v2 api. bug #1475060
487
-            openstack volume type create --os-volume-api-version 1 --property volume_backend_name="${be_name}" ${be_name}
492
+            openstack volume type create --os-volume-api-version 2 --property volume_backend_name="${be_name}" ${be_name}
488 493
         done
489 494
     fi
490 495
 }

+ 9
- 0
lib/tempest View File

@@ -494,6 +494,15 @@ function configure_tempest {
494 494
         iniset $TEMPEST_CONFIG volume-feature-enabled backup False
495 495
     fi
496 496
 
497
+    # Use only Cinder API v2
498
+    if [[ ${CINDER_ENABLE_V1_API} = True ]]; then
499
+        iniset $TEMPEST_CONFIG volume-feature-enabled api_v1 True
500
+        iniset $TEMPEST_CONFIG volume catalog_type volume
501
+    else
502
+        iniset $TEMPEST_CONFIG volume-feature-enabled api_v1 False
503
+        iniset $TEMPEST_CONFIG volume catalog_type volumev2
504
+    fi
505
+
497 506
     # Using ``CINDER_ENABLED_BACKENDS``
498 507
     if [[ -n "$CINDER_ENABLED_BACKENDS" ]] && [[ $CINDER_ENABLED_BACKENDS =~ .*,.* ]]; then
499 508
         iniset $TEMPEST_CONFIG volume-feature-enabled multi_backend "True"

Loading…
Cancel
Save