[pve-devel] [PATCH pve-network v2 10/19] sdn: commit fabrics config to running configuration
Gabriel Goller
g.goller at proxmox.com
Fri Apr 4 18:28:46 CEST 2025
From: Stefan Hanreich <s.hanreich at proxmox.com>
Save the fabrics configuration in the running configuration, when
applying the SDN configuration. This causes the FRR configuration to
be actually generated for the openfabric and ospf plugins, since the
FRR configuration is generated from the running configuration.
Signed-off-by: Stefan Hanreich <s.hanreich at proxmox.com>
Co-authored-by: Gabriel Goller <g.goller at proxmox.com>
Signed-off-by: Gabriel Goller <g.goller at proxmox.com>
---
src/PVE/Network/SDN.pm | 7 ++++++-
src/PVE/Network/SDN/Fabrics.pm | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/PVE/Network/SDN.pm b/src/PVE/Network/SDN.pm
index 14486e94b3c4..bed3f9e5e50d 100644
--- a/src/PVE/Network/SDN.pm
+++ b/src/PVE/Network/SDN.pm
@@ -155,13 +155,18 @@ sub commit_config {
my $zones_cfg = PVE::Network::SDN::Zones::config();
my $controllers_cfg = PVE::Network::SDN::Controllers::config();
my $subnets_cfg = PVE::Network::SDN::Subnets::config();
+ my $fabrics_config = PVE::Network::SDN::Fabrics::config();
my $vnets = { ids => $vnets_cfg->{ids} };
my $zones = { ids => $zones_cfg->{ids} };
my $controllers = { ids => $controllers_cfg->{ids} };
my $subnets = { ids => $subnets_cfg->{ids} };
- $cfg = { version => $version, vnets => $vnets, zones => $zones, controllers => $controllers, subnets => $subnets };
+ for my $id (sort keys %$fabrics_config) {
+ $fabrics_config->{$id} = $fabrics_config->{$id}->get_inner();
+ }
+
+ $cfg = { version => $version, vnets => $vnets, zones => $zones, controllers => $controllers, subnets => $subnets, fabrics => $fabrics_config };
cfs_write_file($running_cfg, $cfg);
}
diff --git a/src/PVE/Network/SDN/Fabrics.pm b/src/PVE/Network/SDN/Fabrics.pm
index 7e0ca8f09341..c29a38722fab 100644
--- a/src/PVE/Network/SDN/Fabrics.pm
+++ b/src/PVE/Network/SDN/Fabrics.pm
@@ -65,7 +65,7 @@ sub config_for_protocol {
# required because if the config hasn't been applied yet once after the
# introduction of fabrics then the keys do not exist in the running
# config so we default to an empty hash
- my $protocol_config = $running_config->{$protocol}->{ids} // {};
+ my $protocol_config = $running_config->{fabrics}->{$protocol} // {};
return $module->running_config($protocol_config);
}
--
2.39.5
More information about the pve-devel
mailing list