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

networking.vswitches option does not work #34336

Closed
netixx opened this issue Jan 27, 2018 · 1 comment
Closed

networking.vswitches option does not work #34336

netixx opened this issue Jan 27, 2018 · 1 comment

Comments

@netixx
Copy link
Contributor

netixx commented Jan 27, 2018

Issue description

When using networking.vswitches configuration keys, system fails to reliably bring up the switch.

Logs show that the down script is executed just after the up script because de underlying device is down vsint-netdev.service: Unit is bound to inactive unit sys-subsystem-net-devices-vsint.device. Stopping, too.:

Feb 02 18:15:45 nixos systemd[1]: Starting Open vSwitch Interface vsint...
Feb 02 18:15:45 nixos vsint-netdev-start[27533]: Removing old Open vSwitch vsint...
Feb 02 18:15:45 nixos vsint-netdev-start[27533]: Adding Open vSwitch vsint...
Feb 02 18:15:45 nixos ovs-vsctl[27534]: ovs|00001|vsctl|INFO|Called as ovs-vsctl -- add-br vsint -- add-port vsint LAN --
Feb 02 18:15:45 nixos vsint-netdev-start[27533]: Adding OpenFlow rules for Open vSwitch vsint...
Feb 02 18:15:45 nixos systemd[1]: Started Open vSwitch Interface vsint.
Feb 02 18:15:45 nixos systemd[1]: vsint-netdev.service: Unit is bound to inactive unit sys-subsystem-net-devices-vsint.device. Stopping
Feb 02 18:15:45 nixos systemd[1]: Stopping Open vSwitch Interface vsint...
Feb 02 18:15:45 nixos ovs-vsctl[27550]: ovs|00001|vsctl|INFO|Called as ovs-vsctl --if-exists del-br vsint
Feb 02 18:15:45 nixos systemd[1]: Stopped Open vSwitch Interface vsint.

If it is of any relevance, I was working with renamed interfaces (using udev), inside a Virtualbox VM:

services.udev.extraRules= ''
  KERNEL=="eth*", ATTR{address}=="xx:xx:xx:xx:xx:xx", NAME="LAN"
''

Removing the sys-subsystem-net-devices-vsint.device dependency from BindsTo= seems to restore normal behaviour (although we loose unit shutdown when the device is disabled). Since the down script is basically deleting the device (maybe test this regarding flows), this dependency might not be necessary.

I have the VM close by and can perform tests easily.
Thank you for your help

Steps to reproduce

  1. Configure openvswitch bridge:
    networking.vswitches = { vsint = { interfaces=["LAN"]; }; };
  2. Rebuild system nixos-rebuild switch
  3. Run ovs-vsctl show, no (v)switch appears
  4. Reboot does not fix the problem

Technical details

Please run nix-shell -p nix-info --run "nix-info -m" and paste the
results.

  • system: "x86_64-linux"
  • host os: Linux 4.9.65, NixOS, 17.09.2253.559ebb7ed02 (Hummingbird)
  • multi-user?: no
  • sandbox: yes
  • version: nix-env (Nix) 1.11.15
  • channels(root): "nixos-17.09.2253.559ebb7ed02"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs
@netixx netixx changed the title Restarting vswitch service fails networking.vswitch option does not workopenvswitch service fails Feb 2, 2018
@netixx netixx changed the title networking.vswitch option does not workopenvswitch service fails networking.vswitch option does not work Feb 2, 2018
@netixx netixx changed the title networking.vswitch option does not work networking.vswitches option does not work Feb 2, 2018
netixx added a commit to netixx/nixpkgs that referenced this issue Feb 17, 2018
…artup

The service has a 'BindsTo' Dependency to sys-subsystem-vsiwtch.device
which causes the service to stop immediately after startup because the
add-br commands make the device flap somehow.

This patch moves creation of the device to 'ExecStartPre=' phase of the
service, where 'BindsTo' does not apply (tested, bu could not find docs
about this).

See NixOS#34336 for details
netixx added a commit to netixx/nixpkgs that referenced this issue Aug 30, 2018
Originnaly, the need was to fix NixOS#34336 and add features in NixOS#34851.

With remarks from @volth, openvswitch was upgraded to the latest
stable version (currenty 2.8.2). This remove ovs-monitor-ipsec
commands. LTS version is still available using
`config.virtualisation.vswitch.package = pkgs.openvswitch-lts`

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
 `networking.interfaces` 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).

Conflicts:
	pkgs/os-specific/linux/openvswitch/default.nix

Conflicts:
	pkgs/os-specific/linux/openvswitch/default.nix
netixx added a commit to netixx/nixpkgs that referenced this issue Aug 30, 2018
Originnaly, the need was to fix NixOS#34336 and add features in NixOS#34851.

With remarks from @volth, openvswitch was upgraded to the latest
stable version (currenty 2.9.2). This remove ovs-monitor-ipsec
commands. LTS version is still available using
`config.virtualisation.vswitch.package = pkgs.openvswitch-lts`

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
 `networking.interfaces` 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

Conflicts:
	nixos/modules/tasks/network-interfaces-scripted.nix
	nixos/modules/tasks/network-interfaces-systemd.nix
	nixos/modules/virtualisation/openvswitch.nix
	pkgs/os-specific/linux/openvswitch/default.nix
	pkgs/os-specific/linux/openvswitch/lts.nix
netixx added a commit to netixx/nixpkgs that referenced this issue Aug 30, 2018
Originnaly, the need was to fix NixOS#34336 and add features in NixOS#34851.

With remarks from @volth, openvswitch was upgraded to the latest
stable version (currenty 2.9.2). This remove ovs-monitor-ipsec
commands. LTS version is still available using
`config.virtualisation.vswitch.package = pkgs.openvswitch-lts`

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
 `networking.interfaces` 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

Conflicts:
	nixos/modules/virtualisation/openvswitch.nix
netixx added a commit to netixx/nixpkgs that referenced this issue Oct 8, 2018
Originnaly, the need was to fix NixOS#34336 and add features in NixOS#34851.

With remarks from @volth, openvswitch was upgraded to the latest
stable version (currenty 2.9.2). This remove ovs-monitor-ipsec
commands. LTS version is still available using
`config.virtualisation.vswitch.package = pkgs.openvswitch-lts`

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
 `networking.interfaces` 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
@netixx
Copy link
Contributor Author

netixx commented Oct 28, 2018

This issue is resolved by the referenced PR by using systemd-networkd

@netixx netixx closed this as completed Oct 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant