From 8c3c73ada645dbad4bf0f57b3e32ca77e484ddd2 Mon Sep 17 00:00:00 2001 From: vponomaryov Date: Tue, 2 Feb 2016 17:22:19 +0200 Subject: [PATCH] Fix Cinder's NoValidHostFound errors Manila CI jobs create lots of shares and for Generic driver it means lots of Cinder volumes. After merge of [1] to Cinder project, we started having NoValidHostFound errors in Cinder logs, it changed default oversubscription ratio to 1.0 from 20.0. But Manila CI requires it be bigger than 1.0, so set it explicitly to Cinder's default value 20.0 that is used by all other driver but not LVM. [1] I5a214462b573d00d26086512821b4f8cc1db4fc3 Change-Id: If0a6e535b92b1471572e1de98e3b44ab6a2c65c9 Closes-Bug: #1540947 --- contrib/ci/pre_test_hook.sh | 4 ++++ devstack/plugin.sh | 12 ++++++++++++ devstack/settings | 6 ++++++ 3 files changed, 22 insertions(+) diff --git a/contrib/ci/pre_test_hook.sh b/contrib/ci/pre_test_hook.sh index 8c12857e..1473e459 100755 --- a/contrib/ci/pre_test_hook.sh +++ b/contrib/ci/pre_test_hook.sh @@ -27,6 +27,10 @@ echo "TEMPEST_SERVICES+=,manila" >> $localrc_path echo "VOLUME_BACKING_FILE_SIZE=22G" >> $localrc_path echo "CINDER_LVM_TYPE=thin" >> $localrc_path +# NOTE(vponomaryov): Set oversubscription ratio for Cinder LVM driver +# 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=20.0" >> $localrc_path echo "MANILA_BACKEND1_CONFIG_GROUP_NAME=london" >> $localrc_path echo "MANILA_BACKEND2_CONFIG_GROUP_NAME=paris" >> $localrc_path echo "MANILA_SHARE_BACKEND1_NAME=LONDON" >> $localrc_path diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 9a31aec2..1359c14e 100755 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -541,9 +541,21 @@ elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then init_manila echo_summary "Installing extra libraries" install_libraries + + # Neutron config update if is_service_enabled neutron; then iniset $Q_DHCP_CONF_FILE DEFAULT dnsmasq_local_resolv False fi + + # Cinder config update + if [[ -n "$CINDER_OVERSUBSCRIPTION_RATIO" ]]; then + CINDER_CONF=${CINDER_CONF:-/etc/cinder/cinder.conf} + CINDER_ENABLED_BACKENDS=$(iniget $CINDER_CONF DEFAULT enabled_backends) + for BN in ${CINDER_ENABLED_BACKENDS//,/ }; do + iniset $CINDER_CONF $BN lvm_max_over_subscription_ratio $CINDER_OVERSUBSCRIPTION_RATIO + done + iniset $CINDER_CONF DEFAULT max_over_subscription_ratio $CINDER_OVERSUBSCRIPTION_RATIO + fi elif [[ "$1" == "stack" && "$2" == "extra" ]]; then echo_summary "Creating Manila entities for auth service" create_manila_accounts diff --git a/devstack/settings b/devstack/settings index 19cd1212..7641bdaa 100644 --- a/devstack/settings +++ b/devstack/settings @@ -20,6 +20,12 @@ # '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 +# 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: +# CINDER_OVERSUBSCRIPTION_RATIO=20.0 # Defaults