TVD: Support TVD devstack with disabled plugins

When using the TVD plugin, sometimes nsx-v or nsx-v3 are not configured.
This patch ensures that the devstack cleanup will clean only the relevant
NSX backend, to avoid errors in the logs.
And also that the devstack configuration will skip unconfigured plugins

Change-Id: I27ad52ea9a4052c0b8f3d1ea4d485fcc44b19f6d
This commit is contained in:
Adit Sarfaty 2018-03-12 14:53:29 +02:00 committed by garyk
parent 8b06741ad7
commit ab6f32c12b
4 changed files with 19 additions and 7 deletions

View File

@ -105,7 +105,11 @@ function nsxv3_configure_service {
elif [[ "$NSX_MANAGER" != "" ]]; then
_nsxv3_ini_set nsx_api_managers $NSX_MANAGER
else
die $LINENO "The VMware NSX plugin needs at least one NSX manager."
if [[ $1 == "nsx_v3" ]]; then
die $LINENO "The VMware NSX plugin needs at least one NSX manager."
else
return
fi
fi
if [[ "$NSX_L2GW_DRIVER" != "" ]]; then
iniset /$Q_PLUGIN_CONF_FILE DEFAULT nsx_l2gw_driver $NSX_L2GW_DRIVER

View File

@ -154,7 +154,7 @@ function neutron_plugin_configure_plugin_agent {
}
function neutron_plugin_configure_service {
nsxv3_configure_service
nsxv3_configure_service nsx_tvd
nsxv_configure_service
dvs_configure_service "$DVS_VMWAREAPI_IP" "$DVS_VMWAREAPI_USER" "$DVS_VMWAREAPI_PASSWORD" "$DVS_VMWAREAPI_CA_FILE" "$DVS_VMWAREAPI_INSECURE" "$VMWARE_DVS_NAME"
iniset /$Q_PLUGIN_CONF_FILE nsx_tvd nsx_v_extension_drivers vmware_nsxv_dns

View File

@ -154,7 +154,7 @@ function neutron_plugin_configure_plugin_agent {
}
function neutron_plugin_configure_service {
nsxv3_configure_service
nsxv3_configure_service nsx_v3
iniset /$Q_PLUGIN_CONF_FILE DEFAULT nsx_extension_drivers vmware_nsxv3_dns
}

View File

@ -84,13 +84,21 @@ elif [[ $Q_PLUGIN == 'vmware_nsx_tvd' ]]; then
IFS=','
NSX_MANAGER=($NSX_MANAGER)
unset IFS
python $dir/tools/nsxv3_cleanup.py --mgr-ip $NSX_MANAGER --user $NSX_USER --password $NSX_PASSWORD --db-connection $db_connection
python $dir/tools/nsxv_cleanup.py --vsm-ip ${NSXV_MANAGER_URI/https:\/\/} --user $NSXV_USER --password $NSXV_PASSWORD --db-connection $db_connection
if [[ "$NSX_MANAGER" != "" ]]; then
python $dir/tools/nsxv3_cleanup.py --mgr-ip $NSX_MANAGER --user $NSX_USER --password $NSX_PASSWORD --db-connection $db_connection
fi
if [[ "$NSXV_MANAGER_URI" != "" ]]; then
python $dir/tools/nsxv_cleanup.py --vsm-ip ${NSXV_MANAGER_URI/https:\/\/} --user $NSXV_USER --password $NSXV_PASSWORD --db-connection $db_connection
fi
fi
elif [[ "$1" == 'clean' ]]; then
if is_service_enabled q-svc || is_service_enabled neutron-api; then
python $dir/tools/nsxv3_cleanup.py --mgr-ip $NSX_MANAGER --user $NSX_USER --password $NSX_PASSWORD
python $dir/tools/nsxv_cleanup.py --vsm-ip ${NSXV_MANAGER_URI/https:\/\/} --user $NSXV_USER --password $NSXV_PASSWORD
if [[ "$NSX_MANAGER" != "" ]]; then
python $dir/tools/nsxv3_cleanup.py --mgr-ip $NSX_MANAGER --user $NSX_USER --password $NSX_PASSWORD
fi
if [[ "$NSXV_MANAGER_URI" != "" ]]; then
python $dir/tools/nsxv_cleanup.py --vsm-ip ${NSXV_MANAGER_URI/https:\/\/} --user $NSXV_USER --password $NSXV_PASSWORD
fi
fi
fi
elif [[ $Q_PLUGIN == 'vmware_dvs' ]]; then