From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 91F071FF0BC for ; Wed, 02 Dec 2026 16:20:40 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id B5C9721809; Wed, 02 Dec 2026 16:19:38 +0100 (CET) From: Jonas Theisen To: pve-devel@lists.proxmox.com Subject: [PATCH manager v4 16/21] pvestatd: broadcast host CPU information relevant for live migration Date: Wed, 2 Dec 2026 16:18:12 +0100 Message-ID: <20261202151831.414110-17-j.theisen@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261202151831.414110-1-j.theisen@proxmox.com> References: <20261202151831.414110-1-j.theisen@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1796224751595 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.056 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: 5HZIY2JUVLYZ77FKY3ERRUWYZTVCZVQI X-Message-ID-Hash: 5HZIY2JUVLYZ77FKY3ERRUWYZTVCZVQI X-MailFrom: j.theisen@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: qemu-server checks whether the CPU of a target node can run a VM after a live migration, for example whether it has the same vendor and model as the source for VMs with the 'host' CPU model. Broadcast the information qemu-server provides for this, for example the CPU vendor and model name. It is queried in each cycle, so that information that could not be determined before is broadcast once it can, and broadcast again if it changed or the entry got lost. This is cheap, as the CPU information is cached. Signed-off-by: Jonas Theisen --- PVE/Service/pvestatd.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/PVE/Service/pvestatd.pm b/PVE/Service/pvestatd.pm index 8c0f3c37..a6ddf82b 100755 --- a/PVE/Service/pvestatd.pm +++ b/PVE/Service/pvestatd.pm @@ -23,6 +23,7 @@ use PVE::Storage; use PVE::Multipath::Status; use PVE::MultipathNotification; use PVE::QemuServer; +use PVE::QemuServer::Helpers; use PVE::QemuServer::Monitor; use PVE::LXC; use PVE::CGroup; @@ -174,6 +175,18 @@ my sub broadcast_static_node_info { } } +# Queried in each cycle, so that information that qemu-server could not determine before is +# broadcast once it can. +my sub broadcast_host_cpu_info { + my $host_cpu_info = PVE::QemuServer::Helpers::get_host_cpu_info(); + + my $info = JSON->new->canonical->utf8->encode($host_cpu_info); + + # re-broadcast if the entry got lost, for example after a restart of pmxcfs + my $old = PVE::Cluster::get_node_kv('host-cpu-info', $nodename)->{$nodename}; + PVE::Cluster::broadcast_node_kv('host-cpu-info', $info) if ($old // '') ne $info; +} + my ($cached_ip_links, $cached_ip_link_last_update) = (undef, 0); my $MAX_IP_LINK_CACHE_AGE_SECONDS = 15 * 60; # every 15 minutes @@ -299,6 +312,7 @@ sub update_node_status { PVE::PullMetric::update($pull_txn, 'node', $node_metric, $ctime); broadcast_static_node_info($maxcpu, $meminfo->{memtotal}); + broadcast_host_cpu_info(); } sub auto_ballooning { -- 2.47.3