Correctly set nova-cpu.conf and tempest flag

1. Fix bug in setting up open-cas in nova-cpu.conf
2. Move volume_local_cache flag to test-config

Change-Id: Ic0684500ed2d5c278629f93ce836a9f34745dad3
This commit is contained in:
Liang Fang 2020-05-30 15:35:41 +00:00
parent a32d70e5c0
commit 9ffadd7ee6
2 changed files with 14 additions and 4 deletions

View File

@ -0,0 +1 @@
ENABLE_VOLUME_LOCAL_CACHE=$(trueorfalse False ENABLE_VOLUME_LOCAL_CACHE)

View File

@ -81,10 +81,19 @@ if [[ "$1" == "stack" && "$2" == "pre-install" ]]; then
echo_summary "create cache instance"
create_cache_instance
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
# configure open-cas in /path/to/nova-cpu.conf
iniset $NOVA_CPU_CONF compute volume_local_cache_driver opencas
iniset $NOVA_CPU_CONF compute volume_local_cache_instance_ids 1
# Configure open-cas in nova-cpu.conf. Cannot set in below way because
# $NOVA_CPU_CONF will be overwritten in starting Nova phase. Refer to
# devstack/lib/nova, function start_nova_compute()
# iniset $NOVA_CPU_CONF compute volume_local_cache_driver opencas
# iniset $NOVA_CPU_CONF compute volume_local_cache_instance_ids 1
if [[ $ENABLE_VOLUME_LOCAL_CACHE == "True" ]]; then
localconf_set $TOP_DIR/local.conf post-config \$NOVA_CPU_CONF compute volume_local_cache_driver opencas
localconf_set $TOP_DIR/local.conf post-config \$NOVA_CPU_CONF compute volume_local_cache_instance_ids 1
fi
elif [[ "$1" == "stack" && "$2" == "test-config" ]]; then
if [[ $ENABLE_VOLUME_LOCAL_CACHE == "True" ]]; then
iniset $TEMPEST_CONFIG volume-feature-enabled volume_local_cache True
fi
fi
if [[ "$1" == "unstack" ]]; then