From 22d25e834d7e40febbcfca77d32e669adf69db28 Mon Sep 17 00:00:00 2001 From: Goutham Pacha Ravi Date: Thu, 10 Jan 2019 23:05:01 -0800 Subject: [PATCH] Configure per backend availability zones in devstack Every enabled backend gets assigned to its own AZ. Test cases in manila-tempest-plugin already exercise creating shares (and replicas) across AZs when multiple AZs are available. This is done for all back-end drivers that are not the Generic driver. Configuring backend AZ for each Generic driver based back end will require configuring Nova and Cinder in a similar fashion. Partially-implements: bp per-backend-availability-zones Depends-On: https://review.openstack.org/#/c/630886/ Depends-On: https://review.openstack.org/#/c/629958/ Change-Id: I1b6ff535a22f10e70d379377767c8ffac3ef5286 --- contrib/ci/post_test_hook.sh | 4 ++++ devstack/plugin.sh | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/contrib/ci/post_test_hook.sh b/contrib/ci/post_test_hook.sh index dfe5437de8..873efed6bf 100755 --- a/contrib/ci/post_test_hook.sh +++ b/contrib/ci/post_test_hook.sh @@ -374,6 +374,10 @@ if ! [[ -z "$OVERRIDE_IP_FOR_NFS_ACCESS" ]]; then iniset $TEMPEST_CONFIG share override_ip_for_nfs_access $OVERRIDE_IP_FOR_NFS_ACCESS fi +echo "Manila service details" +source $BASE/new/devstack/openrc admin admin +manila service-list + echo "Running tempest manila test suites" cd $BASE/new/tempest/ # List plugins in logs to enable debugging diff --git a/devstack/plugin.sh b/devstack/plugin.sh index c9117a3885..3f1e04a958 100755 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -144,6 +144,23 @@ function set_cinder_quotas { fi } +function set_backend_availability_zones { + ENABLED_BACKENDS=$1 + echo_summary "Setting up backend_availability_zone option \ + for any enabled backends that do not use the Generic driver. \ + Availability zones for the Generic driver must coincide with those \ + created for Nova and Cinder." + local zonenum + generic_driver='manila.share.drivers.generic.GenericShareDriver' + for BE in ${ENABLED_BACKENDS//,/ }; do + share_driver=$(iniget $MANILA_CONF $BE share_driver) + if [[ $share_driver != $generic_driver ]]; then + zone="manila-zone-$((zonenum++))" + iniset $MANILA_CONF $BE backend_availability_zone $zone + fi + done +} + # configure_manila - Set config files, create data dirs, etc function configure_manila { if [[ ! -d $MANILA_CONF_DIR ]]; then @@ -272,6 +289,7 @@ function configure_manila { MANILA_CONFIGURE_GROUPS=${MANILA_CONFIGURE_GROUPS:-"$MANILA_ENABLED_BACKENDS"} set_config_opts $MANILA_CONFIGURE_GROUPS set_config_opts DEFAULT + set_backend_availability_zones $MANILA_ENABLED_BACKENDS if [ $(trueorfalse False MANILA_USE_MOD_WSGI) == True ]; then _config_manila_apache_wsgi