FS#41269 - [netctl] Please officially support openvswitch

Attached to Project: Arch Linux
Opened by Jonathan Hudson (stronnag) - Saturday, 19 July 2014, 19:25 GMT
Last edited by Jouke Witteveen (jouke) - Tuesday, 05 August 2014, 12:33 GMT
Task Type Feature Request
Category Arch Projects
Status Closed
Assigned To Jouke Witteveen (jouke)
Architecture All
Severity Very Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

Openvswitch is now in community and thus it would be useful if it were supported by netctl.

The attached files work with the repository versions of netctl (1.8-1) and openvswitch (2.1.2-3) at time of submission.

This request supersedes https://bugs.archlinux.org/task/35401

The maintainer's consideration is solicited.


-jonathan
This task depends upon

Closed by  Jouke Witteveen (jouke)
Tuesday, 05 August 2014, 12:33 GMT
Reason for closing:  Implemented
Additional comments about closing:  1d490
Comment by Jouke Witteveen (jouke) - Monday, 21 July 2014, 08:52 GMT
Is there a reason not to delete the interface in openvswitch_down?
Apart from that, it looks good.
Comment by Jonathan Hudson (stronnag) - Monday, 21 July 2014, 16:06 GMT
I did wonder about that. It's useful to clean things up for testing (removes unwanted interfaces) but it has little value for a stable / production environment.

Please feel free to remove the deletion code in down(). I have no strong opinion either way.

openvswitch_down() {
for ovs_client in "${BindsToInterfaces[@]}"; do
ip link set "$ovs_client" promisc off down
done
ip_unset
bring_interface_down "$Interface"
}


-jonathan

Comment by Jouke Witteveen (jouke) - Monday, 21 July 2014, 16:19 GMT
I was thinking about the bridge interface (ovs-br0 in the example). The rationale would be that a start/stop cycle should leave as little trace as possible. I know that 'start' doesn't necessarily create the bridge interface, but it still feels sane to delete it on 'stop': the fact that we never bind to the bridge interface suggests that netctl is responsible for its creation.

I'm sorry to bring this nitpicking up, but this is precisely the stuff that I am no expert on in the openvswitch case (i.e. what are the deletion commands and their side-effects).
Comment by Jonathan Hudson (stronnag) - Tuesday, 22 July 2014, 18:21 GMT
Jouke,

I am no expert on the matter, just a user for the single use case of a bridged interface for some lxc containers and libvirtd VMs. Assuming no deletion, once the device is in the openvswitch db, then the bridge will be instantiated (I assume) by the openvswitch module and then netctl just brings it up. Thus without the deletion command, once the bridge was defined in the ovs-db, it would always be instantiated (but not brought up) by loading the kernel module.

I don't think there is a perfect solution, but deletion on down is (IMHO) cleaner; we cannot cleanly detect if the bridge was extant or we created it. I'm sorry I don't feel qualified to provide a more definitive view.

-jonathan
Comment by Jouke Witteveen (jouke) - Tuesday, 22 July 2014, 22:15 GMT
I installed openvswitch to do some testing myself.
This is what I had in mind:

openvswitch_down() {
for ovs_client in "${BindsToInterfaces[@]}"; do
ip link set "$ovs_client" promisc off down
done
ip_unset
$OVSCTL del-br "$Interface"
}

Any comments on that?
Additionally, I found that the ovs-vswitchd systemd service has to be running before the $OVSCTL is usable. Is this correct? If so, we need to find a way to specify this dependency.
Comment by Jonathan Hudson (stronnag) - Thursday, 24 July 2014, 19:05 GMT
That works fine.

You are correct on the dependency. I've (perhaps luckily) never seen a problem, but I appreciate there could be one.


Comment by Jouke Witteveen (jouke) - Sunday, 27 July 2014, 20:04 GMT
How about this?
Comment by Jonathan Hudson (stronnag) - Monday, 28 July 2014, 20:37 GMT
Excellent. I think we have a winner!

-jonathan

Loading...