create a virtual port on jumpserver for functest 03/6103/6
authorcarey.xu <carey.xuhan@huawei.com>
Mon, 11 Jan 2016 08:44:59 +0000 (16:44 +0800)
committerJustin chi <chigang@huawei.com>
Tue, 12 Jan 2016 13:11:05 +0000 (13:11 +0000)
  - create a virtual port on jumpserver, for functest communicate with openstack admin network
  - force mtu to 1450 when vxlan mode
  - make only one mysql node primary(bug workaround)

JIRA: COMPASS-243

Change-Id: I498ed05f4b1b64f4f4db2455dd58dd2b4e82ae82
Signed-off-by: carey.xu <carey.xuhan@huawei.com>
deploy/adapters/ansible/roles/ha/templates/haproxy.cfg
deploy/adapters/ansible/roles/neutron-network/tasks/main.yml
deploy/network.sh
deploy/setup_vnic.py

index edbd998..38a113e 100644 (file)
@@ -34,7 +34,7 @@ listen  proxy-mysql
 {% if loop.index == 1 %}
     server {{ host }} {{ ip }}:3306 weight 1 check inter 2000 rise 2 fall 5
 {% else %}
-    server {{ host }} {{ ip }}:3306 weight 1 check inter 2000 rise 2 fall 5
+    server {{ host }} {{ ip }}:3306 weight 1 check inter 2000 rise 2 fall 5 backup
 {% endif %}
 {% endfor %}
 
index a3a62b1..bb6b952 100644 (file)
   template: src=templates/neutron.conf
             dest=/etc/neutron/neutron.conf backup=yes
 
+- name: force mtu to 1450 for vxlan
+  lineinfile:
+    dest: /etc/neutron/dnsmasq-neutron.conf
+    regexp: '^dhcp-option-force'
+    line: 'dhcp-option-force=26,1450'
+  when: "'vxlan' in {{ NEUTRON_TUNNEL_TYPES }}"
+
 - include: firewall.yml
   when: enable_fwaas == True
 
index e76fd92..9e0cfa8 100755 (executable)
@@ -58,7 +58,7 @@ function setup_bridge_external()
     sudo virsh net-define $WORK_DIR/network/external.xml
     sudo virsh net-start external
 
-    sudo python $COMPASS_DIR/deploy/setup_vnic.py
+    python $COMPASS_DIR/deploy/setup_vnic.py
 }
 
 function setup_nat_net() {
index 3962303..8e14765 100644 (file)
@@ -3,17 +3,17 @@ import os
 import yaml
 
 if __name__ == "__main__":
-    network_config_file = "/home/carey/nfv/compass4nfv/deploy/conf/network_cfg.yaml"#os.environ["NETWORK"]
+    network_config_file = os.environ["NETWORK"]
     network_config = yaml.load(open(network_config_file, "r"))
-    os.system("ovs-vsctl --may-exist add-port br-external mgmt_vnic -- set Interface mgmt_vnic type=internal")
-    os.system("ip addr flush mgmt_vnic")
-    os.system("ip link set mgmt_vnic up")
+    os.system("sudo ovs-vsctl --may-exist add-port br-external mgmt_vnic -- set Interface mgmt_vnic type=internal")
+    os.system("sudo ip addr flush mgmt_vnic")
+    os.system("sudo ip link set mgmt_vnic up")
     for sys_intf in network_config["sys_intf_mappings"]:
         if sys_intf["name"] == "mgmt" and sys_intf.get("vlan_tag"):
-            os.system("ovs-vsctl set port mgmt_vnic tag=%s" % sys_intf["vlan_tag"])
+            os.system("sudo ovs-vsctl set port mgmt_vnic tag=%s" % sys_intf["vlan_tag"])
 
     for net_info in network_config["ip_settings"]:
         if net_info["name"] == "mgmt":
             mgmt_ip_range_end= net_info["ip_ranges"][0][1]
             mgmt_netmask = net_info["cidr"].split('/')[1]
-            os.system(r"ip addr add %s/%s dev mgmt_vnic" % (mgmt_ip_range_end, mgmt_netmask))
+            os.system(r"sudo ip addr add %s/%s dev mgmt_vnic" % (mgmt_ip_range_end, mgmt_netmask))