netvirt devstack - add external network support 03/48403/18
authorAlon Kochba <alonko@hpe.com>
Wed, 16 Nov 2016 13:12:07 +0000 (15:12 +0200)
committerAlon Kochba <alonko@hpe.com>
Sun, 20 Nov 2016 10:53:15 +0000 (12:53 +0200)
add external bridge configuration to all switches
add VxLAN tunnels between these bridges
configure control node as the external gateway

Change-Id: I4326d406dcccb22d4fc420521b2a245c4538aa61
Signed-off-by: Alon Kochba <alonko@hpe.com>
jjb/integration/include-raw-integration-deploy-openstack-run-test.sh
jjb/netvirt/netvirt-csit-1node-multi-openstack.yaml
jjb/netvirt/netvirt-csit-3node-multi-openstack.yaml

index cd9741f570daf865ecd673454f08504ccc198462..ee0ac0672fa9f74058b4d8f3ffeda7f19f469ae4 100644 (file)
@@ -103,17 +103,26 @@ else
   ODL_L3=False
 fi
 
+# if we are using the new netvirt impl, as determined by the feature name
+# odl-netvirt-openstack (note: old impl is odl-ovsdb-openstack) then we
+# want PROVIDER_MAPPINGS to be used -- this should be fixed if we want to support
+# external networks in legacy netvirt
+if [[ ${CONTROLLERFEATURES} == *"odl-netvirt-openstack"* ]]; then
+  ODL_PROVIDER_MAPPINGS="\${PUBLIC_PHYSICAL_NETWORK}:${PUBLIC_BRIDGE}"
+else
+  ODL_PROVIDER_MAPPINGS=
+fi
+
 if [ "${ODL_ENABLE_L3_FWD}" == "yes" ]; then
 cat >> ${local_conf_file_name} << EOF
-
 PUBLIC_BRIDGE=${PUBLIC_BRIDGE}
-ODL_PROVIDER_MAPPINGS=${PUBLIC_BRIDGE}:br100
+PUBLIC_PHYSICAL_NETWORK=physnet1 # FIXME this should be a parameter
+ODL_PROVIDER_MAPPINGS=${ODL_PROVIDER_MAPPINGS}
 
 disable_service q-l3
 Q_L3_ENABLED=True
 ODL_L3=${ODL_L3}
 PUBLIC_INTERFACE=br100
-
 EOF
 
 if [ "${ODL_ML2_BRANCH}" == "stable/mitaka" ]; then
@@ -184,7 +193,6 @@ ADMIN_PASSWORD=admin
 enable_plugin networking-odl ${ODL_ML2_DRIVER_REPO} ${ODL_ML2_BRANCH}
 ODL_MODE=compute
 LIBVIRT_TYPE=qemu
-
 EOF
 
 if [ "${NUM_ODL_SYSTEM}" -gt 1 ]; then
@@ -211,12 +219,25 @@ ODL_MGR_IP=${ODL_SYSTEM_1_IP}
 EOF
 fi
 
+# if we are using the new netvirt impl, as determined by the feature name
+# odl-netvirt-openstack (note: old impl is odl-ovsdb-openstack) then we
+# want PROVIDER_MAPPINGS to be used -- this should be fixed if we want to support
+# external networks in legacy netvirt
+if [[ ${CONTROLLERFEATURES} == *"odl-netvirt-openstack"* ]]; then
+  ODL_PROVIDER_MAPPINGS="\${PUBLIC_PHYSICAL_NETWORK}:${PUBLIC_BRIDGE}"
+else
+  ODL_PROVIDER_MAPPINGS=
+fi
+
 if [ "${ODL_ENABLE_L3_FWD}" == "yes" ]; then
 cat >> ${local_conf_file_name} << EOF
 # Uncomment lines below if odl-compute is to be used for l3 forwarding
 Q_L3_ENABLED=True
 ODL_L3=${ODL_L3}
-PUBLIC_INTERFACE=br100
+PUBLIC_INTERFACE=br100 # FIXME do we use br100 at all?
+PUBLIC_BRIDGE=${PUBLIC_BRIDGE}
+PUBLIC_PHYSICAL_NETWORK=physnet1 # FIXME this should be a parameter
+ODL_PROVIDER_MAPPINGS=${ODL_PROVIDER_MAPPINGS}
 EOF
 fi
 echo "local.conf Created...."
@@ -448,6 +469,37 @@ ${SSH} ${OPENSTACK_CONTROL_NODE_IP} "sudo pip install --upgrade pip"
 ${SSH} ${OPENSTACK_CONTROL_NODE_IP} "sudo pip install urllib3 --upgrade"
 ${SSH} ${OPENSTACK_CONTROL_NODE_IP} "sudo pip install httplib2 --upgrade"
 
+for i in `seq 1 $((NUM_OPENSTACK_SYSTEM - 1))`
+do
+    IP_VAR=OPENSTACK_COMPUTE_NODE_${i}_IP
+    COMPUTE_IPS[$((i-1))]=${!IP_VAR}
+done
+
+# External Network
+echo "prepare external networks by adding vxlan tunnels between all nodes on a separate bridge..."
+devstack_index=1
+for ip in ${OPENSTACK_CONTROL_NODE_IP} ${COMPUTE_IPS[*]}
+do
+    # FIXME - Workaround, ODL (new netvirt) currently adds PUBLIC_BRIDGE as a port in br-int since it doesn't see such a bridge existing when we stack
+    ${SSH} $ip "sudo ovs-vsctl --if-exists del-port br-int $PUBLIC_BRIDGE"
+    ${SSH} $ip "sudo ovs-vsctl --may-exist add-br $PUBLIC_BRIDGE -- set bridge $PUBLIC_BRIDGE other-config:disable-in-band=true other_config:hwaddr=f6:00:00:ff:01:0$((devstack_index++))"
+done
+
+# Control Node - PUBLIC_BRIDGE will act as the external router
+GATEWAY_IP="10.10.10.250" # FIXME this should be a parameter, also shared with integration-test
+${SSH} ${OPENSTACK_CONTROL_NODE_IP} "sudo ifconfig $PUBLIC_BRIDGE up ${GATEWAY_IP}/24"
+compute_index=1
+for compute_ip in ${COMPUTE_IPS[*]}
+do
+    # Tunnel from controller to compute
+    PORT_NAME=compute$((compute_index++))_vxlan
+    ${SSH} ${OPENSTACK_CONTROL_NODE_IP} "sudo ovs-vsctl add-port $PUBLIC_BRIDGE $PORT_NAME -- set interface $PORT_NAME type=vxlan options:local_ip="${OPENSTACK_CONTROL_NODE_IP}" options:remote_ip="$compute_ip" options:dst_port=9876 options:key=flow"
+
+    # Tunnel from compute to controller
+    PORT_NAME=control_vxlan
+    ${SSH} ${compute_ip} "sudo ovs-vsctl add-port $PUBLIC_BRIDGE $PORT_NAME -- set interface $PORT_NAME type=vxlan options:local_ip="$compute_ip" options:remote_ip="${OPENSTACK_CONTROL_NODE_IP}" options:dst_port=9876 options:key=flow"
+done
+
 echo "Locating test plan to use..."
 testplan_filepath="${WORKSPACE}/test/csit/testplans/${STREAMTESTPLAN}"
 if [ ! -f "${testplan_filepath}" ]; then
index e8e04391b1e1f8cc4ef78f57cc770ba9fe7d059b..1a7ff893433b86e573dc1377002ae67d7b732806 100644 (file)
@@ -47,7 +47,7 @@
 
     odl-enable-l3: 'yes'
 
-    public-bridge: 'public' # PUBLIC_PHYSICAL_NETWORK
+    public-bridge: 'br-physnet1'
 
     enable-openstack-services: 'q-svc,q-dhcp,q-meta,n-cauth,tempest'
 
index 7784bff3b6e854e31f6f7dd85c4c13952ab4c1df..caec858e791e8120058a98c2b30d122657ea1bf8 100644 (file)
@@ -49,7 +49,7 @@
 
     enable-haproxy: 'yes'
 
-    public-bridge: 'public' # PUBLIC_PHYSICAL_NETWORK
+    public-bridge: 'br-physnet1'
 
     enable-openstack-services: 'q-svc,q-dhcp,q-meta,n-cauth,tempest'