(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
| ... | ... |
@@ -400,10 +400,10 @@ main() {
|
| 400 | 400 |
echo Description |
| 401 | 401 |
echo |
| 402 | 402 |
echo Copyright 2012, Cisco Systems |
| 403 |
- echo Copyright 2012, Nicira Networks, Inc. |
|
| 403 |
+ echo Copyright 2012, VMware, Inc. |
|
| 404 | 404 |
echo Copyright 2012, NTT MCL, Inc. |
| 405 | 405 |
echo |
| 406 |
- echo Please direct any questions to dedutta@cisco.com, dan@nicira.com, nachi@nttmcl.com |
|
| 406 |
+ echo Please direct any questions to dedutta@cisco.com, dwendlandt@vmware.com, nachi@nttmcl.com |
|
| 407 | 407 |
echo |
| 408 | 408 |
|
| 409 | 409 |
|
| 410 | 410 |
deleted file mode 100644 |
| ... | ... |
@@ -1,149 +0,0 @@ |
| 1 |
-# Neutron Nicira NVP plugin |
|
| 2 |
-# --------------------------- |
|
| 3 |
- |
|
| 4 |
-# Save trace setting |
|
| 5 |
-MY_XTRACE=$(set +o | grep xtrace) |
|
| 6 |
-set +o xtrace |
|
| 7 |
- |
|
| 8 |
-source $TOP_DIR/lib/neutron_plugins/ovs_base |
|
| 9 |
- |
|
| 10 |
-function setup_integration_bridge() {
|
|
| 11 |
- _neutron_ovs_base_setup_bridge $OVS_BRIDGE |
|
| 12 |
- # Set manager to NVP controller (1st of list) |
|
| 13 |
- if [[ "$NVP_CONTROLLERS" != "" ]]; then |
|
| 14 |
- # Get the first controller |
|
| 15 |
- controllers=(${NVP_CONTROLLERS//,/ })
|
|
| 16 |
- OVS_MGR_IP=${controllers[0]}
|
|
| 17 |
- else |
|
| 18 |
- die $LINENO "Error - No controller specified. Unable to set a manager for OVS" |
|
| 19 |
- fi |
|
| 20 |
- sudo ovs-vsctl set-manager ssl:$OVS_MGR_IP |
|
| 21 |
-} |
|
| 22 |
- |
|
| 23 |
-function is_neutron_ovs_base_plugin() {
|
|
| 24 |
- # NVP uses OVS, but not the l3-agent |
|
| 25 |
- return 0 |
|
| 26 |
-} |
|
| 27 |
- |
|
| 28 |
-function neutron_plugin_create_nova_conf() {
|
|
| 29 |
- # if n-cpu is enabled, then setup integration bridge |
|
| 30 |
- if is_service_enabled n-cpu; then |
|
| 31 |
- setup_integration_bridge |
|
| 32 |
- fi |
|
| 33 |
-} |
|
| 34 |
- |
|
| 35 |
-function neutron_plugin_install_agent_packages() {
|
|
| 36 |
- # Nicira Plugin does not run q-agt, but it currently needs dhcp and metadata agents |
|
| 37 |
- _neutron_ovs_base_install_agent_packages |
|
| 38 |
-} |
|
| 39 |
- |
|
| 40 |
-function neutron_plugin_configure_common() {
|
|
| 41 |
- Q_PLUGIN_CONF_PATH=etc/neutron/plugins/nicira |
|
| 42 |
- Q_PLUGIN_CONF_FILENAME=nvp.ini |
|
| 43 |
- Q_DB_NAME="neutron_nvp" |
|
| 44 |
- Q_PLUGIN_CLASS="neutron.plugins.nicira.NeutronPlugin.NvpPluginV2" |
|
| 45 |
-} |
|
| 46 |
- |
|
| 47 |
-function neutron_plugin_configure_debug_command() {
|
|
| 48 |
- sudo ovs-vsctl --no-wait -- --may-exist add-br $PUBLIC_BRIDGE |
|
| 49 |
- iniset $NEUTRON_TEST_CONFIG_FILE DEFAULT external_network_bridge "$PUBLIC_BRIDGE" |
|
| 50 |
-} |
|
| 51 |
- |
|
| 52 |
-function neutron_plugin_configure_dhcp_agent() {
|
|
| 53 |
- setup_integration_bridge |
|
| 54 |
- iniset $Q_DHCP_CONF_FILE DEFAULT enable_isolated_metadata True |
|
| 55 |
- iniset $Q_DHCP_CONF_FILE DEFAULT enable_metadata_network True |
|
| 56 |
- iniset $Q_DHCP_CONF_FILE DEFAULT ovs_use_veth True |
|
| 57 |
-} |
|
| 58 |
- |
|
| 59 |
-function neutron_plugin_configure_l3_agent() {
|
|
| 60 |
- # Nicira plugin does not run L3 agent |
|
| 61 |
- die $LINENO "q-l3 should must not be executed with Nicira plugin!" |
|
| 62 |
-} |
|
| 63 |
- |
|
| 64 |
-function neutron_plugin_configure_plugin_agent() {
|
|
| 65 |
- # Nicira plugin does not run L2 agent |
|
| 66 |
- die $LINENO "q-agt must not be executed with Nicira plugin!" |
|
| 67 |
-} |
|
| 68 |
- |
|
| 69 |
-function neutron_plugin_configure_service() {
|
|
| 70 |
- if [[ "$MAX_LP_PER_BRIDGED_LS" != "" ]]; then |
|
| 71 |
- iniset /$Q_PLUGIN_CONF_FILE nvp max_lp_per_bridged_ls $MAX_LP_PER_BRIDGED_LS |
|
| 72 |
- fi |
|
| 73 |
- if [[ "$MAX_LP_PER_OVERLAY_LS" != "" ]]; then |
|
| 74 |
- iniset /$Q_PLUGIN_CONF_FILE nvp max_lp_per_overlay_ls $MAX_LP_PER_OVERLAY_LS |
|
| 75 |
- fi |
|
| 76 |
- if [[ "$FAILOVER_TIME" != "" ]]; then |
|
| 77 |
- iniset /$Q_PLUGIN_CONF_FILE nvp failover_time $FAILOVER_TIME |
|
| 78 |
- fi |
|
| 79 |
- if [[ "$CONCURRENT_CONNECTIONS" != "" ]]; then |
|
| 80 |
- iniset /$Q_PLUGIN_CONF_FILE nvp concurrent_connections $CONCURRENT_CONNECTIONS |
|
| 81 |
- fi |
|
| 82 |
- |
|
| 83 |
- if [[ "$DEFAULT_TZ_UUID" != "" ]]; then |
|
| 84 |
- iniset /$Q_PLUGIN_CONF_FILE DEFAULT default_tz_uuid $DEFAULT_TZ_UUID |
|
| 85 |
- else |
|
| 86 |
- die $LINENO "The nicira plugin won't work without a default transport zone." |
|
| 87 |
- fi |
|
| 88 |
- if [[ "$DEFAULT_L3_GW_SVC_UUID" != "" ]]; then |
|
| 89 |
- iniset /$Q_PLUGIN_CONF_FILE DEFAULT default_l3_gw_service_uuid $DEFAULT_L3_GW_SVC_UUID |
|
| 90 |
- Q_L3_ENABLED=True |
|
| 91 |
- Q_L3_ROUTER_PER_TENANT=True |
|
| 92 |
- iniset /$Q_PLUGIN_CONF_FILE nvp metadata_mode access_network |
|
| 93 |
- fi |
|
| 94 |
- if [[ "$DEFAULT_L2_GW_SVC_UUID" != "" ]]; then |
|
| 95 |
- iniset /$Q_PLUGIN_CONF_FILE DEFAULT default_l2_gw_service_uuid $DEFAULT_L2_GW_SVC_UUID |
|
| 96 |
- fi |
|
| 97 |
- # NVP_CONTROLLERS must be a comma separated string |
|
| 98 |
- if [[ "$NVP_CONTROLLERS" != "" ]]; then |
|
| 99 |
- iniset /$Q_PLUGIN_CONF_FILE DEFAULT nvp_controllers $NVP_CONTROLLERS |
|
| 100 |
- else |
|
| 101 |
- die $LINENO "The nicira plugin needs at least an NVP controller." |
|
| 102 |
- fi |
|
| 103 |
- if [[ "$NVP_USER" != "" ]]; then |
|
| 104 |
- iniset /$Q_PLUGIN_CONF_FILE DEFAULT nvp_user $NVP_USER |
|
| 105 |
- fi |
|
| 106 |
- if [[ "$NVP_PASSWORD" != "" ]]; then |
|
| 107 |
- iniset /$Q_PLUGIN_CONF_FILE DEFAULT nvp_password $NVP_PASSWORD |
|
| 108 |
- fi |
|
| 109 |
- if [[ "$NVP_REQ_TIMEOUT" != "" ]]; then |
|
| 110 |
- iniset /$Q_PLUGIN_CONF_FILE DEFAULT req_timeout $NVP_REQ_TIMEOUT |
|
| 111 |
- fi |
|
| 112 |
- if [[ "$NVP_HTTP_TIMEOUT" != "" ]]; then |
|
| 113 |
- iniset /$Q_PLUGIN_CONF_FILE DEFAULT http_timeout $NVP_HTTP_TIMEOUT |
|
| 114 |
- fi |
|
| 115 |
- if [[ "$NVP_RETRIES" != "" ]]; then |
|
| 116 |
- iniset /$Q_PLUGIN_CONF_FILE DEFAULT retries $NVP_RETRIES |
|
| 117 |
- fi |
|
| 118 |
- if [[ "$NVP_REDIRECTS" != "" ]]; then |
|
| 119 |
- iniset /$Q_PLUGIN_CONF_FILE DEFAULT redirects $NVP_REDIRECTS |
|
| 120 |
- fi |
|
| 121 |
- if [[ "$AGENT_MODE" != "" ]]; then |
|
| 122 |
- iniset /$Q_PLUGIN_CONF_FILE nvp agent_mode $AGENT_MODE |
|
| 123 |
- if [[ "$AGENT_MODE" == "agentless" ]]; then |
|
| 124 |
- if [[ "$DEFAULT_SERVICE_CLUSTER_UUID" != "" ]]; then |
|
| 125 |
- iniset /$Q_PLUGIN_CONF_FILE DEFAULT default_service_cluster_uuid $DEFAULT_SERVICE_CLUSTER_UUID |
|
| 126 |
- else |
|
| 127 |
- die $LINENO "Agentless mode requires a service cluster." |
|
| 128 |
- fi |
|
| 129 |
- iniset /$Q_PLUGIN_CONF_FILE nvp_metadata metadata_server_address $Q_META_DATA_IP |
|
| 130 |
- fi |
|
| 131 |
- fi |
|
| 132 |
-} |
|
| 133 |
- |
|
| 134 |
-function neutron_plugin_setup_interface_driver() {
|
|
| 135 |
- local conf_file=$1 |
|
| 136 |
- iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriver |
|
| 137 |
-} |
|
| 138 |
- |
|
| 139 |
-function has_neutron_plugin_security_group() {
|
|
| 140 |
- # 0 means True here |
|
| 141 |
- return 0 |
|
| 142 |
-} |
|
| 143 |
- |
|
| 144 |
-function neutron_plugin_check_adv_test_requirements() {
|
|
| 145 |
- is_service_enabled q-dhcp && return 0 |
|
| 146 |
-} |
|
| 147 |
- |
|
| 148 |
-# Restore xtrace |
|
| 149 |
-$MY_XTRACE |
| 150 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,150 @@ |
| 0 |
+# Neutron VMware NSX plugin |
|
| 1 |
+# ------------------------- |
|
| 2 |
+ |
|
| 3 |
+# Save trace setting |
|
| 4 |
+MY_XTRACE=$(set +o | grep xtrace) |
|
| 5 |
+set +o xtrace |
|
| 6 |
+ |
|
| 7 |
+source $TOP_DIR/lib/neutron_plugins/ovs_base |
|
| 8 |
+ |
|
| 9 |
+function setup_integration_bridge() {
|
|
| 10 |
+ _neutron_ovs_base_setup_bridge $OVS_BRIDGE |
|
| 11 |
+ # Set manager to NSX controller (1st of list) |
|
| 12 |
+ if [[ "$NSX_CONTROLLERS" != "" ]]; then |
|
| 13 |
+ # Get the first controller |
|
| 14 |
+ controllers=(${NSX_CONTROLLERS//,/ })
|
|
| 15 |
+ OVS_MGR_IP=${controllers[0]}
|
|
| 16 |
+ else |
|
| 17 |
+ die $LINENO "Error - No controller specified. Unable to set a manager for OVS" |
|
| 18 |
+ fi |
|
| 19 |
+ sudo ovs-vsctl set-manager ssl:$OVS_MGR_IP |
|
| 20 |
+} |
|
| 21 |
+ |
|
| 22 |
+function is_neutron_ovs_base_plugin() {
|
|
| 23 |
+ # NSX uses OVS, but not the l3-agent |
|
| 24 |
+ return 0 |
|
| 25 |
+} |
|
| 26 |
+ |
|
| 27 |
+function neutron_plugin_create_nova_conf() {
|
|
| 28 |
+ # if n-cpu is enabled, then setup integration bridge |
|
| 29 |
+ if is_service_enabled n-cpu; then |
|
| 30 |
+ setup_integration_bridge |
|
| 31 |
+ fi |
|
| 32 |
+} |
|
| 33 |
+ |
|
| 34 |
+function neutron_plugin_install_agent_packages() {
|
|
| 35 |
+ # VMware NSX Plugin does not run q-agt, but it currently needs dhcp and metadata agents |
|
| 36 |
+ _neutron_ovs_base_install_agent_packages |
|
| 37 |
+} |
|
| 38 |
+ |
|
| 39 |
+function neutron_plugin_configure_common() {
|
|
| 40 |
+ Q_PLUGIN_CONF_PATH=etc/neutron/plugins/vmware |
|
| 41 |
+ Q_PLUGIN_CONF_FILENAME=nsx.ini |
|
| 42 |
+ Q_DB_NAME="neutron_nsx" |
|
| 43 |
+ # TODO(armando-migliaccio): rename this once the code rename is complete |
|
| 44 |
+ Q_PLUGIN_CLASS="neutron.plugins.nicira.NeutronPlugin.NvpPluginV2" |
|
| 45 |
+} |
|
| 46 |
+ |
|
| 47 |
+function neutron_plugin_configure_debug_command() {
|
|
| 48 |
+ sudo ovs-vsctl --no-wait -- --may-exist add-br $PUBLIC_BRIDGE |
|
| 49 |
+ iniset $NEUTRON_TEST_CONFIG_FILE DEFAULT external_network_bridge "$PUBLIC_BRIDGE" |
|
| 50 |
+} |
|
| 51 |
+ |
|
| 52 |
+function neutron_plugin_configure_dhcp_agent() {
|
|
| 53 |
+ setup_integration_bridge |
|
| 54 |
+ iniset $Q_DHCP_CONF_FILE DEFAULT enable_isolated_metadata True |
|
| 55 |
+ iniset $Q_DHCP_CONF_FILE DEFAULT enable_metadata_network True |
|
| 56 |
+ iniset $Q_DHCP_CONF_FILE DEFAULT ovs_use_veth True |
|
| 57 |
+} |
|
| 58 |
+ |
|
| 59 |
+function neutron_plugin_configure_l3_agent() {
|
|
| 60 |
+ # VMware NSX plugin does not run L3 agent |
|
| 61 |
+ die $LINENO "q-l3 should must not be executed with VMware NSX plugin!" |
|
| 62 |
+} |
|
| 63 |
+ |
|
| 64 |
+function neutron_plugin_configure_plugin_agent() {
|
|
| 65 |
+ # VMware NSX plugin does not run L2 agent |
|
| 66 |
+ die $LINENO "q-agt must not be executed with VMware NSX plugin!" |
|
| 67 |
+} |
|
| 68 |
+ |
|
| 69 |
+function neutron_plugin_configure_service() {
|
|
| 70 |
+ if [[ "$MAX_LP_PER_BRIDGED_LS" != "" ]]; then |
|
| 71 |
+ iniset /$Q_PLUGIN_CONF_FILE nsx max_lp_per_bridged_ls $MAX_LP_PER_BRIDGED_LS |
|
| 72 |
+ fi |
|
| 73 |
+ if [[ "$MAX_LP_PER_OVERLAY_LS" != "" ]]; then |
|
| 74 |
+ iniset /$Q_PLUGIN_CONF_FILE nsx max_lp_per_overlay_ls $MAX_LP_PER_OVERLAY_LS |
|
| 75 |
+ fi |
|
| 76 |
+ if [[ "$FAILOVER_TIME" != "" ]]; then |
|
| 77 |
+ iniset /$Q_PLUGIN_CONF_FILE nsx failover_time $FAILOVER_TIME |
|
| 78 |
+ fi |
|
| 79 |
+ if [[ "$CONCURRENT_CONNECTIONS" != "" ]]; then |
|
| 80 |
+ iniset /$Q_PLUGIN_CONF_FILE nsx concurrent_connections $CONCURRENT_CONNECTIONS |
|
| 81 |
+ fi |
|
| 82 |
+ |
|
| 83 |
+ if [[ "$DEFAULT_TZ_UUID" != "" ]]; then |
|
| 84 |
+ iniset /$Q_PLUGIN_CONF_FILE DEFAULT default_tz_uuid $DEFAULT_TZ_UUID |
|
| 85 |
+ else |
|
| 86 |
+ die $LINENO "The VMware NSX plugin won't work without a default transport zone." |
|
| 87 |
+ fi |
|
| 88 |
+ if [[ "$DEFAULT_L3_GW_SVC_UUID" != "" ]]; then |
|
| 89 |
+ iniset /$Q_PLUGIN_CONF_FILE DEFAULT default_l3_gw_service_uuid $DEFAULT_L3_GW_SVC_UUID |
|
| 90 |
+ Q_L3_ENABLED=True |
|
| 91 |
+ Q_L3_ROUTER_PER_TENANT=True |
|
| 92 |
+ iniset /$Q_PLUGIN_CONF_FILE nsx metadata_mode access_network |
|
| 93 |
+ fi |
|
| 94 |
+ if [[ "$DEFAULT_L2_GW_SVC_UUID" != "" ]]; then |
|
| 95 |
+ iniset /$Q_PLUGIN_CONF_FILE DEFAULT default_l2_gw_service_uuid $DEFAULT_L2_GW_SVC_UUID |
|
| 96 |
+ fi |
|
| 97 |
+ # NSX_CONTROLLERS must be a comma separated string |
|
| 98 |
+ if [[ "$NSX_CONTROLLERS" != "" ]]; then |
|
| 99 |
+ iniset /$Q_PLUGIN_CONF_FILE DEFAULT nsx_controllers $NSX_CONTROLLERS |
|
| 100 |
+ else |
|
| 101 |
+ die $LINENO "The VMware NSX plugin needs at least an NSX controller." |
|
| 102 |
+ fi |
|
| 103 |
+ if [[ "$NSX_USER" != "" ]]; then |
|
| 104 |
+ iniset /$Q_PLUGIN_CONF_FILE DEFAULT nsx_user $NSX_USER |
|
| 105 |
+ fi |
|
| 106 |
+ if [[ "$NSX_PASSWORD" != "" ]]; then |
|
| 107 |
+ iniset /$Q_PLUGIN_CONF_FILE DEFAULT nsx_password $NSX_PASSWORD |
|
| 108 |
+ fi |
|
| 109 |
+ if [[ "$NSX_REQ_TIMEOUT" != "" ]]; then |
|
| 110 |
+ iniset /$Q_PLUGIN_CONF_FILE DEFAULT req_timeout $NSX_REQ_TIMEOUT |
|
| 111 |
+ fi |
|
| 112 |
+ if [[ "$NSX_HTTP_TIMEOUT" != "" ]]; then |
|
| 113 |
+ iniset /$Q_PLUGIN_CONF_FILE DEFAULT http_timeout $NSX_HTTP_TIMEOUT |
|
| 114 |
+ fi |
|
| 115 |
+ if [[ "$NSX_RETRIES" != "" ]]; then |
|
| 116 |
+ iniset /$Q_PLUGIN_CONF_FILE DEFAULT retries $NSX_RETRIES |
|
| 117 |
+ fi |
|
| 118 |
+ if [[ "$NSX_REDIRECTS" != "" ]]; then |
|
| 119 |
+ iniset /$Q_PLUGIN_CONF_FILE DEFAULT redirects $NSX_REDIRECTS |
|
| 120 |
+ fi |
|
| 121 |
+ if [[ "$AGENT_MODE" != "" ]]; then |
|
| 122 |
+ iniset /$Q_PLUGIN_CONF_FILE nsx agent_mode $AGENT_MODE |
|
| 123 |
+ if [[ "$AGENT_MODE" == "agentless" ]]; then |
|
| 124 |
+ if [[ "$DEFAULT_SERVICE_CLUSTER_UUID" != "" ]]; then |
|
| 125 |
+ iniset /$Q_PLUGIN_CONF_FILE DEFAULT default_service_cluster_uuid $DEFAULT_SERVICE_CLUSTER_UUID |
|
| 126 |
+ else |
|
| 127 |
+ die $LINENO "Agentless mode requires a service cluster." |
|
| 128 |
+ fi |
|
| 129 |
+ iniset /$Q_PLUGIN_CONF_FILE nsx_metadata metadata_server_address $Q_META_DATA_IP |
|
| 130 |
+ fi |
|
| 131 |
+ fi |
|
| 132 |
+} |
|
| 133 |
+ |
|
| 134 |
+function neutron_plugin_setup_interface_driver() {
|
|
| 135 |
+ local conf_file=$1 |
|
| 136 |
+ iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriver |
|
| 137 |
+} |
|
| 138 |
+ |
|
| 139 |
+function has_neutron_plugin_security_group() {
|
|
| 140 |
+ # 0 means True here |
|
| 141 |
+ return 0 |
|
| 142 |
+} |
|
| 143 |
+ |
|
| 144 |
+function neutron_plugin_check_adv_test_requirements() {
|
|
| 145 |
+ is_service_enabled q-dhcp && return 0 |
|
| 146 |
+} |
|
| 147 |
+ |
|
| 148 |
+# Restore xtrace |
|
| 149 |
+$MY_XTRACE |
| 0 | 150 |
deleted file mode 100644 |
| ... | ... |
@@ -1,82 +0,0 @@ |
| 1 |
-# Nicira NVP |
|
| 2 |
-# ---------- |
|
| 3 |
- |
|
| 4 |
-# This third-party addition can be used to configure connectivity between a DevStack instance |
|
| 5 |
-# and an NVP Gateway in dev/test environments. In order to use this correctly, the following |
|
| 6 |
-# env variables need to be set (e.g. in your localrc file): |
|
| 7 |
-# |
|
| 8 |
-# * enable_service nicira --> to execute this third-party addition |
|
| 9 |
-# * PUBLIC_BRIDGE --> bridge used for external connectivity, typically br-ex |
|
| 10 |
-# * NVP_GATEWAY_NETWORK_INTERFACE --> interface used to communicate with the NVP Gateway |
|
| 11 |
-# * NVP_GATEWAY_NETWORK_CIDR --> CIDR to configure br-ex, e.g. 172.24.4.211/24 |
|
| 12 |
- |
|
| 13 |
-# Save trace setting |
|
| 14 |
-MY_XTRACE=$(set +o | grep xtrace) |
|
| 15 |
-set +o xtrace |
|
| 16 |
- |
|
| 17 |
-# This is the interface that connects the Devstack instance |
|
| 18 |
-# to an network that allows it to talk to the gateway for |
|
| 19 |
-# testing purposes |
|
| 20 |
-NVP_GATEWAY_NETWORK_INTERFACE=${NVP_GATEWAY_NETWORK_INTERFACE:-eth2}
|
|
| 21 |
-# Re-declare floating range as it's needed also in stop_nicira, which |
|
| 22 |
-# is invoked by unstack.sh |
|
| 23 |
-FLOATING_RANGE=${FLOATING_RANGE:-172.24.4.0/24}
|
|
| 24 |
- |
|
| 25 |
-function configure_nicira() {
|
|
| 26 |
- : |
|
| 27 |
-} |
|
| 28 |
- |
|
| 29 |
-function init_nicira() {
|
|
| 30 |
- if ! is_set NVP_GATEWAY_NETWORK_CIDR; then |
|
| 31 |
- NVP_GATEWAY_NETWORK_CIDR=$PUBLIC_NETWORK_GATEWAY/${FLOATING_RANGE#*/}
|
|
| 32 |
- echo "The IP address to set on br-ex was not specified. " |
|
| 33 |
- echo "Defaulting to "$NVP_GATEWAY_NETWORK_CIDR |
|
| 34 |
- fi |
|
| 35 |
- # Make sure the interface is up, but not configured |
|
| 36 |
- sudo ip link set $NVP_GATEWAY_NETWORK_INTERFACE up |
|
| 37 |
- # Save and then flush the IP addresses on the interface |
|
| 38 |
- addresses=$(ip addr show dev $NVP_GATEWAY_NETWORK_INTERFACE | grep inet | awk {'print $2'})
|
|
| 39 |
- sudo ip addr flush $NVP_GATEWAY_NETWORK_INTERFACE |
|
| 40 |
- # Use the PUBLIC Bridge to route traffic to the NVP gateway |
|
| 41 |
- # NOTE(armando-migliaccio): if running in a nested environment this will work |
|
| 42 |
- # only with mac learning enabled, portsecurity and security profiles disabled |
|
| 43 |
- # The public bridge might not exist for the NVP plugin if Q_USE_DEBUG_COMMAND is off |
|
| 44 |
- # Try to create it anyway |
|
| 45 |
- sudo ovs-vsctl --no-wait -- --may-exist add-br $PUBLIC_BRIDGE |
|
| 46 |
- sudo ovs-vsctl -- --may-exist add-port $PUBLIC_BRIDGE $NVP_GATEWAY_NETWORK_INTERFACE |
|
| 47 |
- nvp_gw_net_if_mac=$(ip link show $NVP_GATEWAY_NETWORK_INTERFACE | awk '/ether/ {print $2}')
|
|
| 48 |
- sudo ip link set address $nvp_gw_net_if_mac dev $PUBLIC_BRIDGE |
|
| 49 |
- for address in $addresses; do |
|
| 50 |
- sudo ip addr add dev $PUBLIC_BRIDGE $address |
|
| 51 |
- done |
|
| 52 |
- sudo ip addr add dev $PUBLIC_BRIDGE $NVP_GATEWAY_NETWORK_CIDR |
|
| 53 |
-} |
|
| 54 |
- |
|
| 55 |
-function install_nicira() {
|
|
| 56 |
- : |
|
| 57 |
-} |
|
| 58 |
- |
|
| 59 |
-function start_nicira() {
|
|
| 60 |
- : |
|
| 61 |
-} |
|
| 62 |
- |
|
| 63 |
-function stop_nicira() {
|
|
| 64 |
- if ! is_set NVP_GATEWAY_NETWORK_CIDR; then |
|
| 65 |
- NVP_GATEWAY_NETWORK_CIDR=$PUBLIC_NETWORK_GATEWAY/${FLOATING_RANGE#*/}
|
|
| 66 |
- echo "The IP address expected on br-ex was not specified. " |
|
| 67 |
- echo "Defaulting to "$NVP_GATEWAY_NETWORK_CIDR |
|
| 68 |
- fi |
|
| 69 |
- sudo ip addr del $NVP_GATEWAY_NETWORK_CIDR dev $PUBLIC_BRIDGE |
|
| 70 |
- # Save and then flush remaining addresses on the interface |
|
| 71 |
- addresses=$(ip addr show dev $PUBLIC_BRIDGE | grep inet | awk {'print $2'})
|
|
| 72 |
- sudo ip addr flush $PUBLIC_BRIDGE |
|
| 73 |
- # Try to detach physical interface from PUBLIC_BRIDGE |
|
| 74 |
- sudo ovs-vsctl del-port $NVP_GATEWAY_NETWORK_INTERFACE |
|
| 75 |
- # Restore addresses on NVP_GATEWAY_NETWORK_INTERFACE |
|
| 76 |
- for address in $addresses; do |
|
| 77 |
- sudo ip addr add dev $NVP_GATEWAY_NETWORK_INTERFACE $address |
|
| 78 |
- done |
|
| 79 |
-} |
|
| 80 |
- |
|
| 81 |
-# Restore xtrace |
|
| 82 |
-$MY_XTRACE |
| 83 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,82 @@ |
| 0 |
+# VMware NSX |
|
| 1 |
+# ---------- |
|
| 2 |
+ |
|
| 3 |
+# This third-party addition can be used to configure connectivity between a DevStack instance |
|
| 4 |
+# and an NSX Gateway in dev/test environments. In order to use this correctly, the following |
|
| 5 |
+# env variables need to be set (e.g. in your localrc file): |
|
| 6 |
+# |
|
| 7 |
+# * enable_service vmware_nsx --> to execute this third-party addition |
|
| 8 |
+# * PUBLIC_BRIDGE --> bridge used for external connectivity, typically br-ex |
|
| 9 |
+# * NSX_GATEWAY_NETWORK_INTERFACE --> interface used to communicate with the NSX Gateway |
|
| 10 |
+# * NSX_GATEWAY_NETWORK_CIDR --> CIDR to configure br-ex, e.g. 172.24.4.211/24 |
|
| 11 |
+ |
|
| 12 |
+# Save trace setting |
|
| 13 |
+MY_XTRACE=$(set +o | grep xtrace) |
|
| 14 |
+set +o xtrace |
|
| 15 |
+ |
|
| 16 |
+# This is the interface that connects the Devstack instance |
|
| 17 |
+# to an network that allows it to talk to the gateway for |
|
| 18 |
+# testing purposes |
|
| 19 |
+NSX_GATEWAY_NETWORK_INTERFACE=${NSX_GATEWAY_NETWORK_INTERFACE:-eth2}
|
|
| 20 |
+# Re-declare floating range as it's needed also in stop_vmware_nsx, which |
|
| 21 |
+# is invoked by unstack.sh |
|
| 22 |
+FLOATING_RANGE=${FLOATING_RANGE:-172.24.4.0/24}
|
|
| 23 |
+ |
|
| 24 |
+function configure_vmware_nsx() {
|
|
| 25 |
+ : |
|
| 26 |
+} |
|
| 27 |
+ |
|
| 28 |
+function init_vmware_nsx() {
|
|
| 29 |
+ if ! is_set NSX_GATEWAY_NETWORK_CIDR; then |
|
| 30 |
+ NSX_GATEWAY_NETWORK_CIDR=$PUBLIC_NETWORK_GATEWAY/${FLOATING_RANGE#*/}
|
|
| 31 |
+ echo "The IP address to set on br-ex was not specified. " |
|
| 32 |
+ echo "Defaulting to "$NSX_GATEWAY_NETWORK_CIDR |
|
| 33 |
+ fi |
|
| 34 |
+ # Make sure the interface is up, but not configured |
|
| 35 |
+ sudo ip link set $NSX_GATEWAY_NETWORK_INTERFACE up |
|
| 36 |
+ # Save and then flush the IP addresses on the interface |
|
| 37 |
+ addresses=$(ip addr show dev $NSX_GATEWAY_NETWORK_INTERFACE | grep inet | awk {'print $2'})
|
|
| 38 |
+ sudo ip addr flush $NSX_GATEWAY_NETWORK_INTERFACE |
|
| 39 |
+ # Use the PUBLIC Bridge to route traffic to the NSX gateway |
|
| 40 |
+ # NOTE(armando-migliaccio): if running in a nested environment this will work |
|
| 41 |
+ # only with mac learning enabled, portsecurity and security profiles disabled |
|
| 42 |
+ # The public bridge might not exist for the NSX plugin if Q_USE_DEBUG_COMMAND is off |
|
| 43 |
+ # Try to create it anyway |
|
| 44 |
+ sudo ovs-vsctl --no-wait -- --may-exist add-br $PUBLIC_BRIDGE |
|
| 45 |
+ sudo ovs-vsctl -- --may-exist add-port $PUBLIC_BRIDGE $NSX_GATEWAY_NETWORK_INTERFACE |
|
| 46 |
+ nsx_gw_net_if_mac=$(ip link show $NSX_GATEWAY_NETWORK_INTERFACE | awk '/ether/ {print $2}')
|
|
| 47 |
+ sudo ip link set address $nsx_gw_net_if_mac dev $PUBLIC_BRIDGE |
|
| 48 |
+ for address in $addresses; do |
|
| 49 |
+ sudo ip addr add dev $PUBLIC_BRIDGE $address |
|
| 50 |
+ done |
|
| 51 |
+ sudo ip addr add dev $PUBLIC_BRIDGE $NSX_GATEWAY_NETWORK_CIDR |
|
| 52 |
+} |
|
| 53 |
+ |
|
| 54 |
+function install_vmware_nsx() {
|
|
| 55 |
+ : |
|
| 56 |
+} |
|
| 57 |
+ |
|
| 58 |
+function start_vmware_nsx() {
|
|
| 59 |
+ : |
|
| 60 |
+} |
|
| 61 |
+ |
|
| 62 |
+function stop_vmware_nsx() {
|
|
| 63 |
+ if ! is_set NSX_GATEWAY_NETWORK_CIDR; then |
|
| 64 |
+ NSX_GATEWAY_NETWORK_CIDR=$PUBLIC_NETWORK_GATEWAY/${FLOATING_RANGE#*/}
|
|
| 65 |
+ echo "The IP address expected on br-ex was not specified. " |
|
| 66 |
+ echo "Defaulting to "$NSX_GATEWAY_NETWORK_CIDR |
|
| 67 |
+ fi |
|
| 68 |
+ sudo ip addr del $NSX_GATEWAY_NETWORK_CIDR dev $PUBLIC_BRIDGE |
|
| 69 |
+ # Save and then flush remaining addresses on the interface |
|
| 70 |
+ addresses=$(ip addr show dev $PUBLIC_BRIDGE | grep inet | awk {'print $2'})
|
|
| 71 |
+ sudo ip addr flush $PUBLIC_BRIDGE |
|
| 72 |
+ # Try to detach physical interface from PUBLIC_BRIDGE |
|
| 73 |
+ sudo ovs-vsctl del-port $NSX_GATEWAY_NETWORK_INTERFACE |
|
| 74 |
+ # Restore addresses on NSX_GATEWAY_NETWORK_INTERFACE |
|
| 75 |
+ for address in $addresses; do |
|
| 76 |
+ sudo ip addr add dev $NSX_GATEWAY_NETWORK_INTERFACE $address |
|
| 77 |
+ done |
|
| 78 |
+} |
|
| 79 |
+ |
|
| 80 |
+# Restore xtrace |
|
| 81 |
+$MY_XTRACE |