[pve-devel] [pve-network 3/3] qinq|vlan: ovs: add ovsint interfaces to ovs-ports list

Alexandre Derumier aderumier at odiso.com
Thu May 28 14:48:49 CEST 2020


if not, on reload, interfaces are unplug/replugged with packet
loss.

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/Network/SDN/Zones/QinQPlugin.pm | 4 ++++
 PVE/Network/SDN/Zones/VlanPlugin.pm | 6 +++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/PVE/Network/SDN/Zones/QinQPlugin.pm b/PVE/Network/SDN/Zones/QinQPlugin.pm
index 9077713..e3423ef 100644
--- a/PVE/Network/SDN/Zones/QinQPlugin.pm
+++ b/PVE/Network/SDN/Zones/QinQPlugin.pm
@@ -73,6 +73,10 @@ sub generate_sdn_config {
 	push @iface_config, "ovs_options vlan_mode=dot1q-tunnel tag=$stag other_config:qinq-ethtype=$vlanprotocol";
 	push(@{$config->{$svlan_iface}}, @iface_config) if !$config->{$svlan_iface};
 
+	#redefine main ovs bridge, ifupdown2 will merge ovs_ports
+	@iface_config = ();
+	push @iface_config, "ovs_ports $svlan_iface";
+	push(@{$config->{$bridge}}, @iface_config); 
 
 	#zone vlan aware bridge
 	@iface_config = ();
diff --git a/PVE/Network/SDN/Zones/VlanPlugin.pm b/PVE/Network/SDN/Zones/VlanPlugin.pm
index 987c553..aeff1a4 100644
--- a/PVE/Network/SDN/Zones/VlanPlugin.pm
+++ b/PVE/Network/SDN/Zones/VlanPlugin.pm
@@ -66,9 +66,13 @@ sub generate_sdn_config {
 	} else {
 	    push @iface_config, "ovs_options tag=$tag";
 	}
-
 	push(@{$config->{$vnet_uplink}}, @iface_config) if !$config->{$vnet_uplink};
 
+	#redefine main ovs bridge, ifupdown2 will merge ovs_ports
+	@iface_config = ();
+	push @iface_config, "ovs_ports $vnet_uplink";
+	push(@{$config->{$bridge}}, @iface_config);
+
 	@iface_config = ();
 	push @iface_config, "ovs_type OVSBridge";
 	push @iface_config, "ovs_ports $vnet_uplink";
-- 
2.20.1




More information about the pve-devel mailing list