From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 061531FF165 for ; Thu, 22 May 2025 18:23:42 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5FD1CB438; Thu, 22 May 2025 18:18:41 +0200 (CEST) From: Stefan Hanreich To: pve-devel@lists.proxmox.com Date: Thu, 22 May 2025 18:17:12 +0200 Message-Id: <20250522161731.537011-57-s.hanreich@proxmox.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250522161731.537011-1-s.hanreich@proxmox.com> References: <20250522161731.537011-1-s.hanreich@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.371 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods POISEN_SPAM_PILL 0.1 Meta: its spam POISEN_SPAM_PILL_1 0.1 random spam to be learned in bayes POISEN_SPAM_PILL_3 0.1 random spam to be learned in bayes RDNS_NONE 0.793 Delivered to internal network by a host with no rDNS SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record Subject: [pve-devel] [PATCH pve-manager v3 01/18] api: use new sdn config generation functions X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" From: Gabriel Goller With the introduction of fabrics, frr configuration generation and etc/network/interfaces generation has been reworked and renamed for better clarity, since now not only zones / controllers are responsible for generating the ifupdown / FRR configuration. Switch this endpoint over to use the new functions. We also add a new skip_frr parameter that skips FRR config generation if set. With the old FRR config generation logic, we never wrote an empty FRR configuration if all controllers got deleted. This meant that deleting all controllers still left the previous FRR configuration on the nodes, never disabling BGP / IS-IS. The new logic now writes an empty configuration if there is no controller / fabric configured, fixing this behavior. This has a side effect for users with an existing FRR configuration not managed by SDN, but utilizing other SDN features (zones, vnets, ...). Their manual FRR configuration would get overwritten when applying an SDN configuration. This is particularly an issue with full-mesh Ceph setups, that were set up according to our Wiki guide [1]. User with such a full-mesh setup could get their FRR configuration overwritten when using unrelated SDN features. Since this endpoint is called *after* committing the new SDN configuration, but handles writing the FRR configuration, we need a way to signal this endpoint to skip writing the FRR configuration from the `PUT /cluster/sdn` endpoint, where we can check for this case. [1] https://pve.proxmox.com/mediawiki/index.php?title=Full_Mesh_Network_for_Ceph_Server&oldid=12146 Co-authored-by: Stefan Hanreich Signed-off-by: Gabriel Goller --- PVE/API2/Network.pm | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/PVE/API2/Network.pm b/PVE/API2/Network.pm index 12ee6cca0..2ff729f7a 100644 --- a/PVE/API2/Network.pm +++ b/PVE/API2/Network.pm @@ -777,6 +777,11 @@ __PACKAGE__->register_method({ additionalProperties => 0, properties => { node => get_standard_option('pve-node'), + skip_frr => { + type => 'boolean', + description => 'Whether FRR config generation should get skipped or not.', + optional => 1, + }, }, }, returns => { type => 'string' }, @@ -791,6 +796,8 @@ __PACKAGE__->register_method({ my $current_config_file = "/etc/network/interfaces"; my $new_config_file = "/etc/network/interfaces.new"; + my $skip_frr = extract_param($param, 'skip_frr'); + assert_ifupdown2_installed(); my $worker = sub { @@ -798,7 +805,7 @@ __PACKAGE__->register_method({ rename($new_config_file, $current_config_file) if -e $new_config_file; if ($have_sdn) { - PVE::Network::SDN::generate_zone_config(); + PVE::Network::SDN::generate_etc_network_config(); PVE::Network::SDN::generate_dhcp_config(); } @@ -810,8 +817,8 @@ __PACKAGE__->register_method({ }; PVE::Tools::run_command(['ifreload', '-a'], errfunc => $err); - if ($have_sdn) { - PVE::Network::SDN::generate_controller_config(1); + if ($have_sdn && !$skip_frr) { + PVE::Network::SDN::generate_frr_config(1); } }; return $rpcenv->fork_worker('srvreload', 'networking', $authuser, $worker); @@ -868,3 +875,5 @@ __PACKAGE__->register_method({ return undef; }}); + +1; -- 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel