public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH docs/network v2 0/3] improve behavior of frr service when pre-installed
@ 2025-04-08 22:15 Stefan Hanreich
  2025-04-08 22:15 ` [pve-devel] [PATCH pve-network v2 1/2] frr: remove erroneous outfunc from frr-reload command Stefan Hanreich
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Stefan Hanreich @ 2025-04-08 22:15 UTC (permalink / raw)
  To: pve-devel

Fixes the issue of the FRR service getting started, but not enabled when
applying an SDN configuration and updates the docs to reflect the new behavior.

Changes from v1 to v2:
* additionally fix the outfunc in the reload command, which caused a regression
  with frr-pythontools 10.2.1
* move the enabled check before the invocation of frr-reload.py

pve-network:

Stefan Hanreich (2):
  frr: remove erroneous outfunc from frr-reload command
  frr: enable and start frr on reloading the controller config

 src/PVE/Network/SDN/Controllers/EvpnPlugin.pm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)


pve-docs:

Stefan Hanreich (1):
  sdn: frr update documentation for installing frr package

 pvesdn.adoc | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)


Summary over all repositories:
  2 files changed, 13 insertions(+), 13 deletions(-)

-- 
Generated by git-murpp 0.8.0

_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pve-devel] [PATCH pve-network v2 1/2] frr: remove erroneous outfunc from frr-reload command
  2025-04-08 22:15 [pve-devel] [PATCH docs/network v2 0/3] improve behavior of frr service when pre-installed Stefan Hanreich
@ 2025-04-08 22:15 ` Stefan Hanreich
  2025-04-08 22:15 ` [pve-devel] [PATCH pve-network v2 2/2] frr: enable and start frr on reloading the controller config Stefan Hanreich
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Stefan Hanreich @ 2025-04-08 22:15 UTC (permalink / raw)
  To: pve-devel

Prior to the upgrade to frr-pythontools 10.2.1, frr-reload.py did not
print any output to STDOUT, which masked the erroneous outfunc
provided in run_command. With 10.2.1 frr-reload.py now prints to
STDOUT, which triggers the codepath for invoking the outfunc, leading
to an error when invoking frr-reload.py. By removing the outfunc the
invocation works again.

In addition to fixing the regression introduced, we also now print the
frr-reload.py informational output to the tasklog, which can be
helpful in debugging any issues when reloading the frr configuration.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
---
 src/PVE/Network/SDN/Controllers/EvpnPlugin.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm b/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm
index c245ea2..535c1e6 100644
--- a/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm
+++ b/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm
@@ -634,7 +634,7 @@ sub reload_controller {
 
     if (-e $conf_file && -e $bin_path) {
 	eval {
-	    run_command([$bin_path, '--stdout', '--reload', $conf_file], outfunc => {}, errfunc => $err);
+	    run_command([$bin_path, '--stdout', '--reload', $conf_file], errfunc => $err);
 	};
 	if ($@) {
 	    warn "frr reload command fail. Restarting frr.";
-- 
2.39.5


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pve-devel] [PATCH pve-network v2 2/2] frr: enable and start frr on reloading the controller config
  2025-04-08 22:15 [pve-devel] [PATCH docs/network v2 0/3] improve behavior of frr service when pre-installed Stefan Hanreich
  2025-04-08 22:15 ` [pve-devel] [PATCH pve-network v2 1/2] frr: remove erroneous outfunc from frr-reload command Stefan Hanreich
@ 2025-04-08 22:15 ` Stefan Hanreich
  2025-04-08 22:15 ` [pve-devel] [PATCH pve-docs v2 1/1] sdn: frr update documentation for installing frr package Stefan Hanreich
  2025-04-09  6:21 ` [pve-devel] applied: [PATCH docs/network v2 0/3] improve behavior of frr service when pre-installed Thomas Lamprecht
  3 siblings, 0 replies; 5+ messages in thread
From: Stefan Hanreich @ 2025-04-08 22:15 UTC (permalink / raw)
  To: pve-devel

Since we now ship frr with Proxmox VE, the frr service is available on
the nodes but disabled on install. Prior to that, users had to
manually install frr, which automatically enabled the service. When
first applying a SDN configuration with an EVPN controller, we always
fell back to restarting the frr service, because reloading fails when
the daemon isn't running. This fallback to restarting leads to the
service running but still being in the disabled state. This means that
the EVPN setup is working until the next reboot. To avoid the
situation where users configure an EVPN controller and everything
seems to be working, until a restart breaks the EVPN setup,
additionally enable and start the frr service before trying to reload
the configuration.

We enable the service after checking for the existence of
frr-pythontools in order to avoid the situation where users apply an
SDN configuration with an EVPN controller, but reloading fails due to
a missing frr-pythontools package. Since we do an early return there,
we never fell back to restarting the service in case frr-pythontools
was not available. If we enabled the service before the check, the
configuration would apply after a reboot since it already got written
to the frr configuration file.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
---
 src/PVE/Network/SDN/Controllers/EvpnPlugin.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm b/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm
index 535c1e6..5b1a9aa 100644
--- a/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm
+++ b/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm
@@ -625,6 +625,9 @@ sub reload_controller {
 	return;
     }
 
+    run_command(['systemctl', 'enable', '--now', 'frr'])
+	if !-e "/etc/systemd/system/multi-user.target.wants/frr.service";
+
     my $err = sub {
 	my $line = shift;
 	if ($line =~ /ERROR:/) {
-- 
2.39.5


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pve-devel] [PATCH pve-docs v2 1/1] sdn: frr update documentation for installing frr package
  2025-04-08 22:15 [pve-devel] [PATCH docs/network v2 0/3] improve behavior of frr service when pre-installed Stefan Hanreich
  2025-04-08 22:15 ` [pve-devel] [PATCH pve-network v2 1/2] frr: remove erroneous outfunc from frr-reload command Stefan Hanreich
  2025-04-08 22:15 ` [pve-devel] [PATCH pve-network v2 2/2] frr: enable and start frr on reloading the controller config Stefan Hanreich
@ 2025-04-08 22:15 ` Stefan Hanreich
  2025-04-09  6:21 ` [pve-devel] applied: [PATCH docs/network v2 0/3] improve behavior of frr service when pre-installed Thomas Lamprecht
  3 siblings, 0 replies; 5+ messages in thread
From: Stefan Hanreich @ 2025-04-08 22:15 UTC (permalink / raw)
  To: pve-devel

The frr service now gets automatically enabled when applying an SDN
configuration with an EVPN controller present. Reflect this change in
the documentation. Also add a note for users upgrading from prior
versions, that they still need to install frr before applying the SDN
configuration.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
---
 pvesdn.adoc | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/pvesdn.adoc b/pvesdn.adoc
index 5e58cc3..eef2abf 100644
--- a/pvesdn.adoc
+++ b/pvesdn.adoc
@@ -115,20 +115,17 @@ FRRouting
 ~~~~~~~~~
 
 The {pve} SDN stack uses the https://frrouting.org/[FRRouting] project for
-advanced setups. This is currently opt-in.
+advanced setups. Since version 8.4 FRR is automatically included in {pve}
+and gets automatically enabled when applying an SDN configuration with an EVPN
+controller configured.
 
-To use the SDN routing integration you need to install the `frr-pythontools`
-package on all nodes:
+If you upgraded from an earlier version, you need to install the frr and
+frr-pythontools packages before applying an SDN configuration with an EVPN
+controller:
 
 ----
 apt update
-apt install frr-pythontools
-----
-
-Then enable the frr service on all nodes:
-
-----
-systemctl enable frr.service
+apt install frr frr-pythontools
 ----
 
 [[pvesdn_main_configuration]]
@@ -450,8 +447,8 @@ EVPN Controller
 The `EVPN`, zone requires an external controller to manage the control plane.
 The EVPN controller plugin configures the Free Range Routing (frr) router.
 
-To enable the EVPN controller, you need to enable FRR on every node, see
-xref:pvesdn_install_frrouting[install FRRouting].
+If you upgraded {pve} from a version earlier than 8.4, you need to install FRR,
+see xref:pvesdn_install_frrouting[install FRRouting].
 
 EVPN controller configuration options:
 
-- 
2.39.5


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pve-devel] applied: [PATCH docs/network v2 0/3] improve behavior of frr service when pre-installed
  2025-04-08 22:15 [pve-devel] [PATCH docs/network v2 0/3] improve behavior of frr service when pre-installed Stefan Hanreich
                   ` (2 preceding siblings ...)
  2025-04-08 22:15 ` [pve-devel] [PATCH pve-docs v2 1/1] sdn: frr update documentation for installing frr package Stefan Hanreich
@ 2025-04-09  6:21 ` Thomas Lamprecht
  3 siblings, 0 replies; 5+ messages in thread
From: Thomas Lamprecht @ 2025-04-09  6:21 UTC (permalink / raw)
  To: Proxmox VE development discussion, Stefan Hanreich

Am 09.04.25 um 00:15 schrieb Stefan Hanreich:
> Fixes the issue of the FRR service getting started, but not enabled when
> applying an SDN configuration and updates the docs to reflect the new behavior.
> 
> Changes from v1 to v2:
> * additionally fix the outfunc in the reload command, which caused a regression
>   with frr-pythontools 10.2.1
> * move the enabled check before the invocation of frr-reload.py
> 
> pve-network:
> 
> Stefan Hanreich (2):
>   frr: remove erroneous outfunc from frr-reload command
>   frr: enable and start frr on reloading the controller config
> 
>  src/PVE/Network/SDN/Controllers/EvpnPlugin.pm | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> 
> pve-docs:
> 
> Stefan Hanreich (1):
>   sdn: frr update documentation for installing frr package
> 
>  pvesdn.adoc | 21 +++++++++------------
>  1 file changed, 9 insertions(+), 12 deletions(-)
> 
> 
> Summary over all repositories:
>   2 files changed, 13 insertions(+), 13 deletions(-)
> 


applied, thanks!


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-04-09  6:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-08 22:15 [pve-devel] [PATCH docs/network v2 0/3] improve behavior of frr service when pre-installed Stefan Hanreich
2025-04-08 22:15 ` [pve-devel] [PATCH pve-network v2 1/2] frr: remove erroneous outfunc from frr-reload command Stefan Hanreich
2025-04-08 22:15 ` [pve-devel] [PATCH pve-network v2 2/2] frr: enable and start frr on reloading the controller config Stefan Hanreich
2025-04-08 22:15 ` [pve-devel] [PATCH pve-docs v2 1/1] sdn: frr update documentation for installing frr package Stefan Hanreich
2025-04-09  6:21 ` [pve-devel] applied: [PATCH docs/network v2 0/3] improve behavior of frr service when pre-installed Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal