From be794fb16813510c20ea62c72663ffb3a80b64e4 Mon Sep 17 00:00:00 2001 From: liviacavalcanti Date: Sun, 18 Oct 2020 12:25:18 -0300 Subject: [PATCH] Remove backend deprecated variables MANILA_MULTI_BACKEND has been deprecated for five years now, we should remove it from our code base. This variable was removed from the settings scripts along with: MANILA_BACKEND1_CONFIG_GROUP_NAME and MANILA_SHARE_BACKEND1_NAME; MANILA_BACKEND2_CONFIG_GROUP_NAME and MANILA_SHARE_BACKEND2_NAME. Because they work in the same context. Instead of them, the already implemented and in use, MANILA_ENABLED_BACKENDS variable was placed to garantee the successful back-end setup. The same replacement was made in the contribution samples scripts. Apart from this, we avoid configuring generic1 and generic2 if another backend/s are selected. Closes-Bug: #1898791 Closes-Bug: #1878477 Change-Id: I67036a65da9255694a00a9c8d56cfdefbdf23c05 --- contrib/ci/pre_test_hook.sh | 11 +---- devstack/plugin.sh | 40 +++++++------------ devstack/settings | 28 +------------ doc/source/admin/container_driver.rst | 3 +- .../contributor/samples/container_local.conf | 4 -- .../contributor/samples/generic_local.conf | 4 -- doc/source/contributor/samples/lvm_local.conf | 4 -- .../contributor/samples/zfsonlinux_local.conf | 4 -- zuul.d/grenade-jobs.yaml | 2 + 9 files changed, 21 insertions(+), 79 deletions(-) diff --git a/contrib/ci/pre_test_hook.sh b/contrib/ci/pre_test_hook.sh index e127b87f9d..c3ca0bac38 100755 --- a/contrib/ci/pre_test_hook.sh +++ b/contrib/ci/pre_test_hook.sh @@ -42,10 +42,7 @@ echo "IDENTITY_API_VERSION=3" >> $localconf # bigger than 1.0, because in CI we do not need such small value. # It will allow us to avoid exceeding real capacity in CI test runs. echo "CINDER_OVERSUBSCRIPTION_RATIO=100.0" >> $localconf -echo "MANILA_BACKEND1_CONFIG_GROUP_NAME=london" >> $localconf -echo "MANILA_BACKEND2_CONFIG_GROUP_NAME=paris" >> $localconf -echo "MANILA_SHARE_BACKEND1_NAME=LONDON" >> $localconf -echo "MANILA_SHARE_BACKEND2_NAME=PARIS" >> $localconf +echo "MANILA_ENABLED_BACKENDS=london,paris" >> $localconf echo "MANILA_INSTALL_TEMPEST_PLUGIN_SYSTEMWIDE=${MANILA_INSTALL_TEMPEST_PLUGIN_SYSTEMWIDE:=True}" >> $localconf @@ -68,12 +65,6 @@ echo "MANILA_OPTGROUP_paris_driver_handles_share_servers=$DHSS" >> $localconf echo "MANILA_USE_SERVICE_INSTANCE_PASSWORD=True" >> $localconf echo "MANILA_USE_DOWNGRADE_MIGRATIONS=True" >> $localconf -if [[ "$BACK_END_TYPE" == "multibackend" ]]; then - echo "MANILA_MULTI_BACKEND=True" >> $localconf -else - echo "MANILA_MULTI_BACKEND=False" >> $localconf -fi - # Set MANILA_ADMIN_NET_RANGE for admin_network and data_service IP echo "MANILA_ADMIN_NET_RANGE=${MANILA_ADMIN_NET_RANGE:=10.2.5.0/24}" >> $localconf echo "MANILA_DATA_NODE_IP=${MANILA_DATA_NODE_IP:=$MANILA_ADMIN_NET_RANGE}" >> $localconf diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 2ad9b9f2ab..e9d36dfd5d 100755 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -81,16 +81,12 @@ function _config_manila_apache_wsgi { " -i $manila_api_apache_conf } -# configure_default_backends - configures default Manila backends with generic driver. -function configure_default_backends { - # Configure two default backends with generic drivers onboard - for group_name in $MANILA_BACKEND1_CONFIG_GROUP_NAME $MANILA_BACKEND2_CONFIG_GROUP_NAME; do +# configure_backends - Configures backends enabled by MANILA_ENABLED_BACKENDS +function configure_backends { + # Configure MANILA_ENABLED_BACKENDS backends + for group_name in $(echo $MANILA_ENABLED_BACKENDS | sed "s/,/ /g"); do iniset $MANILA_CONF $group_name share_driver $SHARE_DRIVER - if [ "$MANILA_BACKEND1_CONFIG_GROUP_NAME" == "$group_name" ]; then - iniset $MANILA_CONF $group_name share_backend_name $MANILA_SHARE_BACKEND1_NAME - else - iniset $MANILA_CONF $group_name share_backend_name $MANILA_SHARE_BACKEND2_NAME - fi + iniset $MANILA_CONF $group_name share_backend_name ${group_name^^} iniset $MANILA_CONF $group_name path_to_public_key $MANILA_PATH_TO_PUBLIC_KEY iniset $MANILA_CONF $group_name path_to_private_key $MANILA_PATH_TO_PRIVATE_KEY iniset $MANILA_CONF $group_name service_image_name $MANILA_SERVICE_IMAGE_NAME @@ -270,17 +266,13 @@ function configure_manila { if is_service_enabled glance; then configure_keystone_authtoken_middleware $MANILA_CONF glance glance fi - # Note: set up config group does not mean that this backend will be enabled. - # To enable it, specify its name explicitly using "enabled_share_backends" opt. - configure_default_backends - default_backends=$MANILA_BACKEND1_CONFIG_GROUP_NAME - if [ "$MANILA_MULTI_BACKEND" = "True" ]; then - default_backends+=,$MANILA_BACKEND2_CONFIG_GROUP_NAME - fi if [ ! $MANILA_ENABLED_BACKENDS ]; then - # If $MANILA_ENABLED_BACKENDS is not set, use configured backends by default - export MANILA_ENABLED_BACKENDS=$default_backends + # MANILA_ENABLED_BACKENDS is a required option + echo -"No configured backends, please set a value to MANILA_ENABLED_BACKENDS" + exit 1 fi + + configure_backends iniset $MANILA_CONF DEFAULT enabled_share_backends $MANILA_ENABLED_BACKENDS if [ ! -f $MANILA_PATH_TO_PRIVATE_KEY ]; then @@ -1008,13 +1000,11 @@ function remove_docker_service_image { function install_libraries { - if [ $(trueorfalse False MANILA_MULTI_BACKEND) == True ]; then - if [ $(trueorfalse True RUN_MANILA_HOST_ASSISTED_MIGRATION_TESTS) == True ]; then - if is_ubuntu; then - install_package nfs-common - else - install_package nfs-utils - fi + if [ $(trueorfalse True RUN_MANILA_HOST_ASSISTED_MIGRATION_TESTS) == True ]; then + if is_ubuntu; then + install_package nfs-common + else + install_package nfs-utils fi fi } diff --git a/devstack/settings b/devstack/settings index 90b6b27a96..ef273c90f2 100644 --- a/devstack/settings +++ b/devstack/settings @@ -14,14 +14,7 @@ # 'MANILA_ENABLED_BACKENDS'. # DEFAULT group is always defined, no need to specify it within 'MANILA_CONFIGURE_GROUPS'. # -# 3) Two default backends are used for compatibility with previous approach. -# They have same configuration except name of backend. Both use generic driver. -# They can be enabled by adding values of following env vars: -# 'MANILA_BACKEND1_CONFIG_GROUP_NAME' and 'MANILA_BACKEND2_CONFIG_GROUP_NAME' -# to the env var 'MANILA_ENABLED_BACKENDS' or will be enabled -# if 'MANILA_ENABLED_BACKENDS' is empty. -# -# 4) 'CINDER_OVERSUBSCRIPTION_RATIO' - manila devstack-plugin env var that is +# 3) 'CINDER_OVERSUBSCRIPTION_RATIO' - manila devstack-plugin env var that is # useful for all share drivers that use Cinder. If it is set, then it will be # applied for two Cinder options: 'max_over_subscription_ratio' and # 'lvm_max_over_subscription_ratio'. Should be float. Example: @@ -92,6 +85,7 @@ fi # Common opts SHARE_NAME_PREFIX=${SHARE_NAME_PREFIX:-share-} MANILA_ENABLED_SHARE_PROTOCOLS=${ENABLED_SHARE_PROTOCOLS:-"NFS,CIFS"} +MANILA_ENABLED_BACKENDS=${MANILA_ENABLED_BACKENDS:-generic1,generic2} MANILA_SCHEDULER_DRIVER=${MANILA_SCHEDULER_DRIVER:-manila.scheduler.filter_scheduler.FilterScheduler} MANILA_SERVICE_SECGROUP="manila-service" @@ -142,24 +136,6 @@ MANILA_SERVICE_VM_FLAVOR_RAM=${MANILA_SERVICE_VM_FLAVOR_RAM:-320} MANILA_SERVICE_VM_FLAVOR_DISK=${MANILA_SERVICE_VM_FLAVOR_DISK:-3} MANILA_SERVICE_VM_FLAVOR_VCPUS=${MANILA_SERVICE_VM_FLAVOR_VCPUS:-1} -# Support for multi backend configuration (default is no support) -MANILA_MULTI_BACKEND=$(trueorfalse False MANILA_MULTI_BACKEND) -DEPRECATED_TEXT="$DEPRECATED_TEXT\n'MANILA_MULTI_BACKEND' is deprecated, - it makes influence only when is set to True and 'MANILA_ENABLED_BACKENDS' is not set. - Use 'MANILA_ENABLED_BACKENDS' instead if you want to use custom setting. - Set there a list of back end names to be enabled.\n - To configure custom back ends use (any opt in any group can be set in this way) following: - MANILA_OPTGROUP_foo_bar=value - where 'foo' is name of config group and 'bar' is name of option.\n" - -# First share backend data, that will be used in any installation -MANILA_BACKEND1_CONFIG_GROUP_NAME=${MANILA_BACKEND1_CONFIG_GROUP_NAME:-generic1} # deprecated -MANILA_SHARE_BACKEND1_NAME=${MANILA_SHARE_BACKEND1_NAME:-GENERIC1} # deprecated - -# Second share backend data, that will be used only with MANILA_MULTI_BACKEND=True -MANILA_BACKEND2_CONFIG_GROUP_NAME=${MANILA_BACKEND2_CONFIG_GROUP_NAME:-generic2} # deprecated -MANILA_SHARE_BACKEND2_NAME=${MANILA_SHARE_BACKEND2_NAME:-GENERIC2} # deprecated - # Enable this option when using a storage backend that is on the same host # as the devstack host, these iptable rules are necessary to allow mounting # shares from the host diff --git a/doc/source/admin/container_driver.rst b/doc/source/admin/container_driver.rst index b253134278..aa16c0189c 100644 --- a/doc/source/admin/container_driver.rst +++ b/doc/source/admin/container_driver.rst @@ -61,8 +61,7 @@ local.conf: .. code-block:: ini enable_plugin manila https://opendev.org/openstack/manila - MANILA_BACKEND1_CONFIG_GROUP_NAME=london - MANILA_SHARE_BACKEND1_NAME=LONDON + MANILA_ENABLED_BACKENDS=london MANILA_OPTGROUP_london_driver_handles_share_servers=True MANILA_OPTGROUP_london_neutron_host_id= SHARE_DRIVER=manila.share.drivers.container.driver.ContainerShareDriver diff --git a/doc/source/contributor/samples/container_local.conf b/doc/source/contributor/samples/container_local.conf index a5ab8e95f7..c51e633c7f 100644 --- a/doc/source/contributor/samples/container_local.conf +++ b/doc/source/contributor/samples/container_local.conf @@ -25,10 +25,6 @@ enable_plugin manila-tempest-plugin https://opendev.org/openstack/manila-tempest MANILA_SERVICE_IMAGE_ENABLED=False SHARE_DRIVER=manila.share.drivers.container.driver.ContainerShareDriver MANILA_ENABLED_BACKENDS=vienna,prague -MANILA_BACKEND1_CONFIG_GROUP_NAME=vienna -MANILA_BACKEND2_CONFIG_GROUP_NAME=prague -MANILA_SHARE_BACKEND1_NAME=VIENNA -MANILA_SHARE_BACKEND2_NAME=PRAGUE MANILA_OPTGROUP_vienna_driver_handles_share_servers=True MANILA_OPTGROUP_prague_driver_handles_share_servers=True MANILA_DEFAULT_SHARE_TYPE_EXTRA_SPECS='snapshot_support=false' diff --git a/doc/source/contributor/samples/generic_local.conf b/doc/source/contributor/samples/generic_local.conf index 0a2cbe9a50..06039d97ba 100644 --- a/doc/source/contributor/samples/generic_local.conf +++ b/doc/source/contributor/samples/generic_local.conf @@ -25,10 +25,6 @@ enable_plugin manila-tempest-plugin https://opendev.org/openstack/manila-tempest # Generic Back end config options SHARE_DRIVER=manila.share.drivers.generic.GenericShareDriver MANILA_ENABLED_BACKENDS=tokyo,shanghai -MANILA_BACKEND1_CONFIG_GROUP_NAME=tokyo -MANILA_BACKEND2_CONFIG_GROUP_NAME=shanghai -MANILA_SHARE_BACKEND1_NAME=TOKYO -MANILA_SHARE_BACKEND2_NAME=SHANGHAI MANILA_OPTGROUP_tokyo_driver_handles_share_servers=True MANILA_OPTGROUP_shanghai_driver_handles_share_servers=True MANILA_OPTGROUP_tokyo_connect_share_server_to_tenant_network=True diff --git a/doc/source/contributor/samples/lvm_local.conf b/doc/source/contributor/samples/lvm_local.conf index 507634010f..354a772ca6 100644 --- a/doc/source/contributor/samples/lvm_local.conf +++ b/doc/source/contributor/samples/lvm_local.conf @@ -25,10 +25,6 @@ enable_plugin manila-tempest-plugin https://opendev.org/openstack/manila-tempest MANILA_SERVICE_IMAGE_ENABLED=False SHARE_DRIVER=manila.share.drivers.lvm.LVMShareDriver MANILA_ENABLED_BACKENDS=chicago,denver -MANILA_BACKEND1_CONFIG_GROUP_NAME=chicago -MANILA_BACKEND2_CONFIG_GROUP_NAME=denver -MANILA_SHARE_BACKEND1_NAME=CHICAGO -MANILA_SHARE_BACKEND2_NAME=DENVER MANILA_OPTGROUP_chicago_driver_handles_share_servers=False MANILA_OPTGROUP_denver_driver_handles_share_servers=False SHARE_BACKING_FILE_SIZE=32000M diff --git a/doc/source/contributor/samples/zfsonlinux_local.conf b/doc/source/contributor/samples/zfsonlinux_local.conf index f7eb80e02d..24a7fb020e 100644 --- a/doc/source/contributor/samples/zfsonlinux_local.conf +++ b/doc/source/contributor/samples/zfsonlinux_local.conf @@ -25,10 +25,6 @@ enable_plugin manila-tempest-plugin https://opendev.org/openstack/manila-tempest MANILA_SERVICE_IMAGE_ENABLED=False SHARE_DRIVER=manila.share.drivers.zfsonlinux.driver.ZFSonLinuxShareDriver MANILA_ENABLED_BACKENDS=bangalore,mumbai -MANILA_BACKEND1_CONFIG_GROUP_NAME=bangalore -MANILA_BACKEND2_CONFIG_GROUP_NAME=mumbai -MANILA_SHARE_BACKEND1_NAME=BANGALORE -MANILA_SHARE_BACKEND2_NAME=MUMBAI MANILA_OPTGROUP_bangalore_driver_handles_share_servers=False MANILA_OPTGROUP_mumbai_driver_handles_share_servers=False MANILA_REPLICA_STATE_UPDATE_INTERVAL=60 diff --git a/zuul.d/grenade-jobs.yaml b/zuul.d/grenade-jobs.yaml index 30af7fd918..90e69f0b86 100644 --- a/zuul.d/grenade-jobs.yaml +++ b/zuul.d/grenade-jobs.yaml @@ -29,6 +29,8 @@ MANILA_CONFIGURE_DEFAULT_TYPES: true SHARE_DRIVER: manila.share.drivers.lvm.LVMShareDriver MANILA_ENABLED_BACKENDS: london,paris + # TODO(vkmc) Grenade uses prior branch for running tests + # Drop this variables in Xena once Wallaby is shipped MANILA_BACKEND1_CONFIG_GROUP_NAME: london MANILA_BACKEND2_CONFIG_GROUP_NAME: paris MANILA_SHARE_BACKEND1_NAME: LONDON