From 197900869c0811cc57c34d2a89b051a6c400300b Mon Sep 17 00:00:00 2001 From: Zhijiang Hu Date: Thu, 23 Nov 2017 03:52:42 -0500 Subject: [PATCH] Let OVS to connect to the individual IPs of each ODL node For ODL clustering, one should explicitly points switches to each of the ODL instances. The openflowplugin logic will figure out which controller should be the master, and which should be the slave. Kolla currently sets the manager to one of the specific ODL over ptcp and another one through the VIP. The VIP is probably forwarding the traffic to that same ODL so from ODL's perspective it's getting two duplicated connection requests from the same OVS which will cause re-connection problem. This PS does: 1) Let OVS to connect to the individual IPs of each ODL node in a ODL cluster instead of only connect to the representative over VIP. Devstack is doing the same thing[1]. Further more, there is no need for HAProxy to be frontend for ODL southbound. 2) Delete the unusd ptcp connection option. [1] https://review.openstack.org/#/c/249484/ Closes-Bug: #1734047 Change-Id: Ib57e6fbb5ce64a48be0506904d3c8397ed6f70d9 Signed-off-by: Zhijiang Hu (cherry picked from commit 28b50c22ceb2d9e1b797fe748c61363ec550b9a3) --- ansible/group_vars/all.yml | 1 - ansible/roles/haproxy/templates/haproxy.cfg.j2 | 11 ----------- ansible/roles/openvswitch/templates/start-ovs.j2 | 3 ++- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index a07819b53a..eb97067293 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -277,7 +277,6 @@ opendaylight_tomcat_redirect_port: "8663" opendaylight_karaf_ssh_port: "8101" opendaylight_openflow_port: "6653" opendaylight_ovsdb_port: "6641" -opendaylight_haproxy_ovsdb_port: "6642" public_protocol: "{{ 'https' if kolla_enable_tls_external | bool else 'http' }}" internal_protocol: "http" diff --git a/ansible/roles/haproxy/templates/haproxy.cfg.j2 b/ansible/roles/haproxy/templates/haproxy.cfg.j2 index e447b1cbb5..825dc48fe0 100644 --- a/ansible/roles/haproxy/templates/haproxy.cfg.j2 +++ b/ansible/roles/haproxy/templates/haproxy.cfg.j2 @@ -891,15 +891,4 @@ listen opendaylight_api_backup server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ opendaylight_restconf_port_backup }} check fall 5 inter 2000 rise 2 {% endfor %} -listen opendaylight_ovsdb - mode tcp - timeout client 3600s - timeout server 3600s - option tcplog - option tcpka - bind {{ kolla_internal_vip_address }}:{{ opendaylight_haproxy_ovsdb_port }} -{% for host in groups['opendaylight'] %} - server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ opendaylight_ovsdb_port }} check inter 2000 rise 2 fall 5 {% if not loop.first %}backup{% endif %} - -{% endfor %} {% endif %} diff --git a/ansible/roles/openvswitch/templates/start-ovs.j2 b/ansible/roles/openvswitch/templates/start-ovs.j2 index d6dd723b68..fe5f34f28d 100644 --- a/ansible/roles/openvswitch/templates/start-ovs.j2 +++ b/ansible/roles/openvswitch/templates/start-ovs.j2 @@ -1,6 +1,7 @@ #!/usr/bin/env bash {% if enable_opendaylight | bool %} -/usr/bin/ovs-vsctl --no-wait -- set-manager ptcp:{{ ovsdb_port }}:{{ hostvars[inventory_hostname]['ansible_' + hostvars[inventory_hostname]['api_interface']]['ipv4']['address'] }} tcp:{{ kolla_internal_vip_address }}:{{ opendaylight_haproxy_ovsdb_port }} +/usr/bin/ovs-vsctl --no-wait -- set-manager {% for host in groups['opendaylight'] %}tcp:{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ opendaylight_ovsdb_port }} {% endfor %} + /usr/bin/ovs-vsctl --no-wait -- set Open_vSwitch . other_config:local_ip={{ hostvars[inventory_hostname]['ansible_' + hostvars[inventory_hostname]['tunnel_interface']]['ipv4']['address'] }} /usr/bin/ovs-vsctl --no-wait -- set Open_vSwitch . other_config:provider_mappings=physnet1:{{ neutron_bridge_name }} /usr/bin/ovs-vsctl --no-wait -- set Open_vSwitch . external_ids:system-id=`cat /proc/sys/kernel/random/uuid`