diff --git a/contrib/ci/pre_test_hook.sh b/contrib/ci/pre_test_hook.sh index 8c12857e51..1473e459e3 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 9a31aec262..1359c14e12 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 19cd121214..7641bdaa2f 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