all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager/network 0/2] Improve FRR reloading logic
@ 2025-08-05  8:29 Stefan Hanreich
  2025-08-05  8:29 ` [pve-devel] [PATCH pve-manager 1/1] network: improve " Stefan Hanreich
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Stefan Hanreich @ 2025-08-05  8:29 UTC (permalink / raw)
  To: pve-devel

Follow-up to the stop gap fix in [1].

This should handle all cases that we need to consider:

* Do not overwrite existing FRR configurations, unless we need to generate our
own FRR configuration.

* Do not trigger a FRR enable when reloading the host configuration, even though
there is no FRR configuration.

* Overwrite the FRR configuration with an empty configuration if all SDN
entities using FRR got deleted.

* Regenerate the FRR configuration when the host network configuration changes,
since this might affect the generated FRR configuration.


[1] https://git.proxmox.com/?p=pve-manager.git;a=commit;h=6c5295a1cdb6ec872ddf997cae030817dffff106

pve-manager:

Stefan Hanreich (1):
  network: improve reloading logic

 PVE/API2/Network.pm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)


pve-network:

Stefan Hanreich (1):
  sdn: api: always send regenerate-frr parameter

 src/PVE/API2/Network/SDN.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


Summary over all repositories:
  2 files changed, 9 insertions(+), 3 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-manager 1/1] network: improve reloading logic
  2025-08-05  8:29 [pve-devel] [PATCH manager/network 0/2] Improve FRR reloading logic Stefan Hanreich
@ 2025-08-05  8:29 ` Stefan Hanreich
  2025-08-05  8:29 ` [pve-devel] [PATCH pve-network 1/1] sdn: api: always send regenerate-frr parameter Stefan Hanreich
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Stefan Hanreich @ 2025-08-05  8:29 UTC (permalink / raw)
  To: pve-devel

The old behavior was *always* reloading the network configuration,
which worked as long as FRR was not pre-installed, but the change in
db03d261 coupled with the fact that we now ship with FRR caused FRR to
be enabled on applying the network configuration via the Web UI.

The stop gap fix in e1b9466d solved this behavior, but had the issue
that we need to possibly regenerate the FRR configuration if the host
configuration changes, since some controllers generate their
configuration based on the host network configuration.

pve-network now always sends the regenerate-frr parameter, so we can
discern whether a request came from SDN or is a manual request that is
requesting a specific behavior. With this information the reloading
logic can be improved as follows:

* Honor the parameter if it is set
* reload only if there are any FRR entities in the SDN configuration

This should handle all cases that we need to consider:

* Do not overwrite existing FRR configurations, unless we need to
  generate our own FRR configuration.

* Do not trigger a FRR enable when reloading the host configuration,
  even though there is no FRR configuration.

* Overwrite the FRR configuration with an empty configuration if all
  SDN entities using FRR got deleted.

* Regenerate the FRR configuration when the host network configuration
  changes, since this might affect the generated FRR configuration.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
---
 PVE/API2/Network.pm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/PVE/API2/Network.pm b/PVE/API2/Network.pm
index b423e19b5..28e060714 100644
--- a/PVE/API2/Network.pm
+++ b/PVE/API2/Network.pm
@@ -932,7 +932,13 @@ __PACKAGE__->register_method({
             };
             PVE::Tools::run_command(['ifreload', '-a'], errfunc => $err);
 
-            if ($have_sdn && $regenerate_frr) {
+            if (defined($regenerate_frr)) {
+                # SDN is requesting a reload, so we abide by the parameter set
+                # by SDN>
+                PVE::Network::SDN::generate_frr_config(1) if $regenerate_frr;
+            } elsif (PVE::Network::SDN::running_config_has_frr()) {
+                # Reload is coming from the Web UI, so we reload if there are
+                # FRR entities in the SDN config.
                 PVE::Network::SDN::generate_frr_config(1);
             }
         };
-- 
2.47.2


_______________________________________________
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 1/1] sdn: api: always send regenerate-frr parameter
  2025-08-05  8:29 [pve-devel] [PATCH manager/network 0/2] Improve FRR reloading logic Stefan Hanreich
  2025-08-05  8:29 ` [pve-devel] [PATCH pve-manager 1/1] network: improve " Stefan Hanreich
@ 2025-08-05  8:29 ` Stefan Hanreich
  2025-08-05  8:57 ` [pve-devel] [PATCH manager/network 0/2] Improve FRR reloading logic Friedrich Weber
  2025-08-05  9:11 ` Gabriel Goller
  3 siblings, 0 replies; 5+ messages in thread
From: Stefan Hanreich @ 2025-08-05  8:29 UTC (permalink / raw)
  To: pve-devel

This makes it possible to check for the definedness of the parameter
and adapt the behavior of the reloading endpoint depending on that
information. See the commit in pve-manager for more information.

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

diff --git a/src/PVE/API2/Network/SDN.pm b/src/PVE/API2/Network/SDN.pm
index 16a8e2c..af00b1a 100644
--- a/src/PVE/API2/Network/SDN.pm
+++ b/src/PVE/API2/Network/SDN.pm
@@ -93,7 +93,7 @@ my $create_reload_network_worker = sub {
     my ($nodename, $regenerate_frr) = @_;
 
     my @command = ('pvesh', 'set', "/nodes/$nodename/network");
-    push(@command, '--regenerate-frr') if $regenerate_frr;
+    push(@command, '--regenerate-frr', $regenerate_frr);
 
     # FIXME: how to proxy to final node ?
     my $upid;
@@ -299,7 +299,7 @@ __PACKAGE__->register_method({
             $lock_token,
         );
 
-        my $regenerate_frr = $previous_config_has_frr || $new_config_has_frr;
+        my $regenerate_frr = ($previous_config_has_frr || $new_config_has_frr) ? 1 : 0;
 
         my $code = sub {
             $rpcenv->{type} = 'priv'; # to start tasks in background
-- 
2.47.2


_______________________________________________
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

* Re: [pve-devel] [PATCH manager/network 0/2] Improve FRR reloading logic
  2025-08-05  8:29 [pve-devel] [PATCH manager/network 0/2] Improve FRR reloading logic Stefan Hanreich
  2025-08-05  8:29 ` [pve-devel] [PATCH pve-manager 1/1] network: improve " Stefan Hanreich
  2025-08-05  8:29 ` [pve-devel] [PATCH pve-network 1/1] sdn: api: always send regenerate-frr parameter Stefan Hanreich
@ 2025-08-05  8:57 ` Friedrich Weber
  2025-08-05  9:11 ` Gabriel Goller
  3 siblings, 0 replies; 5+ messages in thread
From: Friedrich Weber @ 2025-08-05  8:57 UTC (permalink / raw)
  To: Proxmox VE development discussion, Stefan Hanreich

On 05/08/2025 10:29, Stefan Hanreich wrote:
> Follow-up to the stop gap fix in [1].
> 
> This should handle all cases that we need to consider:
> 
> * Do not overwrite existing FRR configurations, unless we need to generate our
> own FRR configuration.
> 
> * Do not trigger a FRR enable when reloading the host configuration, even though
> there is no FRR configuration.
> 
> * Overwrite the FRR configuration with an empty configuration if all SDN
> entities using FRR got deleted.
> 
> * Regenerate the FRR configuration when the host network configuration changes,
> since this might affect the generated FRR configuration.
> 
> 
> [1] https://git.proxmox.com/?p=pve-manager.git;a=commit;h=6c5295a1cdb6ec872ddf997cae030817dffff106

Thanks for the patch! Installed on my host that doesn't use fabrics (frr is disabled and not running), and when applying the network configuration, frr is not enabled.
When applying my SDN configuration (that only uses Simple Zones, no fabrics), frr is not enabled either.

I haven't tested on a setup *with* fabrics, though.


_______________________________________________
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

* Re: [pve-devel] [PATCH manager/network 0/2] Improve FRR reloading logic
  2025-08-05  8:29 [pve-devel] [PATCH manager/network 0/2] Improve FRR reloading logic Stefan Hanreich
                   ` (2 preceding siblings ...)
  2025-08-05  8:57 ` [pve-devel] [PATCH manager/network 0/2] Improve FRR reloading logic Friedrich Weber
@ 2025-08-05  9:11 ` Gabriel Goller
  3 siblings, 0 replies; 5+ messages in thread
From: Gabriel Goller @ 2025-08-05  9:11 UTC (permalink / raw)
  To: Stefan Hanreich; +Cc: pve-devel

Consider:

Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>


_______________________________________________
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-08-05  9:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-05  8:29 [pve-devel] [PATCH manager/network 0/2] Improve FRR reloading logic Stefan Hanreich
2025-08-05  8:29 ` [pve-devel] [PATCH pve-manager 1/1] network: improve " Stefan Hanreich
2025-08-05  8:29 ` [pve-devel] [PATCH pve-network 1/1] sdn: api: always send regenerate-frr parameter Stefan Hanreich
2025-08-05  8:57 ` [pve-devel] [PATCH manager/network 0/2] Improve FRR reloading logic Friedrich Weber
2025-08-05  9:11 ` Gabriel Goller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal