opnsense / plugins

OPNsense plugin collection
https://opnsense.org/
BSD 2-Clause "Simplified" License
842 stars 634 forks source link

net/frr: leverage frr-reload.py to add hot reload capabilities #2148

Closed marcquark closed 3 years ago

marcquark commented 3 years ago

Important notices Before you add a new report, we ask you kindly to acknowledge the following:

[x] I have read the contributing guide lines at https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md

[x] I have searched the existing issues and I'm convinced that mine is new.

[x] When the request is meant for an existing plugin, I've added its name to the title.

Is your feature request related to a problem? Please describe. Currently every time the FRR config is changed the daemons are restarted to apply the newly generated config files. This is problematic because a restart can lead to 10s of seconds or even minutes of downtime depending on the environment. Hot reloading has already been discussed in the forum and in #1436. I think we all agree it would be a great feature, and i think there's actually a way to implement it with moderate effort.

Describe the solution you'd like From the things i've read, the following steps would need to be done in order to make hot reloading available:

  1. (optional, but useful) Use integrated configuration mode for FRR, i.e. put all settings into one file which makes it easier to template/reload
  2. Add the frr7-pythontools package to OPNsense
  3. Adjust the plugin so that it templates a new config and applies it through the frr-reload.py script

Describe alternatives you've considered none

Additional context While not explicitly documented, it seems that frr-reload is already available with 7.4 and it's packaged, ready to be pulled in https://www.freshports.org/net/frr7-pythontools/

This change has some risks associated with it that should be discussed:

AdSchellevis commented 3 years ago

I've looked a bit at the same when working on https://github.com/opnsense/plugins/issues/2091, but to me the diff operation looked a bit dangerous (risk of inconsistencies). Adding frr7-pythontools as a first step is probably a good idea, but while trying to increase to overal quality of the plugin I would like to suggest being careful in adding soft reloads as standard (we might consider adding an "experimental" toggle to switch to reload on applying ui/api changes).

OPNsense-bot commented 3 years ago

This issue has been automatically timed-out (after 180 days of inactivity).

For more information about the policies for this repository, please read https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md for further details.

If someone wants to step up and work on this issue, just let us know, so we can reopen the issue and assign an owner to it.