ifupdown-ng / ifupdown-ng

flexible ifup/ifdown implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Network Teaming executor

EasyNetDev opened this issue · comments

Hi all,

I'm working to polish the final release of team executor.
I really appreciate some inputs regarding this executor, because took me some time to build it.
With version 0.9.4 I'm running 3 routers and 2 VMs using this executor.

Here is the link to my work: Network Teaming Executor for ifupdown-ng

Features:

  • Add support for network teaming
  • Is lighter than bonding, the team driver has a smaller footprint and the controller besides in user space.
  • Can be used with all 5 runners: broadcast, roundrobin, activebackup, loadbalance and lacp.
  • Each runner it can be configured with all parameters available for teamd.
  • All link watchers can be configured with all parameters available in teamd.
  • Each port can have specific parameters for the link watcher, but needs just an iface XXX entry whitout auto object.
  • It can use systemd service or in case the OS is non-systemd is executing the daemon from the script.
  • In case of systemd, the service is in format teamd@.service and for each interface the configuration is built in /run/ifteaming.${IFACE} and is used by teamd@.service to start the interface from executor. There is not autorun at boot for the service, just from executor.

I will release the final patch as version 1.0

Updates:

  • The latest version of teaming I've split the executor in 4 files:
    • executor located in /usr/libexec/ifupdonw-ng/team which is a very small script and it take care only for creating the vritual interface for teaming. In this way we will assure that all subinterfaces or bridges that are depending on this interface will not fail for configuration. The same script is responsable to start teamd@.service for each teaming interface.
    • /usr/sbin/teaming-build-config which is responsable to read the ifupdown-ng configuration for the specific teaming interface and it builds the JSON configuration for teamd daemon. It is executed in ExecStartPre by teamd@.service.
    • /usr/sbin/teaming-service which is a hellper for teamd daemon to check existence of teaming members interfaces and mandatory put them in shutdown before starting the daemon. Is crucial this step because daemon will fail to start if one teaming member is already UP.
    • Service teamd@.service which is responsable to execute in ExecStartPre the script to build teaming configuration and then to start the daemon via the teaming-service hellper.
  • Moving out the configuration builder from executor will benefit few things:
    1. Any reconfiguration of the teaming interface we DON'T NEED to do ifdown team0; ifup team0. This will cause all subinterfaces or master interfaces to loose the whole configuration and ifupdown-ng will still thinks that the VLAN under this interface are configured.
    2. The reconfiguration of the teaming interface will just flap for few seconds the link but will not cause inconsistent in ifupdown-ng. We have to use just systemctl restart teamd@teamd0.service to reload what we changed in interfaces config.

Kind regards,
EasyNetDev

Hi all,

I've notice some drawbacks of the current implementation of teaming executor.

  1. If the configuration is changed, an ifdown then ifup commands needs to be executed to reload the config.
  2. When ifdown is executed the teaming virtual interface will be deleted from the system.
  3. This can cause of deletion of all subinterfaces created under the main virtual interface, like VLANs and VRRPs MACVLANs.
  4. Can cause instability in the system.

For this reason I split the configuration and daemon start in 2 more scripts:

  1. /usr/sbin/teaming-build-config
  2. /usr/sbin/teaming-service
  3. The teaming executor will be responsible only for the creation of the main virtual interface using: ip link add $IFACE type team and to start the systemd service.
  4. teamd@.service will have an additional directives:
    • RuntimeDirectory=teamd
    • RuntimeDirectoryPreserve=yes
    • ExecStartPre=/usr/sbin/teaming-build-config %i
    • ExecStart=/usr/sbin/teaming-service %i

ExecStartPre will be responsible to read the ifupdown-ng configuration using ifquery -p $IFACE, parse it and create the configuration file under /run/teamd/ifteaming.$IFACE.

Each time you need to add/remove an interface from interface teaming configuration, just systemctl restart teamd@IFACE and it will load the new configuration.

I will propose a new PR with my new approach.

I notice this disadvantage in my router when I had to reconfigure a teaming interface and each time I is ifdown all subinterfaces and then you have to bring-up all of them. With my new approach will not be anymore the case.

Linked to: