[pve-devel] [PATCH pve-manager 1/4] pve-sdn-commit: fix reloading logic

Stefan Hanreich s.hanreich at proxmox.com
Thu Jul 17 17:28:38 CEST 2025


The API for generating the SDN configuration has been changed in the
fabrics patch series ('387cc48'). Use the new API to commit the SDN
configuration on boot, since otherwise the one-shot service fails to
apply the SDN configuration on boot.

The service was also missing an ifreload, since the ifupdown2 config
gets regenerated by SDN and needs to be applied before generating the
FRR configuration in order for the FRR config generation to work
properly.

Signed-off-by: Stefan Hanreich <s.hanreich at proxmox.com>
---
 bin/pve-sdn-commit | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/bin/pve-sdn-commit b/bin/pve-sdn-commit
index 2654e17ed..09e4387c5 100644
--- a/bin/pve-sdn-commit
+++ b/bin/pve-sdn-commit
@@ -4,11 +4,26 @@ use strict;
 use warnings;
 
 use PVE::Network::SDN;
+use PVE::Tools;
 
+my $previous_config_has_frr = PVE::Network::SDN::running_config_has_frr();
 PVE::Network::SDN::commit_config();
 
-PVE::Network::SDN::generate_zone_config();
+my $new_config_has_frr = PVE::Network::SDN::running_config_has_frr();
+my $skip_frr = !($previous_config_has_frr || $new_config_has_frr);
+
+PVE::Network::SDN::generate_etc_network_config();
 PVE::Network::SDN::generate_dhcp_config();
-PVE::Network::SDN::generate_controller_config(1);
+
+my $err = sub {
+    my $line = shift;
+    if ($line =~ /(warning|error): (\S+):/) {
+        print "$2 : $line \n";
+    }
+};
+
+PVE::Tools::run_command(['ifreload', '-a'], errfunc => $err);
+
+PVE::Network::SDN::generate_frr_config(1) if !$skip_frr;
 
 exit 0;
-- 
2.39.5




More information about the pve-devel mailing list