all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Alexandre Derumier <aderumier@odiso.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH ifupdown2] add ovs support for fakebridge.
Date: Fri, 14 Oct 2022 09:22:35 +0200	[thread overview]
Message-ID: <20221014072235.2902517-1-aderumier@odiso.com> (raw)

This was request by a proxmox user on ifupdown2 github issues.

https://github.com/CumulusNetworks/ifupdown2/issues/245

It was possible to do it with ifupdown1, but not ifupdown2.

The patch is already applied upstream
https://github.com/CumulusNetworks/ifupdown2/pull/246

example to define a fake ovs bridge with vlan10:

auto vmbr0
iface vmbr0 inet manual
        ovs_type OVSBridge

auto vmbr0v10
iface vmbr0v10 inet manual
        ovs_type OVSBridge
        ovs_bridge vmbr0
        ovs_options vmbr0 10

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
 debian/patches/series                         |  3 +-
 .../0001-ovs-add-support-for-fakebridge.patch | 57 +++++++++++++++++++
 2 files changed, 59 insertions(+), 1 deletion(-)
 create mode 100644 debian/patches/upstream/0001-ovs-add-support-for-fakebridge.patch

diff --git a/debian/patches/series b/debian/patches/series
index a005387..ccfd03d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -11,4 +11,5 @@ pve/0010-postinst-rm-update-network-config-compatibility.patch
 pve/0011-d-rules-drop-now-default-with-systemd.patch
 pve/0012-d-rules-add-dh_installsystemd-override-for-compat-12.patch
 pve/0013-postinst-reload-network-config-on-first-install.patch
-pve/0014-fix-pointopoint-regression.patch
\ No newline at end of file
+pve/0014-fix-pointopoint-regression.patch
+upstream/0001-ovs-add-support-for-fakebridge.patch
\ No newline at end of file
diff --git a/debian/patches/upstream/0001-ovs-add-support-for-fakebridge.patch b/debian/patches/upstream/0001-ovs-add-support-for-fakebridge.patch
new file mode 100644
index 0000000..7e9eb67
--- /dev/null
+++ b/debian/patches/upstream/0001-ovs-add-support-for-fakebridge.patch
@@ -0,0 +1,57 @@
+From 39b395b1fd41e5ac4066c5afd19b6ab9c17b8b14 Mon Sep 17 00:00:00 2001
+From: alexandre derumier <aderumier@odiso.com>
+Date: Thu, 1 Sep 2022 19:18:21 +0200
+Subject: [PATCH] addons: openvswitch : add support for fakebridge.
+
+Fake bridge are are ovsbridge child of a parent bridge with a specific vlan tag.
+
+```
+auto br-parent
+iface br-parent inet manual
+        ovs_type OVSBridge
+
+auto br-fakev10
+iface br-fakev10 inet manual
+        ovs_type OVSBridge
+        ovs_bridge br-parent
+        ovs_options br-parent 10
+
+```
+---
+ ifupdown2/addons/openvswitch.py | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/ifupdown2/addons/openvswitch.py b/ifupdown2/addons/openvswitch.py
+index 2c9a76f7..0a124ba2 100644
+--- a/ifupdown2/addons/openvswitch.py
++++ b/ifupdown2/addons/openvswitch.py
+@@ -74,6 +74,10 @@ class openvswitch(Addon, moduleBase):
+                     "required": False,
+                     "example": ["ovs-ports-condone-regex ^[a-zA-Z0-9]+_v[0-9]{1,4}$"]
+             },
++            'ovs-bridge': {
++                'help': 'Optional parent bridge for fake bridges',
++                'required': False,
++            },
+         }
+     }
+ 
+@@ -147,13 +151,17 @@ def _addbridge (self, ifaceobj):
+         ovsextra = ifaceobj.get_attr_value('ovs-extra')
+         ovsmtu = ifaceobj.get_attr_value_first ('ovs-mtu')
+         ovsportscondoneregex = self._get_ovs_port_condone_regex(ifaceobj)
++        ovsparent = ifaceobj.get_attr_value_first ('ovs-bridge')
+ 
+         cmd_list = []
+ 
+         cmd = "--may-exist add-br %s"%(iface)
++        if ovsparent is not None and ovsoptions:
++            cmd = cmd + " %s" %(ovsoptions)
++
+         cmd_list.append(cmd)
+ 
+-        if ovsoptions:
++        if ovsparent is None and ovsoptions:
+             cmd = "set bridge %s %s" %(iface, ovsoptions)
+             cmd_list.append(cmd)
+ 
-- 
2.30.2




             reply	other threads:[~2022-10-14  7:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-14  7:22 Alexandre Derumier [this message]
2022-10-14 13:26 ` [pve-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221014072235.2902517-1-aderumier@odiso.com \
    --to=aderumier@odiso.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal