From 05952e3fcc6bdd9ccd1c7980e6a73c527711c08c Mon Sep 17 00:00:00 2001 From: armando-migliaccio Date: Sun, 5 Jan 2014 07:59:06 -0800 Subject: [PATCH] Configuration changes required to support VMware NSX plugin (Formerly known as Nicira NVP plugin). Following Neutron change 79fbeb7ebebc0dfbe143aee96fbc250d1b9e7582, this patch introduces the new naming scheme for Neutron VMware NSX plugin configuration. Related-blueprint: nvp-third-part-support (aka bp vmware-nsx-third-party) Partial-implements blueprint: nicira-plugin-renaming Change-Id: If7790887661507bfdec6d2b97c0f99609039aa73 --- exercises/neutron-adv-test.sh | 4 +- lib/neutron_plugins/{nicira => vmware_nsx} | 77 ++++++++++--------- lib/neutron_thirdparty/{nicira => vmware_nsx} | 62 +++++++-------- 3 files changed, 72 insertions(+), 71 deletions(-) rename lib/neutron_plugins/{nicira => vmware_nsx} (59%) rename lib/neutron_thirdparty/{nicira => vmware_nsx} (50%) diff --git a/exercises/neutron-adv-test.sh b/exercises/neutron-adv-test.sh index 0a100c0fe8..0c0d42f458 100755 --- a/exercises/neutron-adv-test.sh +++ b/exercises/neutron-adv-test.sh @@ -400,10 +400,10 @@ main() { echo Description echo echo Copyright 2012, Cisco Systems - echo Copyright 2012, Nicira Networks, Inc. + echo Copyright 2012, VMware, Inc. echo Copyright 2012, NTT MCL, Inc. echo - echo Please direct any questions to dedutta@cisco.com, dan@nicira.com, nachi@nttmcl.com + echo Please direct any questions to dedutta@cisco.com, dwendlandt@vmware.com, nachi@nttmcl.com echo diff --git a/lib/neutron_plugins/nicira b/lib/neutron_plugins/vmware_nsx similarity index 59% rename from lib/neutron_plugins/nicira rename to lib/neutron_plugins/vmware_nsx index 87d3c3d17b..d506cb6f8d 100644 --- a/lib/neutron_plugins/nicira +++ b/lib/neutron_plugins/vmware_nsx @@ -1,5 +1,5 @@ -# Neutron Nicira NVP plugin -# --------------------------- +# Neutron VMware NSX plugin +# ------------------------- # Save trace setting MY_XTRACE=$(set +o | grep xtrace) @@ -9,10 +9,10 @@ source $TOP_DIR/lib/neutron_plugins/ovs_base function setup_integration_bridge() { _neutron_ovs_base_setup_bridge $OVS_BRIDGE - # Set manager to NVP controller (1st of list) - if [[ "$NVP_CONTROLLERS" != "" ]]; then + # Set manager to NSX controller (1st of list) + if [[ "$NSX_CONTROLLERS" != "" ]]; then # Get the first controller - controllers=(${NVP_CONTROLLERS//,/ }) + controllers=(${NSX_CONTROLLERS//,/ }) OVS_MGR_IP=${controllers[0]} else die $LINENO "Error - No controller specified. Unable to set a manager for OVS" @@ -21,7 +21,7 @@ function setup_integration_bridge() { } function is_neutron_ovs_base_plugin() { - # NVP uses OVS, but not the l3-agent + # NSX uses OVS, but not the l3-agent return 0 } @@ -33,14 +33,15 @@ function neutron_plugin_create_nova_conf() { } function neutron_plugin_install_agent_packages() { - # Nicira Plugin does not run q-agt, but it currently needs dhcp and metadata agents + # VMware NSX Plugin does not run q-agt, but it currently needs dhcp and metadata agents _neutron_ovs_base_install_agent_packages } function neutron_plugin_configure_common() { - Q_PLUGIN_CONF_PATH=etc/neutron/plugins/nicira - Q_PLUGIN_CONF_FILENAME=nvp.ini - Q_DB_NAME="neutron_nvp" + Q_PLUGIN_CONF_PATH=etc/neutron/plugins/vmware + Q_PLUGIN_CONF_FILENAME=nsx.ini + Q_DB_NAME="neutron_nsx" + # TODO(armando-migliaccio): rename this once the code rename is complete Q_PLUGIN_CLASS="neutron.plugins.nicira.NeutronPlugin.NvpPluginV2" } @@ -57,76 +58,76 @@ function neutron_plugin_configure_dhcp_agent() { } function neutron_plugin_configure_l3_agent() { - # Nicira plugin does not run L3 agent - die $LINENO "q-l3 should must not be executed with Nicira plugin!" + # VMware NSX plugin does not run L3 agent + die $LINENO "q-l3 should must not be executed with VMware NSX plugin!" } function neutron_plugin_configure_plugin_agent() { - # Nicira plugin does not run L2 agent - die $LINENO "q-agt must not be executed with Nicira plugin!" + # VMware NSX plugin does not run L2 agent + die $LINENO "q-agt must not be executed with VMware NSX plugin!" } function neutron_plugin_configure_service() { if [[ "$MAX_LP_PER_BRIDGED_LS" != "" ]]; then - iniset /$Q_PLUGIN_CONF_FILE nvp max_lp_per_bridged_ls $MAX_LP_PER_BRIDGED_LS + iniset /$Q_PLUGIN_CONF_FILE nsx max_lp_per_bridged_ls $MAX_LP_PER_BRIDGED_LS fi if [[ "$MAX_LP_PER_OVERLAY_LS" != "" ]]; then - iniset /$Q_PLUGIN_CONF_FILE nvp max_lp_per_overlay_ls $MAX_LP_PER_OVERLAY_LS + iniset /$Q_PLUGIN_CONF_FILE nsx max_lp_per_overlay_ls $MAX_LP_PER_OVERLAY_LS fi if [[ "$FAILOVER_TIME" != "" ]]; then - iniset /$Q_PLUGIN_CONF_FILE nvp failover_time $FAILOVER_TIME + iniset /$Q_PLUGIN_CONF_FILE nsx failover_time $FAILOVER_TIME fi if [[ "$CONCURRENT_CONNECTIONS" != "" ]]; then - iniset /$Q_PLUGIN_CONF_FILE nvp concurrent_connections $CONCURRENT_CONNECTIONS + iniset /$Q_PLUGIN_CONF_FILE nsx concurrent_connections $CONCURRENT_CONNECTIONS fi if [[ "$DEFAULT_TZ_UUID" != "" ]]; then iniset /$Q_PLUGIN_CONF_FILE DEFAULT default_tz_uuid $DEFAULT_TZ_UUID else - die $LINENO "The nicira plugin won't work without a default transport zone." + die $LINENO "The VMware NSX plugin won't work without a default transport zone." fi if [[ "$DEFAULT_L3_GW_SVC_UUID" != "" ]]; then iniset /$Q_PLUGIN_CONF_FILE DEFAULT default_l3_gw_service_uuid $DEFAULT_L3_GW_SVC_UUID Q_L3_ENABLED=True Q_L3_ROUTER_PER_TENANT=True - iniset /$Q_PLUGIN_CONF_FILE nvp metadata_mode access_network + iniset /$Q_PLUGIN_CONF_FILE nsx metadata_mode access_network fi if [[ "$DEFAULT_L2_GW_SVC_UUID" != "" ]]; then iniset /$Q_PLUGIN_CONF_FILE DEFAULT default_l2_gw_service_uuid $DEFAULT_L2_GW_SVC_UUID fi - # NVP_CONTROLLERS must be a comma separated string - if [[ "$NVP_CONTROLLERS" != "" ]]; then - iniset /$Q_PLUGIN_CONF_FILE DEFAULT nvp_controllers $NVP_CONTROLLERS + # NSX_CONTROLLERS must be a comma separated string + if [[ "$NSX_CONTROLLERS" != "" ]]; then + iniset /$Q_PLUGIN_CONF_FILE DEFAULT nsx_controllers $NSX_CONTROLLERS else - die $LINENO "The nicira plugin needs at least an NVP controller." + die $LINENO "The VMware NSX plugin needs at least an NSX controller." fi - if [[ "$NVP_USER" != "" ]]; then - iniset /$Q_PLUGIN_CONF_FILE DEFAULT nvp_user $NVP_USER + if [[ "$NSX_USER" != "" ]]; then + iniset /$Q_PLUGIN_CONF_FILE DEFAULT nsx_user $NSX_USER fi - if [[ "$NVP_PASSWORD" != "" ]]; then - iniset /$Q_PLUGIN_CONF_FILE DEFAULT nvp_password $NVP_PASSWORD + if [[ "$NSX_PASSWORD" != "" ]]; then + iniset /$Q_PLUGIN_CONF_FILE DEFAULT nsx_password $NSX_PASSWORD fi - if [[ "$NVP_REQ_TIMEOUT" != "" ]]; then - iniset /$Q_PLUGIN_CONF_FILE DEFAULT req_timeout $NVP_REQ_TIMEOUT + if [[ "$NSX_REQ_TIMEOUT" != "" ]]; then + iniset /$Q_PLUGIN_CONF_FILE DEFAULT req_timeout $NSX_REQ_TIMEOUT fi - if [[ "$NVP_HTTP_TIMEOUT" != "" ]]; then - iniset /$Q_PLUGIN_CONF_FILE DEFAULT http_timeout $NVP_HTTP_TIMEOUT + if [[ "$NSX_HTTP_TIMEOUT" != "" ]]; then + iniset /$Q_PLUGIN_CONF_FILE DEFAULT http_timeout $NSX_HTTP_TIMEOUT fi - if [[ "$NVP_RETRIES" != "" ]]; then - iniset /$Q_PLUGIN_CONF_FILE DEFAULT retries $NVP_RETRIES + if [[ "$NSX_RETRIES" != "" ]]; then + iniset /$Q_PLUGIN_CONF_FILE DEFAULT retries $NSX_RETRIES fi - if [[ "$NVP_REDIRECTS" != "" ]]; then - iniset /$Q_PLUGIN_CONF_FILE DEFAULT redirects $NVP_REDIRECTS + if [[ "$NSX_REDIRECTS" != "" ]]; then + iniset /$Q_PLUGIN_CONF_FILE DEFAULT redirects $NSX_REDIRECTS fi if [[ "$AGENT_MODE" != "" ]]; then - iniset /$Q_PLUGIN_CONF_FILE nvp agent_mode $AGENT_MODE + iniset /$Q_PLUGIN_CONF_FILE nsx agent_mode $AGENT_MODE if [[ "$AGENT_MODE" == "agentless" ]]; then if [[ "$DEFAULT_SERVICE_CLUSTER_UUID" != "" ]]; then iniset /$Q_PLUGIN_CONF_FILE DEFAULT default_service_cluster_uuid $DEFAULT_SERVICE_CLUSTER_UUID else die $LINENO "Agentless mode requires a service cluster." fi - iniset /$Q_PLUGIN_CONF_FILE nvp_metadata metadata_server_address $Q_META_DATA_IP + iniset /$Q_PLUGIN_CONF_FILE nsx_metadata metadata_server_address $Q_META_DATA_IP fi fi } diff --git a/lib/neutron_thirdparty/nicira b/lib/neutron_thirdparty/vmware_nsx similarity index 50% rename from lib/neutron_thirdparty/nicira rename to lib/neutron_thirdparty/vmware_nsx index a24392cd4d..70d348274f 100644 --- a/lib/neutron_thirdparty/nicira +++ b/lib/neutron_thirdparty/vmware_nsx @@ -1,14 +1,14 @@ -# Nicira NVP +# VMware NSX # ---------- # This third-party addition can be used to configure connectivity between a DevStack instance -# and an NVP Gateway in dev/test environments. In order to use this correctly, the following +# and an NSX Gateway in dev/test environments. In order to use this correctly, the following # env variables need to be set (e.g. in your localrc file): # -# * enable_service nicira --> to execute this third-party addition +# * enable_service vmware_nsx --> to execute this third-party addition # * PUBLIC_BRIDGE --> bridge used for external connectivity, typically br-ex -# * NVP_GATEWAY_NETWORK_INTERFACE --> interface used to communicate with the NVP Gateway -# * NVP_GATEWAY_NETWORK_CIDR --> CIDR to configure br-ex, e.g. 172.24.4.211/24 +# * NSX_GATEWAY_NETWORK_INTERFACE --> interface used to communicate with the NSX Gateway +# * NSX_GATEWAY_NETWORK_CIDR --> CIDR to configure br-ex, e.g. 172.24.4.211/24 # Save trace setting MY_XTRACE=$(set +o | grep xtrace) @@ -17,64 +17,64 @@ set +o xtrace # This is the interface that connects the Devstack instance # to an network that allows it to talk to the gateway for # testing purposes -NVP_GATEWAY_NETWORK_INTERFACE=${NVP_GATEWAY_NETWORK_INTERFACE:-eth2} -# Re-declare floating range as it's needed also in stop_nicira, which +NSX_GATEWAY_NETWORK_INTERFACE=${NSX_GATEWAY_NETWORK_INTERFACE:-eth2} +# Re-declare floating range as it's needed also in stop_vmware_nsx, which # is invoked by unstack.sh FLOATING_RANGE=${FLOATING_RANGE:-172.24.4.0/24} -function configure_nicira() { +function configure_vmware_nsx() { : } -function init_nicira() { - if ! is_set NVP_GATEWAY_NETWORK_CIDR; then - NVP_GATEWAY_NETWORK_CIDR=$PUBLIC_NETWORK_GATEWAY/${FLOATING_RANGE#*/} +function init_vmware_nsx() { + if ! is_set NSX_GATEWAY_NETWORK_CIDR; then + NSX_GATEWAY_NETWORK_CIDR=$PUBLIC_NETWORK_GATEWAY/${FLOATING_RANGE#*/} echo "The IP address to set on br-ex was not specified. " - echo "Defaulting to "$NVP_GATEWAY_NETWORK_CIDR + echo "Defaulting to "$NSX_GATEWAY_NETWORK_CIDR fi # Make sure the interface is up, but not configured - sudo ip link set $NVP_GATEWAY_NETWORK_INTERFACE up + sudo ip link set $NSX_GATEWAY_NETWORK_INTERFACE up # Save and then flush the IP addresses on the interface - addresses=$(ip addr show dev $NVP_GATEWAY_NETWORK_INTERFACE | grep inet | awk {'print $2'}) - sudo ip addr flush $NVP_GATEWAY_NETWORK_INTERFACE - # Use the PUBLIC Bridge to route traffic to the NVP gateway + addresses=$(ip addr show dev $NSX_GATEWAY_NETWORK_INTERFACE | grep inet | awk {'print $2'}) + sudo ip addr flush $NSX_GATEWAY_NETWORK_INTERFACE + # Use the PUBLIC Bridge to route traffic to the NSX gateway # NOTE(armando-migliaccio): if running in a nested environment this will work # only with mac learning enabled, portsecurity and security profiles disabled - # The public bridge might not exist for the NVP plugin if Q_USE_DEBUG_COMMAND is off + # The public bridge might not exist for the NSX plugin if Q_USE_DEBUG_COMMAND is off # Try to create it anyway sudo ovs-vsctl --no-wait -- --may-exist add-br $PUBLIC_BRIDGE - sudo ovs-vsctl -- --may-exist add-port $PUBLIC_BRIDGE $NVP_GATEWAY_NETWORK_INTERFACE - nvp_gw_net_if_mac=$(ip link show $NVP_GATEWAY_NETWORK_INTERFACE | awk '/ether/ {print $2}') - sudo ip link set address $nvp_gw_net_if_mac dev $PUBLIC_BRIDGE + sudo ovs-vsctl -- --may-exist add-port $PUBLIC_BRIDGE $NSX_GATEWAY_NETWORK_INTERFACE + nsx_gw_net_if_mac=$(ip link show $NSX_GATEWAY_NETWORK_INTERFACE | awk '/ether/ {print $2}') + sudo ip link set address $nsx_gw_net_if_mac dev $PUBLIC_BRIDGE for address in $addresses; do sudo ip addr add dev $PUBLIC_BRIDGE $address done - sudo ip addr add dev $PUBLIC_BRIDGE $NVP_GATEWAY_NETWORK_CIDR + sudo ip addr add dev $PUBLIC_BRIDGE $NSX_GATEWAY_NETWORK_CIDR } -function install_nicira() { +function install_vmware_nsx() { : } -function start_nicira() { +function start_vmware_nsx() { : } -function stop_nicira() { - if ! is_set NVP_GATEWAY_NETWORK_CIDR; then - NVP_GATEWAY_NETWORK_CIDR=$PUBLIC_NETWORK_GATEWAY/${FLOATING_RANGE#*/} +function stop_vmware_nsx() { + if ! is_set NSX_GATEWAY_NETWORK_CIDR; then + NSX_GATEWAY_NETWORK_CIDR=$PUBLIC_NETWORK_GATEWAY/${FLOATING_RANGE#*/} echo "The IP address expected on br-ex was not specified. " - echo "Defaulting to "$NVP_GATEWAY_NETWORK_CIDR + echo "Defaulting to "$NSX_GATEWAY_NETWORK_CIDR fi - sudo ip addr del $NVP_GATEWAY_NETWORK_CIDR dev $PUBLIC_BRIDGE + sudo ip addr del $NSX_GATEWAY_NETWORK_CIDR dev $PUBLIC_BRIDGE # Save and then flush remaining addresses on the interface addresses=$(ip addr show dev $PUBLIC_BRIDGE | grep inet | awk {'print $2'}) sudo ip addr flush $PUBLIC_BRIDGE # Try to detach physical interface from PUBLIC_BRIDGE - sudo ovs-vsctl del-port $NVP_GATEWAY_NETWORK_INTERFACE - # Restore addresses on NVP_GATEWAY_NETWORK_INTERFACE + sudo ovs-vsctl del-port $NSX_GATEWAY_NETWORK_INTERFACE + # Restore addresses on NSX_GATEWAY_NETWORK_INTERFACE for address in $addresses; do - sudo ip addr add dev $NVP_GATEWAY_NETWORK_INTERFACE $address + sudo ip addr add dev $NSX_GATEWAY_NETWORK_INTERFACE $address done }