From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 5B4661FF0BC for ; Wed, 02 Dec 2026 16:21:40 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id B20322189A; Wed, 02 Dec 2026 16:20:02 +0100 (CET) From: Jonas Theisen To: pve-devel@lists.proxmox.com Subject: [PATCH manager v4 20/21] api: cluster: bulk migrate: skip VMs whose CPU is incompatible with the target Date: Wed, 2 Dec 2026 16:18:16 +0100 Message-ID: <20261202151831.414110-21-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: 1796224759957 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.055 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: 3HXINVMPAM6WCQGT6TLJJLN3IM645CZ2 X-Message-ID-Hash: 3HXINVMPAM6WCQGT6TLJJLN3IM645CZ2 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: The source node refuses to live migrate a VM to a node whose CPU cannot run it, but only in the migration task. Until then, it takes one of the parallel workers of the bulk migration, and it is counted as a failed migration without a reason in the bulk migration log. Check the migration preconditions of each VM first, as the bulk migration of a node already does, and skip VMs whose CPU is incompatible with the target with a warning stating the reason, like VMs that are already on the target. If the preconditions cannot be queried, the VM is migrated as before. Signed-off-by: Jonas Theisen --- PVE/API2/Cluster/BulkAction/Guest.pm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/PVE/API2/Cluster/BulkAction/Guest.pm b/PVE/API2/Cluster/BulkAction/Guest.pm index 4b0c1760..b6f18547 100644 --- a/PVE/API2/Cluster/BulkAction/Guest.pm +++ b/PVE/API2/Cluster/BulkAction/Guest.pm @@ -807,6 +807,21 @@ __PACKAGE__->register_method({ $params->{online} = $param->{online} if defined($param->{online}); $params->{'with-local-disks'} = $param->{'with-local-disks'} if defined($param->{'with-local-disks'}); + + # the migration would be refused anyway, but only after taking a worker slot + my $preconditions = + eval { make_get_request($api_client, "/nodes/$node/qemu/$vmid/migrate"); }; + log_warn("unable to check whether VM $vmid can be migrated - $@") if $@; + my $not_allowed = ($preconditions // {})->{not_allowed_nodes} // {}; + my $incompatible_cpu = + $not_allowed->{ $param->{target} }->{'incompatible-cpu'}; + if ($incompatible_cpu) { + log_warn( + "skipping VM $vmid, the CPU of the target node is incompatible: " + . join('; ', map { $_->{message} } $incompatible_cpu->@*) + . "\n"); + return 1; + } } my $url = "/nodes/$node/$type/$vmid/migrate"; -- 2.47.3