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 946CE1FF17E for ; Thu, 13 Nov 2025 17:20:32 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 61CEA22A41; Thu, 13 Nov 2025 17:20:09 +0100 (CET) From: Stefan Hanreich To: pve-devel@lists.proxmox.com Date: Thu, 13 Nov 2025 17:19:17 +0100 Message-ID: <20251113161926.793020-15-s.hanreich@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251113161926.793020-1-s.hanreich@proxmox.com> References: <20251113161926.793020-1-s.hanreich@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.174 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 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 v4 03/10] pvestatd: add network resource to status reporting 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 The new network resource will act as the top-level resource for all networking entities (including SDN entities). The network resource contains a network_type field, which indicates the type of networking resource - similar to how the storage plugin handles different types of storages. For now, it contains SDN fabrics and the SDN zones have been copied over as well. The main reason for moving over to a new resource type is the current ID schema of the SDN resource, which is 'sdn/{zone_id}'. This makes it hard to extend without the possibility of ID collisions. Additionally, since the ID is used in several places throughout the backend / UI, changing the schema would break compatibility with nodes that are on an earlier version and would be an API break as well. With this patch, nodes will still broadcast the old format for backwards-compatibility. A subsequent patch for the resources API will handle this case and ignore the old SDN resources from nodes that are already sending the new format, to avoid including zones twice in the returned resource data. Co-authored-by: Stefan Hanreich Signed-off-by: Gabriel Goller Signed-off-by: Stefan Hanreich --- PVE/Service/pvestatd.pm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/PVE/Service/pvestatd.pm b/PVE/Service/pvestatd.pm index 618d6139a..572eb7eb5 100755 --- a/PVE/Service/pvestatd.pm +++ b/PVE/Service/pvestatd.pm @@ -15,6 +15,7 @@ use PVE::CpuSet; use Filesys::Df; use PVE::INotify; use PVE::Network; +use PVE::RS::SDN::Fabrics; use PVE::NodeConfig; use PVE::Cluster qw(cfs_read_file); use PVE::Storage; @@ -775,6 +776,28 @@ sub update_sdn_status { } } +sub update_network_status { + my $network_status = {}; + + my ($fabric_status) = PVE::RS::SDN::Fabrics::status(); + for my $fabric (values $fabric_status->%*) { + $network_status->{"fabric/$fabric->{network}"} = $fabric; + } + + my ($zone_status, $vnet_status) = PVE::Network::SDN::Zones::status(); + for my $id (sort keys $zone_status->%*) { + my $zone = $zone_status->{$id}; + + $zone->{'network-type'} = 'zone'; + $zone->{network} = $id; + $zone->{type} = 'network'; + + $network_status->{"zone/$id"} = $zone; + } + + PVE::Cluster::broadcast_node_kv("network", encode_json($network_status)); +} + my $broadcast_version_info_done = 0; my sub broadcast_version_info : prototype() { if ( @@ -840,6 +863,10 @@ sub update_status { $err = $@; syslog('err', "sdn status update error: $err") if $err; + eval { update_network_status(); }; + $err = $@; + syslog('err', "network status update error: $err") if $err; + eval { broadcast_version_info(); }; $err = $@; syslog('err', "version info update error: $err") if $err; -- 2.47.3 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel