Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openvswitch: better integration with systemd #53033

Merged
merged 1 commit into from Feb 21, 2020

Conversation

netixx
Copy link
Contributor

@netixx netixx commented Dec 29, 2018

Systemd dependencies for scripted mode
were refactored according to analysis in #34586.

networking.vswitches can now be used with systemd-networkd,
although they are not supported by the daemon, a nixos receipe
creates the switch and attached required interfaces (just like
the scripted version).

Vlans and internal interfaces are implemented following the
template format i.e. each interface is
described using an attributeSet (vlan and type at the moment).
If vlan is present, then interface is added to the vswitch with
given tag (access mode). Type internal enabled vswitch to create
interfaces (see openvswitch docs).

Added configuration for configuring supported openFlow version on
the vswitch

This commit is a split from the original PR #35127.

Motivation for this change

see referenced PR

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@netixx
Copy link
Contributor Author

netixx commented Feb 22, 2019

Rebased to master.

@volth have you been able to test this ?

It's been running on my home setup for a year or so without any hitch on my side.

@aanderse
Copy link
Member

aanderse commented Aug 4, 2019

@netixx are you able to address the above comments and continue with this PR?

@netixx netixx force-pushed the openvswitch-improved-systemd branch from 9be76a1 to e5c79f4 Compare August 11, 2019 11:20
@netixx
Copy link
Contributor Author

netixx commented Aug 11, 2019

Yes, sorry for the delay, the PR has been pending for a while and I was not monitoring it.

I also rebased to the current master to fix the conflicts. Let me know if it still needs modifying!

@aanderse
Copy link
Member

Does anyone know who we need to call in for review here?

@offlinehacker
Copy link
Contributor

offlinehacker commented Aug 13, 2019

I don't have time to properly review and test it, since I'm not using it anymore, but changes seem ok.

@netixx
Copy link
Contributor Author

netixx commented Aug 14, 2019

I don't know the policy about 'not so often' used configuration like this, so I let the more experienced people decide, but, if this request is merged, then it would be nice if this one was too: #53032 (since the existing openvswitch version is really old now).

@aanderse
Copy link
Member

Bumping up a level to @disassembler or @lheckemann 🤷‍♂️

@Mic92
Copy link
Member

Mic92 commented Sep 24, 2019

Maybe @teto can have a look.

@teto
Copy link
Member

teto commented Oct 3, 2019

I use neither networkd or ovs (just need it when running mininet but I don't actually test the SDN capabilities). I can see some breaking changes. Considering the few people using the module that may be fine.
@netixx would you mind adding yourself as the maintainer of the module. You changes complexify it so we need someone to potentially deal wit the aftermath :p

@netixx netixx force-pushed the openvswitch-improved-systemd branch from e5c79f4 to adb6d20 Compare October 4, 2019 05:59
@netixx
Copy link
Contributor Author

netixx commented Oct 4, 2019

Yes no problem. I just rebased and added myself as maintainer of the openvswitch nixos module.

@@ -129,6 +129,8 @@ in {
PIDFile = "/run/openvswitch/ovs-vswitchd.pid";
# Use service type 'forking' to correctly determine when vswitchd is ready.
Type = "forking";
Restart = "always";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would on-failure also work here?

Suggested change
Restart = "always";
Restart = "on-failure";

@Mic92
Copy link
Member

Mic92 commented Oct 4, 2019

@netixx Since there seems nobody else to test this, could you give me an example configuration?

@netixx
Copy link
Contributor Author

netixx commented Oct 6, 2019

The following example creates a vswitch named vswitch with one internal (= system) interface named test, with vlan 100 encapsulation (like SVI 100 in a switch, with eth0 configured as trunk).

The test interface can then be used as a regular interface in the system (works with systemd configuration mode, since scripted has problems on its own).

networking.vswitches = {
  vswitch = {
    interfaces = [
      {
        name="eth0";
      }
      {
        name="test";
        vlan=100;
        type="internal";
      }
    ];
  };
};

I this something that could help you ?

@kmcopper
Copy link
Contributor

Any plans on getting this into unstable/master?

@netixx netixx force-pushed the openvswitch-improved-systemd branch from adb6d20 to 27b6b15 Compare October 29, 2019 20:10
@netixx
Copy link
Contributor Author

netixx commented Oct 29, 2019

I rebased/fix conflicts with master branch.

@netixx netixx mentioned this pull request Nov 13, 2019
10 tasks
Systemd dependencies for scripted mode
were refactored according to analysis in NixOS#34586.

networking.vswitches can now be used with systemd-networkd,
although they are not supported by the daemon, a nixos receipe
creates the switch and attached required interfaces (just like
the scripted version).

Vlans and internal interfaces are implemented following the
  template format i.e. each interface is
described using an attributeSet (vlan and type at the moment).
If vlan is present, then interface is added to the vswitch with
given tag (access mode). Type internal enabled vswitch to create
interfaces (see openvswitch docs).

Added configuration for configuring supported openFlow version on
the vswitch

This commit is a split from the original PR NixOS#35127.
@netixx netixx force-pushed the openvswitch-improved-systemd branch from 27b6b15 to cd3597b Compare December 15, 2019 20:16
@netixx
Copy link
Contributor Author

netixx commented Feb 21, 2020

Any hope of getting this merged ?

@Mic92 Mic92 merged commit 1ddb140 into NixOS:master Feb 21, 2020
@Mic92
Copy link
Member

Mic92 commented Feb 21, 2020

Tested using the following snippet:

  networking.vswitches.vswitch.interfaces = {
     wlan0 = {};
     test = {
       vlan=100;
       type="internal";
     };
  };

@netixx
Copy link
Contributor Author

netixx commented Mar 19, 2020

The idea was to comply with the name of the component http://www.openvswitch.org//support/dist-docs/ovs-vswitchd.8.pdf and make it clear the processed belong to OVS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants