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 6CE821FF0BC for ; Wed, 02 Dec 2026 16:20:14 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 93876218DF; Wed, 02 Dec 2026 16:19:26 +0100 (CET) From: Jonas Theisen To: pve-devel@lists.proxmox.com Subject: [PATCH qemu-server v4 10/21] fix #6535: migrate: warn about live migration between CPU vendors Date: Wed, 2 Dec 2026 16:18:06 +0100 Message-ID: <20261202151831.414110-11-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: 1796224739039 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.057 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: W2MTWNDQ2AVZQ45WQ7QAQ3DVFYF3TUEQ X-Message-ID-Hash: W2MTWNDQ2AVZQ45WQ7QAQ3DVFYF3TUEQ 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: Live migrating a VM between CPU vendors is not guaranteed to work, even with generic CPU models that do not pass through vendor-specific features, as the CPUs still behave differently in some regards. Warn about this in the migration task, as a task warning, and in the migration precondition API, with the CPU vendors as details. VMs with the 'host' or 'max' CPU model stay blocked. Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=6535 Signed-off-by: Jonas Theisen --- src/PVE/API2/Qemu.pm | 2 +- src/PVE/QemuMigrate/Helpers.pm | 20 ++++++++++++++++++++ src/test/run_api_tests.pl | 17 +++++++++++++++++ src/test/run_qemu_migrate_tests.pl | 11 +++++++++++ 4 files changed, 49 insertions(+), 1 deletion(-) diff --git a/src/PVE/API2/Qemu.pm b/src/PVE/API2/Qemu.pm index a3f44ac0..2e916bb2 100644 --- a/src/PVE/API2/Qemu.pm +++ b/src/PVE/API2/Qemu.pm @@ -5711,7 +5711,7 @@ __PACKAGE__->register_method({ type => { type => 'string', description => "The check that reported the warning.", - enum => ['missing-cpu-info', 'cpu-check-failed'], + enum => ['cpu-vendor', 'missing-cpu-info', 'cpu-check-failed'], }, message => { type => 'string', diff --git a/src/PVE/QemuMigrate/Helpers.pm b/src/PVE/QemuMigrate/Helpers.pm index 23f4d589..583d77bc 100644 --- a/src/PVE/QemuMigrate/Helpers.pm +++ b/src/PVE/QemuMigrate/Helpers.pm @@ -235,6 +235,26 @@ my $target_cpu_checks = [ return ($message, vendor_details($source, $target)); }, }, + { + type => 'cpu-vendor', + severity => 'warning', + needs => ['vendor'], + applies => sub { + my ($cpu) = @_; + return $cpu->{kvm} && !is_host_cpu_model($cpu); + }, + check => sub { + my ($cpu, $source, $target) = @_; + + return if !vendors_differ($source, $target); + + # even generic CPU models expose behavior that differs between vendors + my $message = + "live migration from $source->{vendor} to $target->{vendor} is not guaranteed" + . " to work"; + return ($message, vendor_details($source, $target)); + }, + }, ]; # Returns the issues of the target node. If it lacks CPU information needed by a check that can diff --git a/src/test/run_api_tests.pl b/src/test/run_api_tests.pl index 22a0533b..8a546ac0 100755 --- a/src/test/run_api_tests.pl +++ b/src/test/run_api_tests.pl @@ -406,6 +406,13 @@ subtest 'migration preconditions of the CPU of a running VM' => sub { }, "reasons for 'host'", ); + is_deeply( + $cpu_reasons->('kvm64,enforce,+avx512f,+kvm_pv_eoi,+kvm_pv_unhalt'), + { + 'other-vendor' => ['warning: cpu-vendor'], + }, + 'reasons for another CPU model', + ); # confidential VMs cannot be live migrated at all $qemu_config_module->mock( @@ -417,6 +424,7 @@ subtest 'migration preconditions of the CPU of a running VM' => sub { ); $qemu_config_module->mock(load_config => sub { return { memory => 512 }; }); + $running_cpu = 'host,+kvm_pv_eoi,+kvm_pv_unhalt'; my $res = PVE::API2::Qemu->migrate_vm_precondition({ node => 'localhost', vmid => 100 }); my $vendor_reason = $res->{not_allowed_nodes}->{'other-vendor'}->{'incompatible-cpu'}->[0]; is_deeply( @@ -425,6 +433,15 @@ subtest 'migration preconditions of the CPU of a running VM' => sub { 'reasons include their values as details', ); + $running_cpu = 'kvm64,enforce,+kvm_pv_eoi,+kvm_pv_unhalt'; + $res = PVE::API2::Qemu->migrate_vm_precondition({ node => 'localhost', vmid => 100 }); + my $vendor_warning = $res->{'cpu-warnings'}->{'other-vendor'}->[0]; + is_deeply( + [$vendor_warning->@{qw(source-vendor target-vendor)}], + ['GenuineIntel', 'AuthenticAMD'], + 'warnings include their values as details', + ); + # the migration only warns about a failed check as well $cpu_config_module->mock( get_cpu_from_running_vm => diff --git a/src/test/run_qemu_migrate_tests.pl b/src/test/run_qemu_migrate_tests.pl index b2b4d954..41475b81 100755 --- a/src/test/run_qemu_migrate_tests.pl +++ b/src/test/run_qemu_migrate_tests.pl @@ -1627,6 +1627,17 @@ my $tests = [ nodes => { pve1 => { vendor => undef } }, }, ), + cpu_migration_test( + name => '1033_running_kvm64_cpu_other_vendor', + runningcpu => 'kvm64,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,+lahf_lm,+sep', + cpu_info => { + source => { vendor => 'AuthenticAMD' }, + }, + expect_log => [ + "CPU of node 'pve1' might be incompatible: live migration from AuthenticAMD to" + . " GenuineIntel is not guaranteed to work", + ], + ), { name => '105_replicated_to_non_replication_target', target => 'pve1', -- 2.47.3