From 0db8564e069927d1b18838d226e60c82e6100bd0 Mon Sep 17 00:00:00 2001 From: Shih-Hao Li Date: Mon, 25 Jul 2016 16:51:19 -0700 Subject: [PATCH] NSX|V3: configure devstack for native DHCP and metadata support Adds a new variable - NATIVE_DHCP_METADATA. If this is set then we validate DHCP_PROFILE_UUID and METADATA_PROXY_UUID. The patch also validates that q-dhcp and q-meta are not running. In addition this also disables the dhcp notifications. Co-Authored-By: Shih-Hao Li Change-Id: I6fd7d5e256f47b868247b45bb7458b291e7352bc --- devstack/lib/vmware_nsx_v3 | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/devstack/lib/vmware_nsx_v3 b/devstack/lib/vmware_nsx_v3 index 7d9acef28c..76853d2d82 100644 --- a/devstack/lib/vmware_nsx_v3 +++ b/devstack/lib/vmware_nsx_v3 @@ -30,6 +30,9 @@ NSX_GATEWAY_NETWORK_INTERFACE=${NSX_GATEWAY_NETWORK_INTERFACE:-} # Override default 'True' in devstack:lib/neutron_plugins/services/l3 Q_USE_PROVIDERNET_FOR_PUBLIC=False +# Native support from platform +NATIVE_DHCP_METADATA=${NATIVE_DHCP_METADATA:-False} +METADATA_PROXY_SHARED_SECRET=${METADATA_PROXY_SHARED_SECRET:-} # Save trace setting NSX_XTRACE=$(set +o | grep xtrace) @@ -134,8 +137,13 @@ function neutron_plugin_configure_service { _nsxv3_ini_set insecure $NSX_INSECURE _nsxv3_ini_set ca_file $NSX_CA_FILE _nsxv3_ini_set default_bridge_cluster $DEFAULT_BRIDGE_CLUSTER_UUID - _nsxv3_ini_set dhcp_profile_uuid $DHCP_PROFILE_UUID - _nsxv3_ini_set metadata_proxy_uuid $METADATA_PROXY_UUID + if [[ "$NATIVE_DHCP_METADATA" == "True" ]]; then + _nsxv3_ini_set native_dhcp_metadata $NATIVE_DHCP_METADATA + _nsxv3_ini_set dhcp_profile_uuid $DHCP_PROFILE_UUID + _nsxv3_ini_set metadata_proxy_uuid $METADATA_PROXY_UUID + iniset $NEUTRON_CONF DEFAULT dhcp_agent_notification False + iniset $NEUTRON_META_CONF DEFAULT metadata_proxy_shared_secret $METADATA_PROXY_SHARED_SECRET + fi } function neutron_plugin_setup_interface_driver { @@ -149,6 +157,17 @@ function neutron_plugin_check_adv_test_requirements { function init_vmware_nsx_v3 { + if [[ "$NATIVE_DHCP_METADATA" == "True" ]]; then + if ! is_set DHCP_PROFILE_UUID; then + die $LINENO "DHCP profile needs to be configured!" + fi + if ! is_set METADATA_PROXY_UUID; then + die $LINENO "Metadata proxy needs to be configured!" + fi + if is_service_enabled q-dhcp q-meta; then + die $LINENO "Native support does not require DHCP and Metadata agents!" + fi + fi if ! is_set NSX_GATEWAY_NETWORK_INTERFACE; then echo "NSX_GATEWAY_NETWORK_INTERFACE not set not configuring routes" return