aboutsummaryrefslogtreecommitdiffstats
path: root/mcp
diff options
context:
space:
mode:
authorMichael Polenchuk <mpolenchuk@mirantis.com>2019-01-23 15:36:57 +0400
committerMichael Polenchuk <mpolenchuk@mirantis.com>2019-01-24 14:42:18 +0400
commit1c235210c28bb41149e57f7a5dc6f2d4882748a0 (patch)
tree9f9deae15408095d50f89ae40d00ca22be16926b /mcp
parent1746232d6067088eb2a6bd83eb6e059f28088119 (diff)
Enable back auto for ports network script
The ovs port remains in down state after reboot if "auto" is off. Also turn off no_wait option for odl-noha scenarios. Change-Id: I0121b3190869528e5f2e9985f9e9299ac6c6724e Signed-off-by: Michael Polenchuk <mpolenchuk@mirantis.com>
Diffstat (limited to 'mcp')
-rw-r--r--mcp/patches/salt-formula-linux/0001-Set-ovs-bridges-as-L3-interfaces.patch36
-rw-r--r--mcp/reclass/classes/cluster/mcp-odl-noha/openstack/compute.yml.j25
2 files changed, 26 insertions, 15 deletions
diff --git a/mcp/patches/salt-formula-linux/0001-Set-ovs-bridges-as-L3-interfaces.patch b/mcp/patches/salt-formula-linux/0001-Set-ovs-bridges-as-L3-interfaces.patch
index cf3da7feb..92d17a1a4 100644
--- a/mcp/patches/salt-formula-linux/0001-Set-ovs-bridges-as-L3-interfaces.patch
+++ b/mcp/patches/salt-formula-linux/0001-Set-ovs-bridges-as-L3-interfaces.patch
@@ -12,16 +12,18 @@ Subject: [PATCH] Set ovs bridges as L3 interfaces
diff --git a/linux/files/ovs_bridge b/linux/files/ovs_bridge
new file mode 100644
-index 0000000..d33864c
+index 0000000..1322eeb
--- /dev/null
+++ b/linux/files/ovs_bridge
-@@ -0,0 +1,18 @@
+@@ -0,0 +1,20 @@
+auto {{ bridge_name }}
+allow-ovs {{ bridge_name }}
-+iface {{ bridge_name }} inet static
++iface {{ bridge_name }} inet {{ bridge.get('proto', 'static' if bridge.address is defined else 'manual') }}
+ ovs_type OVSBridge
++ {%- if bridge.address is defined %}
+ address {{ bridge.address }}
+ netmask {{ bridge.netmask }}
++ {%- endif %}
+ {%- if bridge.use_interfaces is defined %}
+ ovs_ports {{ bridge.use_interfaces|join(' ') }}
+ {%- endif %}
@@ -35,14 +37,11 @@ index 0000000..d33864c
+ dns-nameservers {{ bridge.name_servers | join(' ') }}
+ {%- endif %}
diff --git a/linux/files/ovs_port b/linux/files/ovs_port
-index 222ca8e..03072cd 100644
+index 222ca8e..efb0307 100644
--- a/linux/files/ovs_port
+++ b/linux/files/ovs_port
-@@ -1,6 +1,11 @@
--auto {{ port_name }}
-+# With systemd, adding OVS bridges as 'auto' can cause race conditions
-+# https://github.com/openvswitch/ovs/blob/master/debian/openvswitch-switch.README.Debian
-+# auto {{ port_name }}
+@@ -1,6 +1,9 @@
+ auto {{ port_name }}
allow-{{ port.bridge }} {{ port_name }}
iface {{ port_name }} inet {{ port.get('proto', 'manual') }}
+{%- if '.' in port_name %}
@@ -52,14 +51,13 @@ index 222ca8e..03072cd 100644
mtu {{ port.get('mtu', '1500') }}
ovs_bridge {{ port.bridge }}
diff --git a/linux/network/interface.sls b/linux/network/interface.sls
-index a39fc37..c4a94a3 100644
+index a39fc37..8bce092 100644
--- a/linux/network/interface.sls
+++ b/linux/network/interface.sls
-@@ -92,6 +92,37 @@ add_int_{{ int_name }}_to_ovs_dpdk_bridge_{{ interface_name }}:
+@@ -92,6 +92,35 @@ add_int_{{ int_name }}_to_ovs_dpdk_bridge_{{ interface_name }}:
ovs_bridge_{{ interface_name }}:
openvswitch_bridge.present:
- name: {{ interface_name }}
-+{%- if interface.get('proto', 'manual') == 'static' %}
+ file.managed:
+ - name: /etc/network/interfaces.u/ifcfg-{{ interface_name }}
+ - makedirs: True
@@ -87,13 +85,21 @@ index a39fc37..c4a94a3 100644
+ {%- if network.noifupdown|d(false) or interface.noifupdown|d(false) %}
+ - onlyif: /bin/false
+ {%- else %}
-+ - unless: ip link show {{ interface_name }} | grep -q '\<UP\>'
++ - unless: grep -qFx up /sys/class/net/{{ interface_name }}/operstate
+ {%- endif %}
-+{%- endif %}
{# add linux network interface into OVS bridge #}
{%- for int_name, int in network.interface.items() %}
-@@ -176,6 +207,9 @@ ovs_port_{{ interface_name }}_line2:
+@@ -102,7 +131,7 @@ ovs_bridge_{{ interface_name }}:
+
+ add_int_{{ int_name }}_to_ovs_bridge_{{ interface_name }}:
+ cmd.run:
+- - unless: ovs-vsctl show | grep {{ int_name }}
++ - unless: ovs-vsctl list-ports {{ interface_name }} | grep -qFx {{ int_name }}
+ - name: ovs-vsctl{%- if network.ovs_nowait %} --no-wait{%- endif %} add-port {{ interface_name }} {{ int_name }}
+
+ {%- endif %}
+@@ -176,6 +205,9 @@ ovs_port_{{ interface_name }}_line2:
ovs_port_up_{{ interface_name }}:
cmd.run:
- name: ifup {{ interface_name }}
diff --git a/mcp/reclass/classes/cluster/mcp-odl-noha/openstack/compute.yml.j2 b/mcp/reclass/classes/cluster/mcp-odl-noha/openstack/compute.yml.j2
index 3e912c1e3..5d8d26a1a 100644
--- a/mcp/reclass/classes/cluster/mcp-odl-noha/openstack/compute.yml.j2
+++ b/mcp/reclass/classes/cluster/mcp-odl-noha/openstack/compute.yml.j2
@@ -21,6 +21,7 @@ classes:
parameters:
linux:
network:
+ ovs_nowait: false
interface:
{%- if '-ovs-' in conf.MCP_DEPLOY_SCENARIO %}
dpdk0:
@@ -48,11 +49,15 @@ parameters:
br-floating:
enabled: true
type: ovs_bridge
+ datapath_type: netdev
+ use_interfaces:
+ - float-to-ex
float-to-ex:
enabled: true
type: ovs_port
mtu: ${_param:interface_mtu}
bridge: br-floating
+ ovs_bridge: br-floating
noifupdown: true
br-ex:
enabled: true