* [PATCH docs/manager/qemu-server v3 00/18] check the target node's CPU before live migrating a VM
@ 2026-11-30 18:09 Jonas Theisen
2026-11-30 18:09 ` [PATCH qemu-server v3 01/18] buildsys: ignore migration test runtime files Jonas Theisen
` (17 more replies)
0 siblings, 18 replies; 19+ messages in thread
From: Jonas Theisen @ 2026-11-30 18:09 UTC (permalink / raw)
To: pve-devel
Live migrations of running VMs can currently fail late, or seem to
succeed and leave the guest unstable, if the target node's CPU cannot
run the VM's virtual CPU. This series checks the target's CPU upfront,
reports the result in the migration precondition API, and refuses
migrations that cannot work.
The checks use CPU information each node broadcasts to the cluster. The
already existing 'cpuflags-kvm' node key-value entry provides the flags
KVM supports. The new 'host-cpu-info' entry, broadcast by pvestatd,
provides the CPU vendor and model name. The checks are only done for
running VMs, as stopped VMs get a virtual CPU based on the target node,
and they operate on the QEMU CPU of the running instance, so they also
cover custom CPU models.
Checks that block the migration:
- 'host'/'max' CPU model, target has a different CPU vendor
- fix #2924: 'host'/'max' CPU model, target lacks KVM CPU flags of the
source. As the source flags only approximate those of the VM, root
can override this with the new 'allow-missing-cpu-flags' option.
'force' is not reused, as the HA stack always sets it. Instead, the
new option is forwarded to the HA stack like other migration options.
The migration dialog offers it as an "Ignore CPU incompatibility"
checkbox for root, also for HA-managed VMs. Only flags that QEMU
recognizes are compared, as the broadcast also includes other CPU
properties that can differ between QEMU versions.
- any CPU model other than 'host'/'max', for example 'x86-64-v3',
'Skylake-Server' or a custom model: KVM on the target does not
support an enabled Hyper-V enlightenment, or, as PVE sets 'enforce'
for these models, any other enabled flag. This includes the flags the
QEMU CPU model enables by default, which are queried from QEMU of the
running VM. Abstracted CPU configurations (custom model,
'nested-virt', ...) keep the running QEMU CPU on the target, so for
example the Intel-only 'hv-evmcs' blocks them from AMD targets. The
others get their flags from the configuration again, which only
enables 'hv-evmcs' on Intel hosts, so it is not checked for them.
With TCG, which VMs of another architecture than the host's use by
default, all flags are emulated, so the checks do not apply.
Checks that only warn, as a task warning and in the precondition API:
- fix #6535: live migration between CPU vendors with any other model
- 'host'/'max' CPU model, target has a different CPU model name
- the target does not broadcast the CPU information a blocking check
needs, for example as it runs an older version. Such nodes are not
blocked, as it is unknown whether they are compatible.
HA-managed VMs:
The checks run in the migration task, so they also apply to migrations
by the HA stack. For a migration requested via the API, the CPU of the
target is now also checked before handing it over to the HA stack, so
the API call fails with the reason directly, instead of only the LRM's
migration task failing later.
Migrations that the HA stack starts on its own, for maintenance mode,
the 'migrate' shutdown policy or automatic rebalancing, do not use the
override option and fail in the migration task. The HA stack currently
retries such failed migrations without backoff and without avoiding
the failing target, see bug #8059 [0]. Without this series, they fail
as well, but only after preparing the migration, or for 'host'/'max'
seem to succeed and leave the guest unstable.
[0] https://bugzilla.proxmox.com/show_bug.cgi?id=8059
The 'hv-reenlightenment' flag and the live migration of VMs with
'invtsc', which were part of v2, are split out into a separate series
that builds on this one, as they extend the checks with one for the TSC
frequency of the target.
API changes of the migrate precondition endpoint:
- 'incompatible-cpu' in 'not_allowed_nodes', listing the type, message
and possible override option of each blocking incompatibility
- 'cpu-warnings', listing the warnings per node
The migration tests are extended to check for expected warnings in the
log and for unexpected ones about the CPU, and cover each of the checks.
API tests cover the reasons of the precondition API against its schema,
and the check before requesting an HA migration.
Dependencies: pve-manager's pvestatd patch uses
PVE::QemuServer::Helpers::get_host_cpu_info(), so it needs a bumped
qemu-server. Without it, qemu-server still works and runs the checks
based on the already broadcast CPU flags, but warns about the missing
CPU information.
The 'allow-missing-cpu-flags' override option relies on the HA stack
accepting forwarded migration options, as introduced for
'with-conntrack-state' and 'skip-config-check'.
Testing:
Upgrading the packages reloads pvestatd, so that it broadcasts the new
'host-cpu-info' entry. Only when deploying the code without the
packages, restart pvestatd manually.
The checks can be tested on a cluster with identical CPUs by making the
target node broadcast different CPU information. Unless noted
otherwise, run the following on the target node.
pvestatd broadcasts 'host-cpu-info' again whenever it differs, so stop
it first:
systemctl stop pvestatd
perl -MPVE::Cluster -e 'PVE::Cluster::broadcast_node_kv("host-cpu-info", q({"vendor":"GenuineIntel","model-name":"Fake CPU"}))'
The 'cpuflags-kvm' entry is only broadcast again when the QEMU version
changes, so it can be changed while pvestatd runs. The following
removes the flags listed in REMOVE and adds the ones listed in ADD:
REMOVE='avx512f sha-ni' ADD='' perl -MPVE::Cluster -MPVE::INotify -e '
PVE::Cluster::cfs_update();
my $node = PVE::INotify::nodename();
my $flags = PVE::Cluster::get_node_kv("cpuflags-kvm", $node)->{$node};
my %remove = map { $_ => 1 } split(" ", $ENV{REMOVE});
my @flags = grep { !$remove{$_} } split(" ", $flags);
push @flags, split(" ", $ENV{ADD});
PVE::Cluster::broadcast_node_kv("cpuflags-kvm", join(" ", @flags));
'
Restarting pvestatd broadcasts the real values of both entries again:
systemctl restart pvestatd
The results show up in the precondition API, in the migration dialog,
and in the task log of 'qm migrate <vmid> <target> --online'. Disk-less
VMs suffice for live migration tests. The source node must be able to
start the VM, so it must support the flags of the tested CPU model.
pvesh get /nodes/<source>/qemu/<vmid>/migrate --output-format json-pretty
What to expect for a running VM:
- vendor 'GenuineIntel' on an AMD cluster (or vice versa): blocked for
CPU type 'host'/'max', a warning for other CPU types
- a different 'model-name': a warning for CPU type 'host'/'max'
- flags removed from 'cpuflags-kvm': blocked for CPU type 'host'/'max',
unless '--allow-missing-cpu-flags' is set, also for HA-managed VMs
- properties that are no CPU flags added to 'cpuflags-kvm' of the
source, for example ADD='x-test-property' run on the source node: not
blocked
- flags removed that a VM with a CPU model other than 'host'/'max'
uses: blocked, without override. For example 'avx2' for 'x86-64-v3',
'avx512f' for 'Skylake-Server', which that model enables by default,
or 'hv-stimer' for 'x86-64-v2-AES' with ostype 'win11'.
- an empty 'host-cpu-info' value: a 'missing-cpu-info' warning for VMs
where a blocking check needs the information
- a stopped VM: no CPU checks, as it gets a virtual CPU based on the
target node
For an HA-managed VM, 'qm migrate <vmid> <target> --online' to a node
with an incompatible CPU fails right away with the reason, instead of
requesting the migration from the HA stack. With
'--allow-missing-cpu-flags' and only missing flags for 'host'/'max',
the HA stack migrates the VM, and the migration task logs the ignored
incompatibility.
The "Ignore CPU incompatibility" checkbox of the migration dialog is
only shown for root, and the API refuses 'allow-missing-cpu-flags' for
other users.
The bulk migration of a node ("Bulk Migrate", 'pvenode migrateall')
skips VMs whose target is blocked, and logs the reason as "Has
incompatible CPU". It does not offer the override, so it also skips
VMs that are only blocked due to missing flags for 'host'/'max'.
Changes since v2:
* split out 'hv-reenlightenment' and the live migration of VMs with
'invtsc' into a separate series, and split the docs patch
accordingly
* drop the patch that factored out asserting the CPU compatibility of
the target: it is a helper from the first patch on, so later patches
extend it instead of the migration preparation. The precondition API
reports warnings from the first patch on as well, and the CPU checks
are documented as lists, so that later patches only add to them.
* do not block the live migration of VMs with CPU types that are
generated again on the target, like 'x86-64-v2-AES', because of
'hv-evmcs', which PVE only enables for Windows 11 on Intel hosts. This
blocked such Windows 11 VMs from Intel to AMD nodes. VMs that keep
their virtual CPU, for example with 'nested-virt', are still blocked.
* use TCG as default for VMs of another architecture than the host's,
as qemu-server does elsewhere, and skip the check of the VM's flags
with TCG, which emulates them all
* do not report CPU information as missing on the target that the
source node lacks as well, for example the CPU vendor on aarch64
* treat flags as disabled for the VM for all boolean values, not only
'off'
* HA: only honor override options in the API check if they are
forwarded to the HA stack
* pvestatd patch: encode the CPU information as UTF-8, as qemu-server
decodes it as such
* order the independent refactors before the checks
* docs: correct which checks need the CPU information of the new
version, that 'max' is only affected with KVM, and name the checkbox
of the migration dialog
* new: normalize underscores in all CPU flag names, as QEMU does when
parsing '-cpu', instead of only in the migration checks. This drops
the aliases that only replaced dashes with underscores.
* new: factor out reading the flags of a CPU model expansion, which was
done in two places
* report missing CPU information of a node as a regular warning of the
CPU checks, instead of handling it separately in the API and the
migration task. The task log now shows it as "CPU of node '<node>'
might be incompatible: the node does not provide the CPU information
needed to check it, ..."
* log the CPU warnings only if the migration is not refused anyway
* tests: add a helper for the migration tests of the CPU checks, which
shrinks them to less than half, and fail on unexpected warnings or
errors about the CPU, which uncovered a test that silently logged
a warning about missing CPU information. Add tests for flags disabled
for the VM, aliases in the broadcast flags, and missing information
that only warnings need.
* tests: new API tests for the reasons of the precondition API,
validated against its schema, and for the check before requesting an
HA migration, with a preparatory patch
* new: ignore the runtime files of the migration tests in git
* pvestatd patch: only mention the CPU vendor and model name in the
commit message, as only these are broadcast with this series
* rebased onto current master
Changes since v1:
* fix #2924 patch: only compare flags that QEMU recognizes as CPUID
flags. The broadcast flags also include other CPU properties, such as
'migratable' or 'l3-cache', which can differ between QEMU versions
and would block live migration between nodes running different QEMU
versions.
* extend the check of the flags of the kept virtual CPU to all CPU
models other than 'host'/'max', for example 'x86-64-v3'. These are
generated again from the configuration on the target, but with the
same flags, and QEMU refuses to start if one is missing, as PVE sets
'enforce' for them. The flags the QEMU CPU model enables by default
are now included as well. The 'kept-cpu-flags' type of the
precondition API is renamed to 'vm-cpu-flags' accordingly.
* new: check the CPU of the target in the migrate API before
requesting a migration of an HA-managed VM from the HA stack, with
a preparatory patch that factors out the check
* new: docs patch for the checks
* add 'Fixes:' trailers with the bug report URLs
* pvestatd patch: drop the error handling for querying the host CPU
information, as qemu-server already handles the only query that can
fail
* rebased onto current master
qemu-server:
Jonas Theisen (13):
buildsys: ignore migration test runtime files
test: migration: allow checking for warnings and errors in the log
cpu flags: normalize underscores in all CPU flag names
test: api: factor out validating the migration preconditions
cpu flags: factor out parsing the broadcast CPU flags of a node
migrate: factor out whether the running virtual CPU is kept
cpu flags: factor out the flags of a CPU model expansion
migrate: block live migration of host CPU VMs between CPU vendors
fix #6535: migrate: warn about live migration between CPU vendors
fix #2924: migrate: block live migration of host CPU VMs to nodes
lacking flags
migrate: warn about live migration of host CPU VMs between CPU models
migrate: block live migration if the target cannot run the virtual CPU
api: migrate: check the CPU of the target before requesting HA
migration
.gitignore | 1 +
src/PVE/API2/Qemu.pm | 103 +++++-
src/PVE/QemuMigrate.pm | 11 +-
src/PVE/QemuMigrate/Helpers.pm | 401 ++++++++++++++++++++++
src/PVE/QemuServer.pm | 9 +-
src/PVE/QemuServer/CPUFlags.pm | 72 ++--
src/PVE/QemuServer/Helpers.pm | 34 ++
src/test/MigrationTest/QemuMigrateMock.pm | 53 +++
src/test/run_api_tests.pl | 222 +++++++++++-
src/test/run_qemu_migrate_tests.pl | 365 ++++++++++++++++++++
10 files changed, 1214 insertions(+), 57 deletions(-)
manager:
Jonas Theisen (4):
pvestatd: broadcast host CPU information relevant for live migration
ui: migrate: show why the CPU of the target node is incompatible
fix #6535: ui: migrate: show CPU warnings for the target node
api: nodes: migrateall: skip VMs whose CPU is incompatible with the
target
PVE/API2/Nodes.pm | 5 +++
PVE/Service/pvestatd.pm | 15 ++++++++
www/manager6/window/Migrate.js | 63 ++++++++++++++++++++++++++++++++++
3 files changed, 83 insertions(+)
docs:
Jonas Theisen (1):
qm: document the CPU checks for live migration
qm.adoc | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
Summary over all repositories:
14 files changed, 1329 insertions(+), 57 deletions(-)
--
Generated by murpp 0.12.1
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH qemu-server v3 01/18] buildsys: ignore migration test runtime files
2026-11-30 18:09 [PATCH docs/manager/qemu-server v3 00/18] check the target node's CPU before live migrating a VM Jonas Theisen
@ 2026-11-30 18:09 ` Jonas Theisen
2026-11-30 18:09 ` [PATCH qemu-server v3 02/18] test: migration: allow checking for warnings and errors in the log Jonas Theisen
` (16 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Jonas Theisen @ 2026-11-30 18:09 UTC (permalink / raw)
To: pve-devel
The migration tests leave their runtime files in MigrationTest/run,
which only 'make clean' removes. Ignore them, so that they do not show
up as untracked files and cannot be committed by accident.
Signed-off-by: Jonas Theisen <j.theisen@proxmox.com>
---
.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitignore b/.gitignore
index 3658c855..0e2993b1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,7 @@
*.deb
/.vscode/
/qemu-server-[0-9]*/
+/src/test/MigrationTest/run/
build
qm.bash-completion
sparsecp
--
2.47.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH qemu-server v3 02/18] test: migration: allow checking for warnings and errors in the log
2026-11-30 18:09 [PATCH docs/manager/qemu-server v3 00/18] check the target node's CPU before live migrating a VM Jonas Theisen
2026-11-30 18:09 ` [PATCH qemu-server v3 01/18] buildsys: ignore migration test runtime files Jonas Theisen
@ 2026-11-30 18:09 ` Jonas Theisen
2026-11-30 18:09 ` [PATCH qemu-server v3 03/18] cpu flags: normalize underscores in all CPU flag names Jonas Theisen
` (15 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Jonas Theisen @ 2026-11-30 18:09 UTC (permalink / raw)
To: pve-devel
So far, the log is only checked for the error message of a migration
that is expected to fail. Allow tests to also check that a migration
logs certain warnings, as the migration continues in these cases and
the result alone does not show whether the warning was issued.
Also allow tests to check that no other warnings or errors about a
certain topic are logged, as a migration that logs an unintended
warning still succeeds. Checking for the absence of all other messages
is not feasible, as every migration in the tests logs some unrelated
warnings, for example that conntrack state migration is not supported.
Signed-off-by: Jonas Theisen <j.theisen@proxmox.com>
---
src/test/run_qemu_migrate_tests.pl | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/src/test/run_qemu_migrate_tests.pl b/src/test/run_qemu_migrate_tests.pl
index 1936812e..d22c64c1 100755
--- a/src/test/run_qemu_migrate_tests.pl
+++ b/src/test/run_qemu_migrate_tests.pl
@@ -534,6 +534,10 @@ my $tests = [
# to be made if the migration gets far enough
# expect_die - expect the migration call to fail, and an error message
# matching the specified text in the log
+ # expect_log - list of texts that each must be present in a warning or
+ # error message in the log
+ # unexpected_log - list of texts that no warning or error message in the log
+ # may contain, unless it matches expect_die or expect_log
# expected - hash consisting of:
# source_volids - hash of volids expected on the source
# target_volids - hash of volids expected on the target
@@ -1942,6 +1946,21 @@ foreach my $test (@{$tests}) {
note("mocked migrate call failed, but it was not expected - check log");
}
+ my @messages = grep { m/^(?:err|warn):/ } split(/\n/, file_get_contents("${run_dir}/log"));
+ my $expect_log = $test->{expect_log} // [];
+ for my $text ($expect_log->@*) {
+ next if grep { m/\Q${text}\E/ } @messages;
+ fail($name);
+ note("expected message '$text' is not present in log");
+ }
+ my @expected_texts = ($expect_log->@*, grep { defined } $expect_die);
+ for my $message (@messages) {
+ next if grep { $message =~ m/\Q$_\E/ } @expected_texts;
+ my ($text) = grep { $message =~ m/\Q$_\E/ } ($test->{unexpected_log} // [])->@* or next;
+ fail($name);
+ note("unexpected message containing '$text' in log: $message");
+ }
+
my $expected_calls = decode_json(file_get_contents("${run_dir}/expected_calls"));
foreach my $call (keys %{$expected_calls}) {
fail($name);
--
2.47.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH qemu-server v3 03/18] cpu flags: normalize underscores in all CPU flag names
2026-11-30 18:09 [PATCH docs/manager/qemu-server v3 00/18] check the target node's CPU before live migrating a VM Jonas Theisen
2026-11-30 18:09 ` [PATCH qemu-server v3 01/18] buildsys: ignore migration test runtime files Jonas Theisen
2026-11-30 18:09 ` [PATCH qemu-server v3 02/18] test: migration: allow checking for warnings and errors in the log Jonas Theisen
@ 2026-11-30 18:09 ` Jonas Theisen
2026-11-30 18:09 ` [PATCH qemu-server v3 04/18] test: api: factor out validating the migration preconditions Jonas Theisen
` (14 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Jonas Theisen @ 2026-11-30 18:09 UTC (permalink / raw)
To: pve-devel
QEMU replaces underscores with dashes in all CPU flags of the '-cpu'
option, see feat2prop() in target/i386/cpu.c. The alias map only
covers the flags QEMU additionally registers with underscores, so
normalizing other flags, for example the Hyper-V enlightenments that
qemu-server passes as 'hv_stimer', kept the underscores, while QEMU
reports them as 'hv-stimer'.
Replace underscores in general, so that flags from a QEMU command line
can be compared with the flags QEMU reports. The aliases that only
replace dashes with underscores are now redundant and dropped.
Signed-off-by: Jonas Theisen <j.theisen@proxmox.com>
---
src/PVE/QemuServer/CPUFlags.pm | 37 ++++++++--------------------------
1 file changed, 8 insertions(+), 29 deletions(-)
diff --git a/src/PVE/QemuServer/CPUFlags.pm b/src/PVE/QemuServer/CPUFlags.pm
index 0d3206b2..d3b4bf1a 100644
--- a/src/PVE/QemuServer/CPUFlags.pm
+++ b/src/PVE/QemuServer/CPUFlags.pm
@@ -93,7 +93,8 @@ for my $arch (keys $supported_vm_specific_cpu_flags_by_arch->%*) {
my @supported_cpu_flags_name_sorted = sort keys $all_supported_vm_specific_cpu_flags->%*;
-# qemu/target/i386/cpu.c, x86_cpu_initfn()
+# qemu/target/i386/cpu.c, x86_cpu_initfn(), without the aliases that only replace dashes by
+# underscores, as normalize_cpu_flag() handles these
my $qemu_cpu_flag_alias_map = {
sse3 => 'pni',
pclmuldq => 'pclmulqdq',
@@ -102,46 +103,24 @@ my $qemu_cpu_flag_alias_map = {
xd => 'nx',
ffxsr => 'fxsr-opt',
i64 => 'lm',
- ds_cpl => 'ds-cpl',
- tsc_adjust => 'tsc-adjust',
- fxsr_opt => 'fxsr-opt',
- lahf_lm => 'lahf-lm',
- cmp_legacy => 'cmp-legacy',
- nodeid_msr => 'nodeid-msr',
- perfctr_core => 'perfctr-core',
- perfctr_nb => 'perfctr-nb',
- kvm_nopiodelay => 'kvm-nopiodelay',
- kvm_mmu => 'kvm-mmu',
- kvm_asyncpf => 'kvm-asyncpf',
- kvm_asyncpf_int => 'kvm-asyncpf-int',
- kvm_steal_time => 'kvm-steal-time',
- kvm_pv_eoi => 'kvm-pv-eoi',
- kvm_pv_unhalt => 'kvm-pv-unhalt',
- kvm_poll_control => 'kvm-poll-control',
- svm_lock => 'svm-lock',
- nrip_save => 'nrip-save',
- tsc_scale => 'tsc-scale',
- vmcb_clean => 'vmcb-clean',
- pause_filter => 'pause-filter',
- sse4_1 => 'sse4.1',
- sse4_2 => 'sse4.2',
'hv-apicv' => 'hv-avic',
- lbr_fmt => 'lbr-fmt',
};
=head3 normalize_cpu_flag($flag)
Normalize a CPU flag to its QEMU form.
-QEMU defines aliases for some CPU flags (see C<x86_cpu_initfn()> in
-C<target/i386/cpu.c>). For example, C<sse4_2> and C<sse4-2> are both aliases for
-C<sse4.2>.
+QEMU accepts underscores instead of dashes in all CPU flags (see C<feat2prop()> in
+C<target/i386/cpu.c>), and defines aliases for some CPU flags (see C<x86_cpu_initfn()>). For
+example, C<sse4_2> and C<sse4-2> are both aliases for C<sse4.2>, and C<hv_stimer> is the same as
+C<hv-stimer>.
-If C<$flag> has a known alias, return that, otherwise return C<$flag> unchanged.
+Return C<$flag> with underscores replaced by dashes, or the flag it is an alias for.
=cut
sub normalize_cpu_flag($flag) {
+ $flag =~ s/_/-/g;
return $qemu_cpu_flag_alias_map->{$flag} // $flag;
}
--
2.47.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH qemu-server v3 04/18] test: api: factor out validating the migration preconditions
2026-11-30 18:09 [PATCH docs/manager/qemu-server v3 00/18] check the target node's CPU before live migrating a VM Jonas Theisen
` (2 preceding siblings ...)
2026-11-30 18:09 ` [PATCH qemu-server v3 03/18] cpu flags: normalize underscores in all CPU flag names Jonas Theisen
@ 2026-11-30 18:09 ` Jonas Theisen
2026-11-30 18:09 ` [PATCH qemu-server v3 05/18] cpu flags: factor out parsing the broadcast CPU flags of a node Jonas Theisen
` (13 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Jonas Theisen @ 2026-11-30 18:09 UTC (permalink / raw)
To: pve-devel
Move validating a result of the migration precondition API against its
schema into a helper, so that further tests of the API can check that
the reasons of each node they produce are documented as well.
No functional change intended.
Signed-off-by: Jonas Theisen <j.theisen@proxmox.com>
---
src/test/run_api_tests.pl | 33 ++++++++++++++++++++++++---------
1 file changed, 24 insertions(+), 9 deletions(-)
diff --git a/src/test/run_api_tests.pl b/src/test/run_api_tests.pl
index d8f26e32..f2916346 100755
--- a/src/test/run_api_tests.pl
+++ b/src/test/run_api_tests.pl
@@ -256,6 +256,20 @@ is(
'clone_vm: no check without target node',
);
+# Returns the error of validating a result of migrate_vm_precondition against its schema, which
+# also requires every reason why a node is not allowed to be documented.
+sub validate_migration_preconditions {
+ my ($res) = @_;
+
+ my $returns = PVE::API2::Qemu->map_method_by_name('migrate_vm_precondition')->{returns};
+ my $strict = dclone($returns);
+ my $node_schema = $strict->{properties}->{not_allowed_nodes}->{additionalProperties};
+ $node_schema->{additionalProperties} = 0;
+ eval { PVE::JSONSchema::validate($res, $strict) };
+
+ return $@;
+}
+
subtest 'migration preconditions' => sub {
my $nodes = ['localhost', 'pve2', 'pve3', 'pve4'];
$cluster_module->mock(get_nodelist => sub { return $nodes; });
@@ -303,16 +317,17 @@ subtest 'migration preconditions' => sub {
'node with an older version is not allowed',
);
- my $returns = PVE::API2::Qemu->map_method_by_name('migrate_vm_precondition')->{returns};
- # every reason of a node must be documented
- my $strict = dclone($returns);
- my $node_schema = $strict->{properties}->{not_allowed_nodes}->{additionalProperties};
- $node_schema->{additionalProperties} = 0;
- eval { PVE::JSONSchema::validate($res, $strict) };
- is($@, '', 'result matches the schema, including the reasons of each node');
+ is(
+ validate_migration_preconditions($res),
+ '',
+ 'result matches the schema, including the reasons of each node',
+ );
my $undocumented = { $res->%*, not_allowed_nodes => { pve3 => { 'other-reason' => 1 } } };
- eval { PVE::JSONSchema::validate($undocumented, $strict) };
- like($@, qr/other-reason/, 'an undocumented reason does not');
+ like(
+ validate_migration_preconditions($undocumented),
+ qr/other-reason/,
+ 'an undocumented reason does not',
+ );
$cluster_module->unmock('get_nodelist', 'get_config');
mock_unreachable_config();
--
2.47.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH qemu-server v3 05/18] cpu flags: factor out parsing the broadcast CPU flags of a node
2026-11-30 18:09 [PATCH docs/manager/qemu-server v3 00/18] check the target node's CPU before live migrating a VM Jonas Theisen
` (3 preceding siblings ...)
2026-11-30 18:09 ` [PATCH qemu-server v3 04/18] test: api: factor out validating the migration preconditions Jonas Theisen
@ 2026-11-30 18:09 ` Jonas Theisen
2026-11-30 18:09 ` [PATCH qemu-server v3 06/18] migrate: factor out whether the running virtual CPU is kept Jonas Theisen
` (12 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Jonas Theisen @ 2026-11-30 18:09 UTC (permalink / raw)
To: pve-devel
The CPU flags that pvestatd broadcasts need to be normalized, as nodes
running an older version also broadcast aliases of some flags, for
example 'sse4_2' and 'sse4-2' in addition to 'sse4.2'.
Factor this out, so that other users of the broadcast flags cannot
forget about it.
Signed-off-by: Jonas Theisen <j.theisen@proxmox.com>
---
src/PVE/QemuServer/CPUFlags.pm | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/src/PVE/QemuServer/CPUFlags.pm b/src/PVE/QemuServer/CPUFlags.pm
index d3b4bf1a..f35ce1a5 100644
--- a/src/PVE/QemuServer/CPUFlags.pm
+++ b/src/PVE/QemuServer/CPUFlags.pm
@@ -124,6 +124,20 @@ sub normalize_cpu_flag($flag) {
return $qemu_cpu_flag_alias_map->{$flag} // $flag;
}
+=head3 parse_node_cpu_flags($raw)
+
+Parse the CPU flags of a node, as C<pvestatd> broadcasts them in the C<cpuflags-$accel> node
+key-value entries, and return them normalized with C<normalize_cpu_flag()>.
+
+The broadcast format may differ from the current one, for example if the node runs an older
+version, which also broadcast the aliases of some flags.
+
+=cut
+
+sub parse_node_cpu_flags($raw) {
+ return map { normalize_cpu_flag($_) } split(' ', $raw);
+}
+
# Understood CPU flags are written to a file at 'pve-qemu' compile time and
# shipped below this directory by the pve-qemu-kvm package.
my $understood_cpu_flag_dir = "/usr/share/kvm";
@@ -274,12 +288,7 @@ sub query_available_cpu_flags($accel, $vm_specific, $arch) {
};
for my $node (keys %$flags) {
- # This depends on `pvestatd` storing the flags in space-separated format, which
- # is the case at the time of this commit.
- for (split(' ', $flags->{$node})) {
- # normalize as pvestatd's stored format may drift relative to the recognized
- # flag list, e.g. across upgrades or between QEMU CPUID-flag aliases.
- my $flag = normalize_cpu_flag($_);
+ for my $flag (parse_node_cpu_flags($flags->{$node})) {
my $pve_alias = undef;
$pve_alias = 'nested-virt' if $flag eq 'svm' || $flag eq 'vmx';
next if $vm_specific && !flag_is_vm_specific($flag) && !$pve_alias;
--
2.47.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH qemu-server v3 06/18] migrate: factor out whether the running virtual CPU is kept
2026-11-30 18:09 [PATCH docs/manager/qemu-server v3 00/18] check the target node's CPU before live migrating a VM Jonas Theisen
` (4 preceding siblings ...)
2026-11-30 18:09 ` [PATCH qemu-server v3 05/18] cpu flags: factor out parsing the broadcast CPU flags of a node Jonas Theisen
@ 2026-11-30 18:09 ` Jonas Theisen
2026-11-30 18:09 ` [PATCH qemu-server v3 07/18] cpu flags: factor out the flags of a CPU model expansion Jonas Theisen
` (11 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Jonas Theisen @ 2026-11-30 18:09 UTC (permalink / raw)
To: pve-devel
For abstracted CPU configurations, a live migration starts the target
instance with the QEMU CPU of the running instance. Factor out this
condition, so that checks whether the target can run that CPU can use
the same one as the migration itself.
Signed-off-by: Jonas Theisen <j.theisen@proxmox.com>
---
src/PVE/QemuMigrate.pm | 2 +-
src/PVE/QemuMigrate/Helpers.pm | 16 ++++++++++++++++
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/src/PVE/QemuMigrate.pm b/src/PVE/QemuMigrate.pm
index 67b72598..d3f6f155 100644
--- a/src/PVE/QemuMigrate.pm
+++ b/src/PVE/QemuMigrate.pm
@@ -242,7 +242,7 @@ sub prepare {
$self->{forcemachine} = PVE::QemuServer::Machine::qemu_machine_pxe($vmid, $conf);
# To support abstracted CPU configurations, keep QEMU's "-cpu" parameter intact.
- if ($conf->{cpu} && PVE::QemuServer::CPUConfig::is_abstracted($conf->{cpu})) {
+ if (PVE::QemuMigrate::Helpers::is_running_cpu_kept($conf)) {
$self->{forcecpu} = PVE::QemuServer::CPUConfig::get_cpu_from_running_vm($pid);
}
diff --git a/src/PVE/QemuMigrate/Helpers.pm b/src/PVE/QemuMigrate/Helpers.pm
index 466517da..e0eec8b1 100644
--- a/src/PVE/QemuMigrate/Helpers.pm
+++ b/src/PVE/QemuMigrate/Helpers.pm
@@ -113,6 +113,22 @@ sub check_local_resources {
return wantarray ? (\@loc_res, $mapped_res, $missing_mappings_by_node) : \@loc_res;
}
+=head3 is_running_cpu_kept
+
+ my $kept = is_running_cpu_kept($conf);
+
+Returns whether a live migration of the VM with the configuration C<$conf> starts the target
+instance with the QEMU CPU of the running instance, instead of generating it again from the
+configuration. This is the case for abstracted CPU configurations, as their QEMU CPU depends on
+more than the configuration.
+
+=cut
+
+sub is_running_cpu_kept {
+ my ($conf) = @_;
+ return $conf->{cpu} && PVE::QemuServer::CPUConfig::is_abstracted($conf->{cpu}) ? 1 : 0;
+}
+
sub set_migration_caps {
my ($vmid, $savevm) = @_;
--
2.47.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH qemu-server v3 07/18] cpu flags: factor out the flags of a CPU model expansion
2026-11-30 18:09 [PATCH docs/manager/qemu-server v3 00/18] check the target node's CPU before live migrating a VM Jonas Theisen
` (5 preceding siblings ...)
2026-11-30 18:09 ` [PATCH qemu-server v3 06/18] migrate: factor out whether the running virtual CPU is kept Jonas Theisen
@ 2026-11-30 18:09 ` Jonas Theisen
2026-11-30 18:09 ` [PATCH qemu-server v3 08/18] migrate: block live migration of host CPU VMs between CPU vendors Jonas Theisen
` (10 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Jonas Theisen @ 2026-11-30 18:09 UTC (permalink / raw)
To: pve-devel
Move collecting the flags that a result of 'query-cpu-model-expansion'
enables into a helper, so that checks of the virtual CPU of a running
VM can read the flags of its CPU model the same way as the flags
supported by a node.
No functional change intended.
Signed-off-by: Jonas Theisen <j.theisen@proxmox.com>
---
src/PVE/QemuServer.pm | 9 ++-------
src/PVE/QemuServer/CPUFlags.pm | 14 ++++++++++++++
2 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 1d665877..f8b3094f 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -3038,13 +3038,8 @@ sub query_supported_cpu_flags {
model => $model,
);
- my $props = $cmd_result->{model}->{props};
- foreach my $prop (keys %$props) {
- next if $props->{$prop} ne JSON::true;
- $prop = PVE::QemuServer::CPUFlags::normalize_cpu_flag($prop);
-
- $flags->{$prop} = 1;
- }
+ $flags->{$_} = 1
+ for PVE::QemuServer::CPUFlags::get_cpu_expansion_flags($cmd_result);
};
my $err = $@;
diff --git a/src/PVE/QemuServer/CPUFlags.pm b/src/PVE/QemuServer/CPUFlags.pm
index f35ce1a5..c188c30a 100644
--- a/src/PVE/QemuServer/CPUFlags.pm
+++ b/src/PVE/QemuServer/CPUFlags.pm
@@ -3,6 +3,7 @@ package PVE::QemuServer::CPUFlags;
use v5.36;
use Exporter qw(import);
+use JSON ();
use PVE::Cluster;
use PVE::File;
@@ -124,6 +125,19 @@ sub normalize_cpu_flag($flag) {
return $qemu_cpu_flag_alias_map->{$flag} // $flag;
}
+=head3 get_cpu_expansion_flags($expansion)
+
+Return the CPU flags that a result of the QMP command C<query-cpu-model-expansion> enables,
+normalized with C<normalize_cpu_flag()>. As the expansion also includes CPU properties that are no
+flags, the result can contain these as well.
+
+=cut
+
+sub get_cpu_expansion_flags($expansion) {
+ my $props = $expansion->{model}->{props} // {};
+ return map { normalize_cpu_flag($_) } grep { ($props->{$_} // '') eq JSON::true } keys %$props;
+}
+
=head3 parse_node_cpu_flags($raw)
Parse the CPU flags of a node, as C<pvestatd> broadcasts them in the C<cpuflags-$accel> node
--
2.47.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH qemu-server v3 08/18] migrate: block live migration of host CPU VMs between CPU vendors
2026-11-30 18:09 [PATCH docs/manager/qemu-server v3 00/18] check the target node's CPU before live migrating a VM Jonas Theisen
` (6 preceding siblings ...)
2026-11-30 18:09 ` [PATCH qemu-server v3 07/18] cpu flags: factor out the flags of a CPU model expansion Jonas Theisen
@ 2026-11-30 18:09 ` Jonas Theisen
2026-11-30 18:09 ` [PATCH qemu-server v3 09/18] fix #6535: migrate: warn about live migration " Jonas Theisen
` (9 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Jonas Theisen @ 2026-11-30 18:09 UTC (permalink / raw)
To: pve-devel
The 'host' and 'max' CPU models pass the features of the host CPU
through to the guest, including vendor-specific ones. A guest that was
started on an AMD CPU is likely to crash after a live migration to an
Intel CPU, or vice versa, as the CPU it detected during boot changed
underneath it.
Check this before the migration, based on CPU information that each
node broadcasts to the cluster as the 'host-cpu-info' node key-value
entry, which pvestatd needs to do. Report such nodes as not allowed in
the migration precondition API, so they can be shown as such before
the migration is started, and refuse to migrate to them. Nodes that do
not broadcast the information, for example because they run an older
version, are not blocked, as it is unknown whether they are
compatible, but a warning is logged. It counts as a task warning, so
that the task status shows it. Warnings are only logged if the
migration is not refused anyway, as they do not matter then.
Also report such nodes with a warning in the migration precondition
API, as the task log only shows it once the migration is started.
Missing information is only reported for checks that can prevent the
migration, so that checks that only warn do not cause a warning for
every live migration to a node running an older version. It is not
reported either if this node lacks it as well, as for example the CPU
vendor on aarch64 hosts.
The checks are defined in a list, so that further combinations of VM
CPU settings and node CPUs that cannot work, or are known to be prone
to problems, can be added easily. They are only done for running VMs,
as stopped VMs are started with a virtual CPU based on the target
node, and operate on the QEMU CPU of the running instance, so they
also apply to settings from custom CPU models. With TCG, which VMs of
another architecture than the host's use by default, the 'max' model
is fully emulated and therefore not affected.
Signed-off-by: Jonas Theisen <j.theisen@proxmox.com>
---
src/PVE/API2/Qemu.pm | 65 +++++++-
src/PVE/QemuMigrate.pm | 9 +
src/PVE/QemuMigrate/Helpers.pm | 191 ++++++++++++++++++++++
src/PVE/QemuServer/Helpers.pm | 31 ++++
src/test/MigrationTest/QemuMigrateMock.pm | 33 ++++
src/test/run_api_tests.pl | 79 +++++++++
src/test/run_qemu_migrate_tests.pl | 122 ++++++++++++++
7 files changed, 529 insertions(+), 1 deletion(-)
diff --git a/src/PVE/API2/Qemu.pm b/src/PVE/API2/Qemu.pm
index 2119e69e..14057010 100644
--- a/src/PVE/API2/Qemu.pm
+++ b/src/PVE/API2/Qemu.pm
@@ -5599,6 +5599,27 @@ __PACKAGE__->register_method({
description => 'The config key of a mapped resource',
},
},
+ 'incompatible-cpu' => {
+ description =>
+ "Reasons why the node's CPU cannot run the running VM"
+ . " after a live migration.",
+ type => 'array',
+ optional => 1,
+ items => {
+ type => 'object',
+ properties => {
+ type => {
+ type => 'string',
+ description => "The check that failed.",
+ enum => ['cpu-vendor'],
+ },
+ message => {
+ type => 'string',
+ description => "Why the node's CPU is incompatible.",
+ },
+ },
+ },
+ },
'blocking-ha-resources' => {
description => "HA resources, which are blocking the"
. " VM from being migrated to the node.",
@@ -5676,6 +5697,29 @@ __PACKAGE__->register_method({
description =>
"Object of mapped resources with additional information such if they're live migratable.",
},
+ 'cpu-warnings' => {
+ type => 'object',
+ optional => 1,
+ description => "For each node, reasons why the VM might not run reliably on its"
+ . " CPU after a live migration.",
+ additionalProperties => {
+ type => 'array',
+ items => {
+ type => 'object',
+ properties => {
+ type => {
+ type => 'string',
+ description => "The check that reported the warning.",
+ enum => ['missing-cpu-info'],
+ },
+ message => {
+ type => 'string',
+ description => "Why the VM might not run reliably.",
+ },
+ },
+ },
+ },
+ },
'has-dbus-vmstate' => {
type => 'boolean',
description => 'Whether the VM host supports migrating additional VM state, '
@@ -5716,7 +5760,8 @@ __PACKAGE__->register_method({
# try to detect errors early
PVE::QemuConfig->check_lock($vmconf);
- $res->{running} = PVE::QemuServer::check_running($vmid) ? 1 : 0;
+ my $pid = PVE::QemuServer::check_running($vmid);
+ $res->{running} = $pid ? 1 : 0;
my ($local_resources, $mapped_resources, $missing_mappings_by_node) =
PVE::QemuMigrate::Helpers::check_local_resources($vmconf, $res->{running}, 1);
@@ -5746,6 +5791,15 @@ __PACKAGE__->register_method({
my $has_identity = PVE::QemuConfig->has_stored_identity($vmid);
my $nodelist = PVE::Cluster::get_nodelist();
+
+ my $cpu_issues_by_node = eval {
+ my $targets = [grep { $_ ne $localnode } $nodelist->@*];
+ return PVE::QemuMigrate::Helpers::check_target_cpu_compatibility(
+ $vmid, $vmconf, $pid, $targets,
+ );
+ } // {};
+ warn "unable to check CPU compatibility of target nodes - $@" if $@;
+
for my $node ($nodelist->@*) {
next if $node eq $localnode;
@@ -5761,6 +5815,15 @@ __PACKAGE__->register_method({
$missing_mappings;
}
+ for my $issue (($cpu_issues_by_node->{$node} // [])->@*) {
+ my $reason = { type => $issue->{type}, message => $issue->{message} };
+ if ($issue->{severity} eq 'error') {
+ push $res->{not_allowed_nodes}->{$node}->{'incompatible-cpu'}->@*, $reason;
+ } else {
+ push $res->{'cpu-warnings'}->{$node}->@*, $reason;
+ }
+ }
+
# extracting blocking resources for current node
if (my $blocking_ha_resources = $blocking_ha_resources_by_node->{$node}) {
$res->{not_allowed_nodes}->{$node}->{'blocking-ha-resources'} =
diff --git a/src/PVE/QemuMigrate.pm b/src/PVE/QemuMigrate.pm
index d3f6f155..419f1bba 100644
--- a/src/PVE/QemuMigrate.pm
+++ b/src/PVE/QemuMigrate.pm
@@ -18,6 +18,7 @@ use PVE::GuestHelpers qw(safe_boolean_ne safe_string_ne);
use PVE::GuestID;
use PVE::INotify;
use PVE::JSONSchema;
+use PVE::RESTEnvironment qw(log_warn);
use PVE::RPCEnvironment;
use PVE::Replication;
use PVE::ReplicationConfig;
@@ -323,6 +324,14 @@ sub prepare {
}
}
+ # nodes of other clusters do not broadcast their CPU information to this cluster
+ if (!$self->{opts}->{remote}) {
+ my $warnings = PVE::QemuMigrate::Helpers::assert_target_cpu_compatibility(
+ $vmid, $conf, $running, $self->{node},
+ );
+ log_warn($_) for $warnings->@*;
+ }
+
my $vollist = PVE::QemuServer::get_vm_volumes($conf);
my $storages = {};
diff --git a/src/PVE/QemuMigrate/Helpers.pm b/src/PVE/QemuMigrate/Helpers.pm
index e0eec8b1..58360a71 100644
--- a/src/PVE/QemuMigrate/Helpers.pm
+++ b/src/PVE/QemuMigrate/Helpers.pm
@@ -6,11 +6,15 @@ use warnings;
use JSON;
use PVE::Cluster;
+use PVE::INotify;
use PVE::JSONSchema qw(parse_property_string);
use PVE::Mapping::Dir;
use PVE::Mapping::PCI;
use PVE::Mapping::USB;
+use PVE::QemuServer::CPUConfig;
+use PVE::QemuServer::CPUFlags;
+use PVE::QemuServer::Helpers;
use PVE::QemuServer::Monitor qw(mon_cmd);
use PVE::QemuServer::Virtiofs;
@@ -113,6 +117,113 @@ sub check_local_resources {
return wantarray ? (\@loc_res, $mapped_res, $missing_mappings_by_node) : \@loc_res;
}
+# Returns the CPU information the node broadcasts, see get_host_cpu_info() in
+# PVE::QemuServer::Helpers. Information the node does not broadcast is missing.
+my sub get_node_cpu_info {
+ my ($node) = @_;
+
+ my $raw = PVE::Cluster::get_node_kv('host-cpu-info', $node)->{$node};
+ my $info = defined($raw) ? eval { decode_json($raw) } : undef;
+
+ return ref($info) eq 'HASH' ? $info : {};
+}
+
+# Parses a QEMU '-cpu' argument into the CPU model and its properties. Flags given without a value
+# are stored as 'on' or 'off'.
+my sub parse_qemu_cpu_string {
+ my ($cpu_str) = @_;
+
+ my ($model, @options) = split(/,/, $cpu_str);
+
+ my $props = {};
+ for my $option (@options) {
+ my ($op, $name, $value) = $option =~ m/^([+-]?)([^=]+)(?:=(.*))?$/ or next;
+ $name = PVE::QemuServer::CPUFlags::normalize_cpu_flag($name);
+ $value = $op eq '-' ? 'off' : 'on' if !defined($value);
+ $props->{$name} = $value;
+ }
+
+ return { model => $model, props => $props };
+}
+
+my sub is_host_cpu_model {
+ my ($cpu) = @_;
+ # with TCG, 'max' is fully emulated instead of passing through the host CPU
+ return $cpu->{model} eq 'host' || ($cpu->{model} eq 'max' && $cpu->{kvm});
+}
+
+my sub vendors_differ {
+ my ($source, $target) = @_;
+
+ my ($source_vendor, $target_vendor) = ($source->{vendor}, $target->{vendor});
+ return defined($source_vendor) && defined($target_vendor) && $source_vendor ne $target_vendor;
+}
+
+# Checks whether the CPU of a target node can run a running VM after a live migration. Each check
+# has:
+# - 'type', identifying the check
+# - 'severity', 'error' if an incompatibility prevents the migration, 'warning' if it is only
+# reported
+# - 'needs', listing the CPU information of the target node the check requires, nodes lacking any
+# of it are skipped
+# - 'applies', returning true if the check is relevant for the VM's CPU
+# - 'check', returning why the target node is incompatible, if it is
+#
+# The VM's CPU is parsed by parse_qemu_cpu_string(), with:
+# - 'kvm' set if the VM uses KVM
+#
+# The CPU information of the nodes is in the format of get_host_cpu_info().
+my $target_cpu_checks = [
+ {
+ type => 'cpu-vendor',
+ severity => 'error',
+ needs => ['vendor'],
+ applies => sub {
+ my ($cpu) = @_;
+ # these models pass through the host CPU, including vendor-specific features
+ return is_host_cpu_model($cpu);
+ },
+ check => sub {
+ my ($cpu, $source, $target) = @_;
+
+ return if !vendors_differ($source, $target);
+
+ return "CPU model '$cpu->{model}' requires the same CPU vendor as on the source"
+ . " node ($source->{vendor}), but the node has $target->{vendor}";
+ },
+ },
+];
+
+# Returns the issues of the target node. If it lacks CPU information needed by a check that can
+# prevent the migration, that is an issue as well, but only a warning, as the node is not refused.
+# Information this node lacks as well, for example the CPU vendor on aarch64, is not reported.
+my sub get_target_cpu_issues {
+ my ($cpu, $checks, $source_info, $target_info) = @_;
+
+ my ($issues, $complete) = ([], 1);
+ for my $check ($checks->@*) {
+ my @missing = grep { !defined($target_info->{$_}) } $check->{needs}->@*;
+ if (scalar(@missing)) {
+ $complete = 0
+ if $check->{severity} eq 'error' && grep { defined($source_info->{$_}) } @missing;
+ next;
+ }
+
+ my $message = $check->{check}->($cpu, $source_info, $target_info) or next;
+ push $issues->@*,
+ { type => $check->{type}, severity => $check->{severity}, message => $message };
+ }
+
+ if (!$complete) {
+ my $message = "the node does not provide the CPU information needed to check it, for"
+ . " example as it runs an older version";
+ push $issues->@*,
+ { type => 'missing-cpu-info', severity => 'warning', message => $message };
+ }
+
+ return $issues;
+}
+
=head3 is_running_cpu_kept
my $kept = is_running_cpu_kept($conf);
@@ -129,6 +240,86 @@ sub is_running_cpu_kept {
return $conf->{cpu} && PVE::QemuServer::CPUConfig::is_abstracted($conf->{cpu}) ? 1 : 0;
}
+=head3 check_target_cpu_compatibility
+
+ my $issues_by_node = check_target_cpu_compatibility($vmid, $conf, $pid, $nodes);
+
+Checks whether the VM C<$vmid> with the configuration C<$conf>, running with the process ID
+C<$pid>, can run with its current virtual CPU on each node of C<$nodes>, based on the CPU
+information the nodes broadcast. Only applies to running VMs, as stopped VMs are started with a
+virtual CPU matching the target node.
+
+Returns a hash reference with the list of issues for each node that has any. Each issue is a hash
+with a C<type> identifying the check, a C<severity> of C<error> if the VM cannot run on the node
+or C<warning> if it might not, and a human-readable C<message>. Nodes that lack CPU information
+needed by a check that can prevent the migration, for example as they run an older version, have
+an issue of type C<missing-cpu-info> with severity C<warning>, unless this node lacks that
+information as well.
+
+=cut
+
+sub check_target_cpu_compatibility {
+ my ($vmid, $conf, $pid, $nodes) = @_;
+
+ return {} if !$pid;
+
+ my $cpu = parse_qemu_cpu_string(PVE::QemuServer::CPUConfig::get_cpu_from_running_vm($pid));
+ my $arch = PVE::QemuServer::Helpers::get_vm_arch($conf);
+ $cpu->{kvm} = $conf->{kvm} // PVE::QemuServer::CPUConfig::is_native_arch($arch);
+
+ my $checks = [grep { $_->{applies}->($cpu) } $target_cpu_checks->@*];
+ return {} if !scalar($checks->@*);
+
+ # Use what this node broadcasts, as for the target nodes. The local pvestatd might not
+ # broadcast it yet, for example if it was not restarted after an upgrade.
+ my $source_info = get_node_cpu_info(PVE::INotify::nodename());
+ $source_info = PVE::QemuServer::Helpers::get_host_cpu_info() if !scalar(keys $source_info->%*);
+
+ my $issues_by_node = {};
+ for my $node ($nodes->@*) {
+ my $target_info = get_node_cpu_info($node);
+
+ my $issues = get_target_cpu_issues($cpu, $checks, $source_info, $target_info);
+ $issues_by_node->{$node} = $issues if scalar($issues->@*);
+ }
+
+ return $issues_by_node;
+}
+
+=head3 assert_target_cpu_compatibility
+
+ my $warnings = assert_target_cpu_compatibility($vmid, $conf, $pid, $node);
+
+Checks whether the running VM can run with its current virtual CPU on the node C<$node>, see
+check_target_cpu_compatibility(). Dies if the node is incompatible.
+
+Returns an array reference with the warnings to log, about possible incompatibilities, including
+missing CPU information of the node.
+
+=cut
+
+sub assert_target_cpu_compatibility {
+ my ($vmid, $conf, $pid, $node) = @_;
+
+ my $issues_by_node = check_target_cpu_compatibility($vmid, $conf, $pid, [$node]);
+
+ my ($errors, $warnings) = ([], []);
+ for my $issue (($issues_by_node->{$node} // [])->@*) {
+ if ($issue->{severity} eq 'warning') {
+ push $warnings->@*, "CPU of node '$node' might be incompatible: $issue->{message}";
+ } else {
+ push $errors->@*, $issue;
+ }
+ }
+
+ if (scalar($errors->@*)) {
+ die "can't migrate VM to '$node' - incompatible CPU: "
+ . join('; ', map { $_->{message} } $errors->@*) . "\n";
+ }
+
+ return $warnings;
+}
+
sub set_migration_caps {
my ($vmid, $savevm) = @_;
diff --git a/src/PVE/QemuServer/Helpers.pm b/src/PVE/QemuServer/Helpers.pm
index 644287bc..b15599bb 100644
--- a/src/PVE/QemuServer/Helpers.pm
+++ b/src/PVE/QemuServer/Helpers.pm
@@ -364,4 +364,35 @@ sub get_host_phys_address_bits {
return; # undef, cannot really do anything..
}
+=head3 get_host_cpu_info
+
+ my $info = get_host_cpu_info();
+
+Returns the properties of this host's CPU that decide whether a running VM can be live-migrated
+to it. pvestatd broadcasts them to the cluster as the C<host-cpu-info> node key-value entry,
+encoded as JSON. The returned hash contains:
+
+=over
+
+=item C<vendor>: the CPU vendor ID, for example C<GenuineIntel> or C<AuthenticAMD>
+
+=back
+
+Properties that cannot be determined are missing. Consumers of the broadcast information must
+also handle properties that nodes running an older version do not provide yet.
+
+=cut
+
+sub get_host_cpu_info {
+ my $cpuinfo = PVE::ProcFSTools::read_cpuinfo();
+
+ # read_cpuinfo() reports values it cannot determine as 'unknown'
+ my $known = sub { $_[0] ne 'unknown' };
+
+ my $info = {};
+ $info->{vendor} = $cpuinfo->{vendor} if $known->($cpuinfo->{vendor});
+
+ return $info;
+}
+
1;
diff --git a/src/test/MigrationTest/QemuMigrateMock.pm b/src/test/MigrationTest/QemuMigrateMock.pm
index 1d895c32..fb62e3b8 100644
--- a/src/test/MigrationTest/QemuMigrateMock.pm
+++ b/src/test/MigrationTest/QemuMigrateMock.pm
@@ -31,6 +31,7 @@ my $migrate_params = decode_json(file_get_contents("${RUN_DIR_PATH}/migrate_para
my $test_vmid = $migrate_params->{vmid};
my $test_target = $migrate_params->{target};
my $test_opts = $migrate_params->{opts};
+my $test_cpu_info = $migrate_params->{cpu_info} // {};
my $current_log = '';
my $vm_stop_executed = 0;
@@ -116,6 +117,10 @@ $qemu_migrate_module->mock(
my ($self, $level, $message) = @_;
$current_log .= "$level: $message\n";
},
+ log_warn => sub {
+ my ($message) = @_;
+ $current_log .= "warn: $message\n";
+ },
mon_cmd => sub {
my ($vmid, $command, %params) = @_;
@@ -225,8 +230,36 @@ $qemu_server_cpuconfig_module->mock(
},
);
+$MigrationTest::Shared::qemu_migrate_helpers_module->mock(
+ check_target_cpu_compatibility => sub {
+ my ($vmid, $conf, $pid, $nodes) = @_;
+ # checking requires the running CPU, which most tests do not need to specify
+ return {} if $pid && !defined($vm_status->{runningcpu});
+ return $MigrationTest::Shared::qemu_migrate_helpers_module->original(
+ 'check_target_cpu_compatibility')->(@_);
+ },
+);
+
+$MigrationTest::Shared::cluster_module->mock(
+ get_node_kv => sub {
+ my ($key, $node) = @_;
+ if ($key eq 'host-cpu-info') {
+ # the source node is 'pve0', without 'source' get_host_cpu_info() is used
+ my $info =
+ $node eq 'pve0' ? $test_cpu_info->{source} : $test_cpu_info->{nodes}->{$node};
+ return {} if !$info;
+ return { $node => encode_json($info) };
+ }
+ return {};
+ },
+);
+
my $qemu_server_helpers_module = Test::MockModule->new("PVE::QemuServer::Helpers");
$qemu_server_helpers_module->mock(
+ get_host_cpu_info => sub {
+ # the source node's broadcast reflects what it reads locally
+ return { ($test_cpu_info->{source} // { vendor => 'GenuineIntel' })->%* };
+ },
vm_running_locally => sub {
return $vm_status->{running} && !$vm_stop_executed;
},
diff --git a/src/test/run_api_tests.pl b/src/test/run_api_tests.pl
index f2916346..aee75711 100755
--- a/src/test/run_api_tests.pl
+++ b/src/test/run_api_tests.pl
@@ -8,6 +8,7 @@ use warnings;
use lib qw(..);
+use JSON;
use Storable qw(dclone);
use Test::MockModule;
use Test::More;
@@ -333,6 +334,84 @@ subtest 'migration preconditions' => sub {
mock_unreachable_config();
};
+subtest 'migration preconditions of the CPU of a running VM' => sub {
+ # the node key-value entries of the source node 'localhost' and of the target nodes, which
+ # differ from the source as their names say, while 'no-cpu-info' broadcasts none
+ my $entries = sub {
+ my ($info) = @_;
+ return { 'host-cpu-info' => encode_json($info) };
+ };
+ my $source = { vendor => 'GenuineIntel' };
+ my $node_kv = {
+ localhost => $entries->($source),
+ 'other-vendor' => $entries->({ $source->%*, vendor => 'AuthenticAMD' }),
+ };
+ my $nodes = ['localhost', 'other-vendor', 'no-cpu-info'];
+
+ my $inotify_module = Test::MockModule->new('PVE::INotify');
+ $inotify_module->mock(nodename => sub { return 'localhost'; });
+ my $ha_config_module = Test::MockModule->new('PVE::HA::Config');
+ $ha_config_module->mock(vm_is_ha_managed => sub { return 0; });
+ my $migrate_helpers_module = Test::MockModule->new('PVE::QemuMigrate::Helpers');
+ $migrate_helpers_module->mock(
+ check_local_resources => sub {
+ return ([], {}, { map { $_ => [] } $nodes->@* });
+ },
+ );
+ $qemu_config_module->mock(load_config => sub { return { memory => 512 }; });
+ $qemu_server_module->mock(check_running => sub { return 1234; });
+ my $running_cpu;
+ my $cpu_config_module = Test::MockModule->new('PVE::QemuServer::CPUConfig');
+ $cpu_config_module->mock(get_cpu_from_running_vm => sub { return $running_cpu; });
+ $cluster_module->mock(
+ get_nodelist => sub { return $nodes; },
+ get_config => sub { return $raw_without_identity; },
+ get_node_kv => sub {
+ my ($key, $node) = @_;
+ my $value = $node_kv->{$node}->{$key} // return {};
+ return { $node => $value };
+ },
+ );
+
+ # Returns the CPU reasons of each node for the VM running with the QEMU CPU $running_cpu, the
+ # types of the incompatibilities with their override option, and of the warnings, prefixed.
+ my $cpu_reasons = sub {
+ ($running_cpu) = @_;
+
+ my $res =
+ PVE::API2::Qemu->migrate_vm_precondition({ node => 'localhost', vmid => 100 });
+ is(validate_migration_preconditions($res), '', "$running_cpu: reasons are documented");
+
+ my $reasons = {};
+ for my $node (keys $res->{not_allowed_nodes}->%*) {
+ for my $error (
+ ($res->{not_allowed_nodes}->{$node}->{'incompatible-cpu'} // [])->@*
+ ) {
+ my $override = defined($error->{override}) ? " ($error->{override})" : '';
+ push $reasons->{$node}->@*, "$error->{type}$override";
+ }
+ }
+ for my $node (keys(($res->{'cpu-warnings'} // {})->%*)) {
+ push $reasons->{$node}->@*,
+ map { "warning: $_->{type}" } $res->{'cpu-warnings'}->{$node}->@*;
+ }
+ return $reasons;
+ };
+
+ is_deeply(
+ $cpu_reasons->('host,+kvm_pv_eoi,+kvm_pv_unhalt'),
+ {
+ 'other-vendor' => ['cpu-vendor'],
+ 'no-cpu-info' => ['warning: missing-cpu-info'],
+ },
+ "reasons for 'host'",
+ );
+
+ $qemu_server_module->mock(check_running => sub { return 0; });
+ $cluster_module->unmock('get_nodelist', 'get_config', 'get_node_kv');
+ mock_unreachable_config();
+};
+
subtest 'clone target nodes' => sub {
my $inotify_module = Test::MockModule->new('PVE::INotify');
$inotify_module->mock(nodename => sub { return 'pve1'; });
diff --git a/src/test/run_qemu_migrate_tests.pl b/src/test/run_qemu_migrate_tests.pl
index d22c64c1..879781ca 100755
--- a/src/test/run_qemu_migrate_tests.pl
+++ b/src/test/run_qemu_migrate_tests.pl
@@ -520,6 +520,71 @@ sub local_volids_for_vm {
return $res;
}
+# Returns a copy of $base, with the values of $override set recursively in nested hashes. An
+# undefined value removes the key instead.
+sub merge_hash {
+ my ($base, $override) = @_;
+
+ my $merged = { $base->%* };
+ for my $key (keys $override->%*) {
+ my $value = $override->{$key};
+ if (!defined($value)) {
+ delete $merged->{$key};
+ } elsif (ref($value) eq 'HASH' && ref($merged->{$key}) eq 'HASH') {
+ $merged->{$key} = merge_hash($merged->{$key}, $value);
+ } else {
+ $merged->{$key} = $value;
+ }
+ }
+
+ return $merged;
+}
+
+# CPU information of the source node 'pve0' and the target node 'pve1' in the CPU migration tests,
+# with nothing preventing the migration. The tests override what they check.
+my $default_cpu_info = {
+ source => { vendor => 'GenuineIntel' },
+ nodes => {
+ pve1 => { vendor => 'GenuineIntel' },
+ },
+};
+
+# Returns a test of the CPU checks for a live migration of VM 1033 to 'pve1'. The VM is configured
+# with the CPU 'cpu' and further settings in 'config', and runs with the QEMU CPU 'runningcpu'.
+# 'cpu_info' overrides $default_cpu_info. Without 'expect_die', the migration must succeed, and the
+# target keeps the QEMU CPU if 'cpu_kept' is set. Warnings and errors about the CPU must be
+# expected. Other keys are passed through.
+sub cpu_migration_test {
+ my (%test) = @_;
+
+ my ($runningcpu, $cpu_kept) = delete @test{qw(runningcpu cpu_kept)};
+ my $config_patch = { (delete($test{config}) // {})->%* };
+ my $cpu = delete $test{cpu};
+ $config_patch->{cpu} = $cpu if defined($cpu);
+
+ my $expected_status = { running => 1, runningmachine => 'pc-q35-5.0+pve0' };
+ $expected_status->{runningcpu} = $runningcpu if $test{expect_die} || $cpu_kept;
+
+ return {
+ target => 'pve1',
+ vmid => 1033,
+ vm_status =>
+ { running => 1, runningmachine => 'pc-q35-5.0+pve0', runningcpu => $runningcpu },
+ opts => { online => 1, (delete($test{opts}) // {})->%* },
+ config_patch => $config_patch,
+ cpu_info => merge_hash($default_cpu_info, delete($test{cpu_info}) // {}),
+ expected_calls => $test{expect_die} ? {} : $default_expected_calls_online,
+ unexpected_log => ['CPU'],
+ expected => {
+ source_volids => {},
+ target_volids => {},
+ vm_config => get_patched_config(1033, $config_patch),
+ vm_status => $expected_status,
+ },
+ %test,
+ };
+}
+
my $tests = [
# each test consists of the following:
# name - unique name for the test which also serves as a dir name.
@@ -530,6 +595,9 @@ my $tests = [
# opts - options for the migrate() call
# target_volids - hash of volids on the target at the beginning
# vm_status - hash with running, runningmachine and optionally runningcpu
+ # cpu_info - hash with the CPU information of the 'source' node and of each
+ # other node in 'nodes', see cpu_migration_test() for tests of
+ # the CPU checks
# expected_calls - hash whose keys are calls which are required
# to be made if the migration gets far enough
# expect_die - expect the migration call to fail, and an error message
@@ -1479,6 +1547,59 @@ my $tests = [
},
},
},
+ cpu_migration_test(
+ name => '1033_running_host_cpu_other_vendor',
+ cpu => 'host',
+ runningcpu => 'host,+kvm_pv_eoi,+kvm_pv_unhalt',
+ cpu_info => {
+ source => { vendor => 'AuthenticAMD' },
+ },
+ expect_die => "can't migrate VM to 'pve1' - incompatible CPU: CPU model 'host' requires"
+ . " the same CPU vendor as on the source node (AuthenticAMD), but the node has"
+ . " GenuineIntel",
+ ),
+ cpu_migration_test(
+ name => '1033_running_host_cpu_target_without_cpu_info',
+ cpu => 'host',
+ runningcpu => 'host,+kvm_pv_eoi,+kvm_pv_unhalt',
+ cpu_info => {
+ nodes => { pve1 => undef },
+ },
+ expect_log => [
+ "CPU of node 'pve1' might be incompatible: the node does not provide the CPU"
+ . " information needed to check it",
+ ],
+ ),
+ cpu_migration_test(
+ # with TCG, 'max' is fully emulated instead of passing through the host CPU
+ name => '1033_running_max_cpu_tcg_other_vendor',
+ cpu => 'max',
+ config => { kvm => 0 },
+ runningcpu => 'max',
+ cpu_info => {
+ source => { vendor => 'AuthenticAMD' },
+ },
+ ),
+ cpu_migration_test(
+ # VMs of another architecture than the host's run with TCG by default
+ name => '1033_running_max_cpu_emulated_other_vendor',
+ cpu => 'max',
+ config => { arch => 'aarch64' },
+ runningcpu => 'max',
+ cpu_info => {
+ source => { vendor => 'AuthenticAMD' },
+ },
+ ),
+ cpu_migration_test(
+ # for example on aarch64, no node knows its CPU vendor
+ name => '1033_running_host_cpu_vendor_unknown',
+ cpu => 'host',
+ runningcpu => 'host,+kvm_pv_eoi,+kvm_pv_unhalt',
+ cpu_info => {
+ source => { vendor => undef },
+ nodes => { pve1 => { vendor => undef } },
+ },
+ ),
{
name => '105_replicated_to_non_replication_target',
target => 'pve1',
@@ -1900,6 +2021,7 @@ foreach my $test (@{$tests}) {
target => $test->{target},
vmid => $test->{vmid},
opts => $test->{opts},
+ cpu_info => $test->{cpu_info},
};
file_set_contents("${run_dir}/nbd_info", to_json({}));
--
2.47.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH qemu-server v3 09/18] fix #6535: migrate: warn about live migration between CPU vendors
2026-11-30 18:09 [PATCH docs/manager/qemu-server v3 00/18] check the target node's CPU before live migrating a VM Jonas Theisen
` (7 preceding siblings ...)
2026-11-30 18:09 ` [PATCH qemu-server v3 08/18] migrate: block live migration of host CPU VMs between CPU vendors Jonas Theisen
@ 2026-11-30 18:09 ` Jonas Theisen
2026-11-30 18:09 ` [PATCH qemu-server v3 10/18] fix #2924: migrate: block live migration of host CPU VMs to nodes lacking flags Jonas Theisen
` (8 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Jonas Theisen @ 2026-11-30 18:09 UTC (permalink / raw)
To: pve-devel
Live migrating a VM between nodes with CPUs from different 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 so that the
task status shows it, and report it for each node in the migration
precondition API, so that it can be shown before the migration is
started. As before, VMs with the 'host' or 'max' CPU model cannot be
live migrated between vendors at all.
Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=6535
Signed-off-by: Jonas Theisen <j.theisen@proxmox.com>
---
src/PVE/API2/Qemu.pm | 2 +-
src/PVE/QemuMigrate/Helpers.pm | 19 +++++++++++++++++++
src/test/run_api_tests.pl | 7 +++++++
src/test/run_qemu_migrate_tests.pl | 11 +++++++++++
4 files changed, 38 insertions(+), 1 deletion(-)
diff --git a/src/PVE/API2/Qemu.pm b/src/PVE/API2/Qemu.pm
index 14057010..5549d090 100644
--- a/src/PVE/API2/Qemu.pm
+++ b/src/PVE/API2/Qemu.pm
@@ -5710,7 +5710,7 @@ __PACKAGE__->register_method({
type => {
type => 'string',
description => "The check that reported the warning.",
- enum => ['missing-cpu-info'],
+ enum => ['cpu-vendor', 'missing-cpu-info'],
},
message => {
type => 'string',
diff --git a/src/PVE/QemuMigrate/Helpers.pm b/src/PVE/QemuMigrate/Helpers.pm
index 58360a71..d8b3eb35 100644
--- a/src/PVE/QemuMigrate/Helpers.pm
+++ b/src/PVE/QemuMigrate/Helpers.pm
@@ -192,6 +192,25 @@ my $target_cpu_checks = [
. " node ($source->{vendor}), but the node has $target->{vendor}";
},
},
+ {
+ 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
+ return
+ "live migration from $source->{vendor} to $target->{vendor} is not guaranteed"
+ . " to work, as guests can become unstable, even some time after the migration";
+ },
+ },
];
# 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 aee75711..5ae6b58d 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',
+ );
$qemu_server_module->mock(check_running => sub { return 0; });
$cluster_module->unmock('get_nodelist', 'get_config', 'get_node_kv');
diff --git a/src/test/run_qemu_migrate_tests.pl b/src/test/run_qemu_migrate_tests.pl
index 879781ca..02e54f41 100755
--- a/src/test/run_qemu_migrate_tests.pl
+++ b/src/test/run_qemu_migrate_tests.pl
@@ -1600,6 +1600,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
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH qemu-server v3 10/18] fix #2924: migrate: block live migration of host CPU VMs to nodes lacking flags
2026-11-30 18:09 [PATCH docs/manager/qemu-server v3 00/18] check the target node's CPU before live migrating a VM Jonas Theisen
` (8 preceding siblings ...)
2026-11-30 18:09 ` [PATCH qemu-server v3 09/18] fix #6535: migrate: warn about live migration " Jonas Theisen
@ 2026-11-30 18:09 ` Jonas Theisen
2026-11-30 18:09 ` [PATCH qemu-server v3 11/18] migrate: warn about live migration of host CPU VMs between CPU models Jonas Theisen
` (7 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Jonas Theisen @ 2026-11-30 18:09 UTC (permalink / raw)
To: pve-devel
The 'host' and 'max' CPU models pass the flags of the host CPU through
to the guest. If the target node's CPU lacks flags that the guest might
use, the live migration often fails only near its end, with QEMU on the
target failing to set the special registers of the vCPUs, or the guest
runs into problems after the migration.
Compare the CPU flags that KVM supports on the source and the target
node, which pvestatd already broadcasts, and refuse the migration if the
target lacks any. Flags explicitly disabled for the VM and Hyper-V
enlightenments, which are not passed through, are ignored. As the flags
are broadcast independently of the other CPU information, this also
works for target nodes running an older version. The flags are
normalized, as nodes that did not query them again since an upgrade can
still broadcast aliases of some flags. Only flags that QEMU recognizes
are compared, as the broadcast also includes other CPU properties, such
as 'migratable' or 'l3-cache', which can differ between QEMU versions
without affecting the guest.
The flags of the source node are only an approximation of the flags of
the VM, as it might have been started on another node, and the flags
KVM supports also depend on the kernel version. So allow root to
override the check with the new 'allow-missing-cpu-flags' option. The
existing 'force' option is not reused for this, as the HA stack always
sets it, which would skip the check for all HA-managed VMs. Instead,
the new option is forwarded to the HA stack like other migration
options, so that it also applies to HA-managed VMs.
Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=2924
Signed-off-by: Jonas Theisen <j.theisen@proxmox.com>
---
src/PVE/API2/Qemu.pm | 20 +++-
src/PVE/QemuMigrate.pm | 2 +-
src/PVE/QemuMigrate/Helpers.pm | 107 ++++++++++++++++++++--
src/test/MigrationTest/QemuMigrateMock.pm | 11 +++
src/test/run_api_tests.pl | 16 +++-
src/test/run_qemu_migrate_tests.pl | 88 +++++++++++++++++-
6 files changed, 225 insertions(+), 19 deletions(-)
diff --git a/src/PVE/API2/Qemu.pm b/src/PVE/API2/Qemu.pm
index 5549d090..e0c60d9f 100644
--- a/src/PVE/API2/Qemu.pm
+++ b/src/PVE/API2/Qemu.pm
@@ -155,6 +155,13 @@ my $migrate_json_properties = {
. ' successfully by the target. Using this flag can lead to dropped'
. ' configuration options if the target is too old to parse them.',
},
+ 'allow-missing-cpu-flags' => {
+ type => 'boolean',
+ optional => 1,
+ default => 0,
+ description => "Allow live migration of VMs with CPU type 'host' or 'max' to nodes"
+ . " lacking CPU flags of this node. Only root may use this option.",
+ },
};
# Properties that will be forwarded via the HA stack to the LRM, which will then use them for its
@@ -163,6 +170,7 @@ my $migrate_json_properties = {
my $ha_migrate_props = {
'with-conntrack-state' => 1,
'skip-config-check' => 1,
+ 'allow-missing-cpu-flags' => 1,
};
sub ha_migrate_json_properties {
@@ -5611,12 +5619,18 @@ __PACKAGE__->register_method({
type => {
type => 'string',
description => "The check that failed.",
- enum => ['cpu-vendor'],
+ enum => ['cpu-vendor', 'host-cpu-flags'],
},
message => {
type => 'string',
description => "Why the node's CPU is incompatible.",
},
+ override => {
+ type => 'string',
+ optional => 1,
+ description => "The migration option that allows"
+ . " ignoring the incompatibility.",
+ },
},
},
},
@@ -5818,6 +5832,7 @@ __PACKAGE__->register_method({
for my $issue (($cpu_issues_by_node->{$node} // [])->@*) {
my $reason = { type => $issue->{type}, message => $issue->{message} };
if ($issue->{severity} eq 'error') {
+ $reason->{override} = $issue->{override} if defined($issue->{override});
push $res->{not_allowed_nodes}->{$node}->{'incompatible-cpu'}->@*, $reason;
} else {
push $res->{'cpu-warnings'}->{$node}->@*, $reason;
@@ -5897,6 +5912,9 @@ __PACKAGE__->register_method({
raise_param_exc({ force => "Only root may use this option." })
if $param->{force} && $authuser ne 'root@pam';
+ raise_param_exc({ 'allow-missing-cpu-flags' => "Only root may use this option." })
+ if $param->{'allow-missing-cpu-flags'} && $authuser ne 'root@pam';
+
raise_param_exc({ migration_type => "Only root may use this option." })
if $param->{migration_type} && $authuser ne 'root@pam';
diff --git a/src/PVE/QemuMigrate.pm b/src/PVE/QemuMigrate.pm
index 419f1bba..5c85ec36 100644
--- a/src/PVE/QemuMigrate.pm
+++ b/src/PVE/QemuMigrate.pm
@@ -327,7 +327,7 @@ sub prepare {
# nodes of other clusters do not broadcast their CPU information to this cluster
if (!$self->{opts}->{remote}) {
my $warnings = PVE::QemuMigrate::Helpers::assert_target_cpu_compatibility(
- $vmid, $conf, $running, $self->{node},
+ $vmid, $conf, $running, $self->{node}, $self->{opts},
);
log_warn($_) for $warnings->@*;
}
diff --git a/src/PVE/QemuMigrate/Helpers.pm b/src/PVE/QemuMigrate/Helpers.pm
index d8b3eb35..bc821dca 100644
--- a/src/PVE/QemuMigrate/Helpers.pm
+++ b/src/PVE/QemuMigrate/Helpers.pm
@@ -4,6 +4,7 @@ use strict;
use warnings;
use JSON;
+use List::Util qw(min);
use PVE::Cluster;
use PVE::INotify;
@@ -128,6 +129,23 @@ my sub get_node_cpu_info {
return ref($info) eq 'HASH' ? $info : {};
}
+# Returns the CPU flags KVM supports on the node, as broadcast by pvestatd, if known.
+my sub get_node_kvm_cpu_flags {
+ my ($node) = @_;
+
+ # an empty value means that pvestatd failed to detect the flags
+ my $raw = PVE::Cluster::get_node_kv('cpuflags-kvm', $node)->{$node} or return;
+
+ return { map { $_ => 1 } PVE::QemuServer::CPUFlags::parse_node_cpu_flags($raw) };
+}
+
+# Returns the CPU flags QEMU recognizes for the host architecture, if known.
+my sub get_understood_cpu_flags {
+ my $arch = PVE::QemuServer::Helpers::get_host_arch();
+ my $flags = eval { PVE::QemuServer::CPUFlags::query_understood_cpu_flags($arch) };
+ return $flags ? { map { $_ => 1 } $flags->@* } : undef;
+}
+
# Parses a QEMU '-cpu' argument into the CPU model and its properties. Flags given without a value
# are stored as 'on' or 'off'.
my sub parse_qemu_cpu_string {
@@ -159,11 +177,23 @@ my sub vendors_differ {
return defined($source_vendor) && defined($target_vendor) && $source_vendor ne $target_vendor;
}
+my sub format_flag_list {
+ my ($flags) = @_;
+
+ my $max_listed = 10;
+ my $list = join(', ', $flags->@[0 .. min($max_listed, scalar($flags->@*)) - 1]);
+ $list .= " and " . (scalar($flags->@*) - $max_listed) . " more"
+ if scalar($flags->@*) > $max_listed;
+
+ return $list;
+}
+
# Checks whether the CPU of a target node can run a running VM after a live migration. Each check
# has:
# - 'type', identifying the check
# - 'severity', 'error' if an incompatibility prevents the migration, 'warning' if it is only
# reported
+# - 'override', optionally, the migration option that allows ignoring an error
# - 'needs', listing the CPU information of the target node the check requires, nodes lacking any
# of it are skipped
# - 'applies', returning true if the check is relevant for the VM's CPU
@@ -172,7 +202,9 @@ my sub vendors_differ {
# The VM's CPU is parsed by parse_qemu_cpu_string(), with:
# - 'kvm' set if the VM uses KVM
#
-# The CPU information of the nodes is in the format of get_host_cpu_info().
+# The CPU information of the nodes is in the format of get_host_cpu_info(), plus:
+# - the CPU flags KVM supports as 'kvm-flags' hash
+# - for the source node, the CPU flags QEMU recognizes as 'understood-flags' hash, if known
my $target_cpu_checks = [
{
type => 'cpu-vendor',
@@ -211,6 +243,45 @@ my $target_cpu_checks = [
. " to work, as guests can become unstable, even some time after the migration";
},
},
+ {
+ type => 'host-cpu-flags',
+ severity => 'error',
+ # the flags are only known per node, the VM might have been started on another node
+ override => 'allow-missing-cpu-flags',
+ needs => ['kvm-flags'],
+ applies => sub {
+ my ($cpu) = @_;
+ return is_host_cpu_model($cpu);
+ },
+ check => sub {
+ my ($cpu, $source, $target) = @_;
+
+ # already reported by the 'cpu-vendor' check
+ return if vendors_differ($source, $target);
+
+ my ($source_flags, $target_flags) =
+ ($source->{'kvm-flags'}, $target->{'kvm-flags'});
+ return if !$source_flags;
+
+ # The broadcast also includes CPU properties that are no flags, for example
+ # 'migratable', which can differ between QEMU versions without affecting the guest.
+ my $understood = $source->{'understood-flags'};
+ my @flags = grep { !$understood || $understood->{$_} } keys $source_flags->%*;
+
+ my @missing = sort grep {
+ # Hyper-V enlightenments are not passed through, but set explicitly
+ !m/^hv-/
+ && !$target_flags->{$_}
+ && (PVE::JSONSchema::parse_boolean($cpu->{props}->{$_} // 'on') // 1)
+ } @flags;
+ return if !scalar(@missing);
+
+ return
+ "CPU model '$cpu->{model}' passes through the flags of the host CPU, but the"
+ . " node lacks: "
+ . format_flag_list(\@missing);
+ },
+ },
];
# Returns the issues of the target node. If it lacks CPU information needed by a check that can
@@ -229,8 +300,9 @@ my sub get_target_cpu_issues {
}
my $message = $check->{check}->($cpu, $source_info, $target_info) or next;
- push $issues->@*,
- { type => $check->{type}, severity => $check->{severity}, message => $message };
+ my $issue = { type => $check->{type}, severity => $check->{severity}, message => $message };
+ $issue->{override} = $check->{override} if defined($check->{override});
+ push $issues->@*, $issue;
}
if (!$complete) {
@@ -273,7 +345,7 @@ with a C<type> identifying the check, a C<severity> of C<error> if the VM cannot
or C<warning> if it might not, and a human-readable C<message>. Nodes that lack CPU information
needed by a check that can prevent the migration, for example as they run an older version, have
an issue of type C<missing-cpu-info> with severity C<warning>, unless this node lacks that
-information as well.
+information as well. If a migration option allows ignoring an error, C<override> names it.
=cut
@@ -291,12 +363,16 @@ sub check_target_cpu_compatibility {
# Use what this node broadcasts, as for the target nodes. The local pvestatd might not
# broadcast it yet, for example if it was not restarted after an upgrade.
- my $source_info = get_node_cpu_info(PVE::INotify::nodename());
+ my $local_node = PVE::INotify::nodename();
+ my $source_info = get_node_cpu_info($local_node);
$source_info = PVE::QemuServer::Helpers::get_host_cpu_info() if !scalar(keys $source_info->%*);
+ $source_info->{'kvm-flags'} = get_node_kvm_cpu_flags($local_node);
+ $source_info->{'understood-flags'} = get_understood_cpu_flags();
my $issues_by_node = {};
for my $node ($nodes->@*) {
my $target_info = get_node_cpu_info($node);
+ $target_info->{'kvm-flags'} = get_node_kvm_cpu_flags($node);
my $issues = get_target_cpu_issues($cpu, $checks, $source_info, $target_info);
$issues_by_node->{$node} = $issues if scalar($issues->@*);
@@ -307,33 +383,44 @@ sub check_target_cpu_compatibility {
=head3 assert_target_cpu_compatibility
- my $warnings = assert_target_cpu_compatibility($vmid, $conf, $pid, $node);
+ my $warnings = assert_target_cpu_compatibility($vmid, $conf, $pid, $node, $opts);
Checks whether the running VM can run with its current virtual CPU on the node C<$node>, see
-check_target_cpu_compatibility(). Dies if the node is incompatible.
+check_target_cpu_compatibility(). Dies if the node is incompatible, unless the migration options
+C<$opts> override all the incompatibilities.
Returns an array reference with the warnings to log, about possible incompatibilities, including
-missing CPU information of the node.
+missing CPU information of the node, and about overridden incompatibilities.
=cut
sub assert_target_cpu_compatibility {
- my ($vmid, $conf, $pid, $node) = @_;
+ my ($vmid, $conf, $pid, $node, $opts) = @_;
my $issues_by_node = check_target_cpu_compatibility($vmid, $conf, $pid, [$node]);
my ($errors, $warnings) = ([], []);
for my $issue (($issues_by_node->{$node} // [])->@*) {
+ my $override = $issue->{override};
if ($issue->{severity} eq 'warning') {
push $warnings->@*, "CPU of node '$node' might be incompatible: $issue->{message}";
+ } elsif (defined($override) && $opts->{$override}) {
+ push $warnings->@*,
+ "ignoring incompatible CPU of node '$node' due to '$override': $issue->{message}";
} else {
push $errors->@*, $issue;
}
}
if (scalar($errors->@*)) {
+ my $hint = '';
+ if (!grep { !defined($_->{override}) } $errors->@*) {
+ my %overrides = map { $_->{override} => 1 } $errors->@*;
+ $hint = " - use " . join(' and ', map { "'$_'" } sort keys %overrides) . " to override";
+ }
die "can't migrate VM to '$node' - incompatible CPU: "
- . join('; ', map { $_->{message} } $errors->@*) . "\n";
+ . join('; ', map { $_->{message} } $errors->@*)
+ . "$hint\n";
}
return $warnings;
diff --git a/src/test/MigrationTest/QemuMigrateMock.pm b/src/test/MigrationTest/QemuMigrateMock.pm
index fb62e3b8..e35aba9f 100644
--- a/src/test/MigrationTest/QemuMigrateMock.pm
+++ b/src/test/MigrationTest/QemuMigrateMock.pm
@@ -243,6 +243,10 @@ $MigrationTest::Shared::qemu_migrate_helpers_module->mock(
$MigrationTest::Shared::cluster_module->mock(
get_node_kv => sub {
my ($key, $node) = @_;
+ if ($key eq 'cpuflags-kvm') {
+ my $flags = $test_cpu_info->{'kvm-flags'}->{$node} or return {};
+ return { $node => $flags };
+ }
if ($key eq 'host-cpu-info') {
# the source node is 'pve0', without 'source' get_host_cpu_info() is used
my $info =
@@ -254,6 +258,13 @@ $MigrationTest::Shared::cluster_module->mock(
},
);
+my $qemu_server_cpuflags_module = Test::MockModule->new("PVE::QemuServer::CPUFlags");
+$qemu_server_cpuflags_module->mock(
+ query_understood_cpu_flags => sub {
+ return [qw(avx512f fpu hv-relaxed lahf-lm sse sse4.2)];
+ },
+);
+
my $qemu_server_helpers_module = Test::MockModule->new("PVE::QemuServer::Helpers");
$qemu_server_helpers_module->mock(
get_host_cpu_info => sub {
diff --git a/src/test/run_api_tests.pl b/src/test/run_api_tests.pl
index 5ae6b58d..0c339f52 100755
--- a/src/test/run_api_tests.pl
+++ b/src/test/run_api_tests.pl
@@ -338,15 +338,17 @@ subtest 'migration preconditions of the CPU of a running VM' => sub {
# the node key-value entries of the source node 'localhost' and of the target nodes, which
# differ from the source as their names say, while 'no-cpu-info' broadcasts none
my $entries = sub {
- my ($info) = @_;
- return { 'host-cpu-info' => encode_json($info) };
+ my ($info, $kvm_flags) = @_;
+ return { 'host-cpu-info' => encode_json($info), 'cpuflags-kvm' => $kvm_flags };
};
my $source = { vendor => 'GenuineIntel' };
my $node_kv = {
- localhost => $entries->($source),
- 'other-vendor' => $entries->({ $source->%*, vendor => 'AuthenticAMD' }),
+ localhost => $entries->($source, 'avx512f fpu sse'),
+ 'other-vendor' =>
+ $entries->({ $source->%*, vendor => 'AuthenticAMD' }, 'avx512f fpu sse'),
+ 'missing-flag' => $entries->($source, 'fpu sse'),
};
- my $nodes = ['localhost', 'other-vendor', 'no-cpu-info'];
+ my $nodes = ['localhost', 'other-vendor', 'no-cpu-info', 'missing-flag'];
my $inotify_module = Test::MockModule->new('PVE::INotify');
$inotify_module->mock(nodename => sub { return 'localhost'; });
@@ -358,6 +360,9 @@ subtest 'migration preconditions of the CPU of a running VM' => sub {
return ([], {}, { map { $_ => [] } $nodes->@* });
},
);
+ my $cpu_flags_module = Test::MockModule->new('PVE::QemuServer::CPUFlags');
+ $cpu_flags_module->mock(
+ query_understood_cpu_flags => sub { return [qw(avx512f fpu sse)]; });
$qemu_config_module->mock(load_config => sub { return { memory => 512 }; });
$qemu_server_module->mock(check_running => sub { return 1234; });
my $running_cpu;
@@ -402,6 +407,7 @@ subtest 'migration preconditions of the CPU of a running VM' => sub {
$cpu_reasons->('host,+kvm_pv_eoi,+kvm_pv_unhalt'),
{
'other-vendor' => ['cpu-vendor'],
+ 'missing-flag' => ['host-cpu-flags (allow-missing-cpu-flags)'],
'no-cpu-info' => ['warning: missing-cpu-info'],
},
"reasons for 'host'",
diff --git a/src/test/run_qemu_migrate_tests.pl b/src/test/run_qemu_migrate_tests.pl
index 02e54f41..7e71501e 100755
--- a/src/test/run_qemu_migrate_tests.pl
+++ b/src/test/run_qemu_migrate_tests.pl
@@ -547,8 +547,15 @@ my $default_cpu_info = {
nodes => {
pve1 => { vendor => 'GenuineIntel' },
},
+ 'kvm-flags' => {
+ pve0 => 'fpu sse',
+ pve1 => 'fpu sse',
+ },
};
+my $lacks_avx512f =
+ "CPU model 'host' passes through the flags of the host CPU, but the node lacks: avx512f";
+
# Returns a test of the CPU checks for a live migration of VM 1033 to 'pve1'. The VM is configured
# with the CPU 'cpu' and further settings in 'config', and runs with the QEMU CPU 'runningcpu'.
# 'cpu_info' overrides $default_cpu_info. Without 'expect_die', the migration must succeed, and the
@@ -596,8 +603,8 @@ my $tests = [
# target_volids - hash of volids on the target at the beginning
# vm_status - hash with running, runningmachine and optionally runningcpu
# cpu_info - hash with the CPU information of the 'source' node and of each
- # other node in 'nodes', see cpu_migration_test() for tests of
- # the CPU checks
+ # other node in 'nodes', and the KVM CPU flags of each node in
+ # 'kvm-flags', see cpu_migration_test() for tests of the CPU checks
# expected_calls - hash whose keys are calls which are required
# to be made if the migration gets far enough
# expect_die - expect the migration call to fail, and an error message
@@ -1611,6 +1618,83 @@ my $tests = [
. " GenuineIntel is not guaranteed to work",
],
),
+ cpu_migration_test(
+ # properties that are no CPU flags can differ between QEMU versions
+ name => '1033_running_host_cpu_other_properties',
+ cpu => 'host',
+ runningcpu => 'host,+kvm_pv_eoi,+kvm_pv_unhalt',
+ cpu_info => {
+ 'kvm-flags' => { pve0 => 'fpu l3-cache migratable sse x-vendor-cpuid-only-v2' },
+ },
+ ),
+ cpu_migration_test(
+ name => '1033_running_host_cpu_missing_flags',
+ cpu => 'host',
+ runningcpu => 'host,+kvm_pv_eoi,+kvm_pv_unhalt',
+ cpu_info => {
+ 'kvm-flags' => { pve0 => 'avx512f fpu hv-relaxed sse' },
+ },
+ expect_die => "can't migrate VM to 'pve1' - incompatible CPU: $lacks_avx512f - use"
+ . " 'allow-missing-cpu-flags' to override",
+ ),
+ cpu_migration_test(
+ # 'force', which the HA stack always sets, must not override the check
+ name => '1033_running_host_cpu_missing_flags_force',
+ cpu => 'host',
+ runningcpu => 'host,+kvm_pv_eoi,+kvm_pv_unhalt',
+ opts => { force => 1 },
+ cpu_info => {
+ 'kvm-flags' => { pve0 => 'avx512f fpu hv-relaxed sse' },
+ },
+ expect_die => "can't migrate VM to 'pve1' - incompatible CPU: $lacks_avx512f - use"
+ . " 'allow-missing-cpu-flags' to override",
+ ),
+ cpu_migration_test(
+ name => '1033_running_host_cpu_missing_flags_allowed',
+ cpu => 'host',
+ runningcpu => 'host,+kvm_pv_eoi,+kvm_pv_unhalt',
+ opts => { 'allow-missing-cpu-flags' => 1 },
+ cpu_info => {
+ 'kvm-flags' => { pve0 => 'avx512f fpu hv-relaxed sse' },
+ },
+ expect_log => [
+ "ignoring incompatible CPU of node 'pve1' due to 'allow-missing-cpu-flags':"
+ . " $lacks_avx512f",
+ ],
+ ),
+ cpu_migration_test(
+ # nodes running an older version broadcast their KVM CPU flags, but no 'host-cpu-info'
+ name => '1033_running_host_cpu_missing_flags_without_cpu_info',
+ cpu => 'host',
+ runningcpu => 'host,+kvm_pv_eoi,+kvm_pv_unhalt',
+ cpu_info => {
+ nodes => { pve1 => undef },
+ 'kvm-flags' => { pve0 => 'avx512f fpu hv-relaxed sse' },
+ },
+ expect_die => "can't migrate VM to 'pve1' - incompatible CPU: $lacks_avx512f - use"
+ . " 'allow-missing-cpu-flags' to override",
+ ),
+ cpu_migration_test(
+ # the guest cannot use flags disabled for the VM
+ name => '1033_running_host_cpu_missing_flags_disabled',
+ cpu => 'host',
+ runningcpu => 'host,-avx512f,sse4.2=false,+kvm_pv_eoi,+kvm_pv_unhalt',
+ cpu_info => {
+ 'kvm-flags' => { pve0 => 'avx512f fpu hv-relaxed sse sse4.2' },
+ },
+ ),
+ cpu_migration_test(
+ # nodes that did not query their flags since an upgrade still broadcast aliases
+ name => '1033_running_host_cpu_missing_flag_alias',
+ cpu => 'host',
+ runningcpu => 'host,+kvm_pv_eoi,+kvm_pv_unhalt',
+ cpu_info => {
+ 'kvm-flags' => { pve0 => 'fpu sse sse4_2' },
+ },
+ expect_die => "can't migrate VM to 'pve1' - incompatible CPU: CPU model 'host' passes"
+ . " through the flags of the host CPU, but the node lacks: sse4.2 - use"
+ . " 'allow-missing-cpu-flags' to override",
+ ),
{
name => '105_replicated_to_non_replication_target',
target => 'pve1',
--
2.47.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH qemu-server v3 11/18] migrate: warn about live migration of host CPU VMs between CPU models
2026-11-30 18:09 [PATCH docs/manager/qemu-server v3 00/18] check the target node's CPU before live migrating a VM Jonas Theisen
` (9 preceding siblings ...)
2026-11-30 18:09 ` [PATCH qemu-server v3 10/18] fix #2924: migrate: block live migration of host CPU VMs to nodes lacking flags Jonas Theisen
@ 2026-11-30 18:09 ` Jonas Theisen
2026-11-30 18:09 ` [PATCH qemu-server v3 12/18] migrate: block live migration if the target cannot run the virtual CPU Jonas Theisen
` (6 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Jonas Theisen @ 2026-11-30 18:09 UTC (permalink / raw)
To: pve-devel
Even if the target node's CPU supports all flags of the source node's
CPU, a guest with the 'host' or 'max' CPU model can run into problems
after a live migration between different physical CPU models, as they
can still behave differently, for example regarding errata. The
documentation advises against this setup for that reason.
Broadcast the CPU model name as part of the node's CPU information and
warn if it differs between the source and the target node.
Signed-off-by: Jonas Theisen <j.theisen@proxmox.com>
---
src/PVE/API2/Qemu.pm | 2 +-
src/PVE/QemuMigrate/Helpers.pm | 23 +++++++++++++++++++++
src/PVE/QemuServer/Helpers.pm | 3 +++
src/test/run_api_tests.pl | 14 +++++++++----
src/test/run_qemu_migrate_tests.pl | 33 ++++++++++++++++++++++++++++--
5 files changed, 68 insertions(+), 7 deletions(-)
diff --git a/src/PVE/API2/Qemu.pm b/src/PVE/API2/Qemu.pm
index e0c60d9f..1fd46733 100644
--- a/src/PVE/API2/Qemu.pm
+++ b/src/PVE/API2/Qemu.pm
@@ -5724,7 +5724,7 @@ __PACKAGE__->register_method({
type => {
type => 'string',
description => "The check that reported the warning.",
- enum => ['cpu-vendor', 'missing-cpu-info'],
+ enum => ['cpu-vendor', 'missing-cpu-info', 'host-cpu-model'],
},
message => {
type => 'string',
diff --git a/src/PVE/QemuMigrate/Helpers.pm b/src/PVE/QemuMigrate/Helpers.pm
index bc821dca..a131104e 100644
--- a/src/PVE/QemuMigrate/Helpers.pm
+++ b/src/PVE/QemuMigrate/Helpers.pm
@@ -282,6 +282,29 @@ my $target_cpu_checks = [
. format_flag_list(\@missing);
},
},
+ {
+ type => 'host-cpu-model',
+ severity => 'warning',
+ needs => ['model-name'],
+ applies => sub {
+ my ($cpu) = @_;
+ return is_host_cpu_model($cpu);
+ },
+ check => sub {
+ my ($cpu, $source, $target) = @_;
+
+ # already reported by the 'cpu-vendor' check
+ return if vendors_differ($source, $target);
+
+ my ($source_model, $target_model) =
+ ($source->{'model-name'}, $target->{'model-name'});
+ return if !defined($source_model) || $source_model eq $target_model;
+
+ # same flags do not imply the same behavior, for example regarding errata
+ return "CPU model '$cpu->{model}' is only reliable for live migration between"
+ . " identical CPUs, but the node has '$target_model' instead of '$source_model'";
+ },
+ },
];
# Returns the issues of the target node. If it lacks CPU information needed by a check that can
diff --git a/src/PVE/QemuServer/Helpers.pm b/src/PVE/QemuServer/Helpers.pm
index b15599bb..70f9c817 100644
--- a/src/PVE/QemuServer/Helpers.pm
+++ b/src/PVE/QemuServer/Helpers.pm
@@ -376,6 +376,8 @@ encoded as JSON. The returned hash contains:
=item C<vendor>: the CPU vendor ID, for example C<GenuineIntel> or C<AuthenticAMD>
+=item C<model-name>: the CPU model name, for example C<AMD EPYC 7302 16-Core Processor>
+
=back
Properties that cannot be determined are missing. Consumers of the broadcast information must
@@ -391,6 +393,7 @@ sub get_host_cpu_info {
my $info = {};
$info->{vendor} = $cpuinfo->{vendor} if $known->($cpuinfo->{vendor});
+ $info->{'model-name'} = $cpuinfo->{model} if $known->($cpuinfo->{model});
return $info;
}
diff --git a/src/test/run_api_tests.pl b/src/test/run_api_tests.pl
index 0c339f52..634b909a 100755
--- a/src/test/run_api_tests.pl
+++ b/src/test/run_api_tests.pl
@@ -341,14 +341,18 @@ subtest 'migration preconditions of the CPU of a running VM' => sub {
my ($info, $kvm_flags) = @_;
return { 'host-cpu-info' => encode_json($info), 'cpuflags-kvm' => $kvm_flags };
};
- my $source = { vendor => 'GenuineIntel' };
+ my $source = { vendor => 'GenuineIntel', 'model-name' => 'Intel Xeon Gold 6338' };
my $node_kv = {
localhost => $entries->($source, 'avx512f fpu sse'),
- 'other-vendor' =>
- $entries->({ $source->%*, vendor => 'AuthenticAMD' }, 'avx512f fpu sse'),
+ 'other-vendor' => $entries->(
+ { $source->%*, vendor => 'AuthenticAMD', 'model-name' => 'AMD EPYC 7302' },
+ 'avx512f fpu sse',
+ ),
'missing-flag' => $entries->($source, 'fpu sse'),
+ 'other-model' =>
+ $entries->({ $source->%*, 'model-name' => 'Intel Core i9-14900K' }, 'avx512f fpu sse'),
};
- my $nodes = ['localhost', 'other-vendor', 'no-cpu-info', 'missing-flag'];
+ my $nodes = ['localhost', 'other-vendor', 'no-cpu-info', 'missing-flag', 'other-model'];
my $inotify_module = Test::MockModule->new('PVE::INotify');
$inotify_module->mock(nodename => sub { return 'localhost'; });
@@ -406,8 +410,10 @@ subtest 'migration preconditions of the CPU of a running VM' => sub {
is_deeply(
$cpu_reasons->('host,+kvm_pv_eoi,+kvm_pv_unhalt'),
{
+ # the other CPU model is no further reason
'other-vendor' => ['cpu-vendor'],
'missing-flag' => ['host-cpu-flags (allow-missing-cpu-flags)'],
+ 'other-model' => ['warning: host-cpu-model'],
'no-cpu-info' => ['warning: missing-cpu-info'],
},
"reasons for 'host'",
diff --git a/src/test/run_qemu_migrate_tests.pl b/src/test/run_qemu_migrate_tests.pl
index 7e71501e..ffd62701 100755
--- a/src/test/run_qemu_migrate_tests.pl
+++ b/src/test/run_qemu_migrate_tests.pl
@@ -543,9 +543,15 @@ sub merge_hash {
# CPU information of the source node 'pve0' and the target node 'pve1' in the CPU migration tests,
# with nothing preventing the migration. The tests override what they check.
my $default_cpu_info = {
- source => { vendor => 'GenuineIntel' },
+ source => {
+ vendor => 'GenuineIntel',
+ 'model-name' => 'Intel(R) Xeon(R) Gold 6338 CPU @ 2.00GHz',
+ },
nodes => {
- pve1 => { vendor => 'GenuineIntel' },
+ pve1 => {
+ vendor => 'GenuineIntel',
+ 'model-name' => 'Intel(R) Xeon(R) Gold 6338 CPU @ 2.00GHz',
+ },
},
'kvm-flags' => {
pve0 => 'fpu sse',
@@ -1695,6 +1701,29 @@ my $tests = [
. " through the flags of the host CPU, but the node lacks: sse4.2 - use"
. " 'allow-missing-cpu-flags' to override",
),
+ cpu_migration_test(
+ # only missing information needed for checks that can prevent the migration is reported
+ name => '1033_running_host_cpu_target_without_model_name',
+ cpu => 'host',
+ runningcpu => 'host,+kvm_pv_eoi,+kvm_pv_unhalt',
+ cpu_info => {
+ nodes => { pve1 => { 'model-name' => undef } },
+ },
+ ),
+ cpu_migration_test(
+ name => '1033_running_host_cpu_other_model',
+ cpu => 'host',
+ runningcpu => 'host,+kvm_pv_eoi,+kvm_pv_unhalt',
+ cpu_info => {
+ nodes => { pve1 => { 'model-name' => 'Intel(R) Xeon(R) Gold 6342 CPU @ 2.80GHz' } },
+ },
+ expect_log => [
+ "CPU of node 'pve1' might be incompatible: CPU model 'host' is only reliable for"
+ . " live migration between identical CPUs, but the node has 'Intel(R) Xeon(R)"
+ . " Gold 6342 CPU @ 2.80GHz' instead of 'Intel(R) Xeon(R) Gold 6338 CPU @"
+ . " 2.00GHz'",
+ ],
+ ),
{
name => '105_replicated_to_non_replication_target',
target => 'pve1',
--
2.47.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH qemu-server v3 12/18] migrate: block live migration if the target cannot run the virtual CPU
2026-11-30 18:09 [PATCH docs/manager/qemu-server v3 00/18] check the target node's CPU before live migrating a VM Jonas Theisen
` (10 preceding siblings ...)
2026-11-30 18:09 ` [PATCH qemu-server v3 11/18] migrate: warn about live migration of host CPU VMs between CPU models Jonas Theisen
@ 2026-11-30 18:09 ` Jonas Theisen
2026-11-30 18:09 ` [PATCH qemu-server v3 13/18] api: migrate: check the CPU of the target before requesting HA migration Jonas Theisen
` (5 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Jonas Theisen @ 2026-11-30 18:09 UTC (permalink / raw)
To: pve-devel
For VMs with an abstracted CPU configuration, for example with a custom
CPU model or the 'nested-virt' flag, the target is started with the
QEMU CPU of the running instance, instead of generating it again from
the configuration. That QEMU CPU can contain flags that KVM on the
target does not support, for example the Intel-only 'hv-evmcs'
enlightenment that is enabled for Windows 11 guests on Intel hosts.
QEMU on an AMD target then refuses to start:
kvm: Hyper-V enlightened VMCS (hv-evmcs) is not supported by kernel
and the migration fails only after its preparation.
The same applies to all other CPU models that do not pass through the
host CPU, like 'x86-64-v3' or 'Skylake-Server'. Their QEMU CPU is
generated again from the configuration, mostly with the same flags,
and as 'enforce' is set for them, QEMU on the target refuses to start
if KVM lacks any flag the model enables, including those it enables by
default. One exception is 'hv-evmcs', which is only enabled on Intel
hosts, so it is not checked for these models. Without nested
virtualization, which makes the CPU configuration abstracted, the guest
cannot use it anyway.
Check upfront whether KVM on the target supports all enabled Hyper-V
enlightenments of the virtual CPU, which QEMU always requires, and all
of its other enabled flags if 'enforce' is set. This is not needed with
TCG, which emulates all flags. The flags a CPU model enables by default
are queried from QEMU of the running VM. This uses the CPU flags that
pvestatd already broadcasts for each node. Only flags that KVM supports
on the source node are considered, so that QEMU CPU properties that are
not CPU flags are not reported as missing.
Signed-off-by: Jonas Theisen <j.theisen@proxmox.com>
---
src/PVE/API2/Qemu.pm | 3 +-
src/PVE/QemuMigrate/Helpers.pm | 67 +++++++++++++-
src/test/MigrationTest/QemuMigrateMock.pm | 11 ++-
src/test/run_api_tests.pl | 4 +
src/test/run_qemu_migrate_tests.pl | 104 +++++++++++++++++++++-
5 files changed, 184 insertions(+), 5 deletions(-)
diff --git a/src/PVE/API2/Qemu.pm b/src/PVE/API2/Qemu.pm
index 1fd46733..9824a59c 100644
--- a/src/PVE/API2/Qemu.pm
+++ b/src/PVE/API2/Qemu.pm
@@ -5619,7 +5619,8 @@ __PACKAGE__->register_method({
type => {
type => 'string',
description => "The check that failed.",
- enum => ['cpu-vendor', 'host-cpu-flags'],
+ enum =>
+ ['cpu-vendor', 'host-cpu-flags', 'vm-cpu-flags'],
},
message => {
type => 'string',
diff --git a/src/PVE/QemuMigrate/Helpers.pm b/src/PVE/QemuMigrate/Helpers.pm
index a131104e..8d255716 100644
--- a/src/PVE/QemuMigrate/Helpers.pm
+++ b/src/PVE/QemuMigrate/Helpers.pm
@@ -201,6 +201,10 @@ my sub format_flag_list {
#
# The VM's CPU is parsed by parse_qemu_cpu_string(), with:
# - 'kvm' set if the VM uses KVM
+# - 'kept' set if the target is started with the same QEMU CPU, see is_running_cpu_kept()
+# - 'enforce' set if QEMU refuses to start without all enabled flags
+# - the enabled flags as 'flags' hash, including the flags the CPU model enables by default if
+# 'enforce' is set
#
# The CPU information of the nodes is in the format of get_host_cpu_info(), plus:
# - the CPU flags KVM supports as 'kvm-flags' hash
@@ -305,6 +309,39 @@ my $target_cpu_checks = [
. " identical CPUs, but the node has '$target_model' instead of '$source_model'";
},
},
+ {
+ type => 'vm-cpu-flags',
+ severity => 'error',
+ needs => ['kvm-flags'],
+ applies => sub {
+ my ($cpu) = @_;
+ # Other models are generated again from the configuration on the target, mostly with
+ # the same flags, so it must support them as well. With TCG, all flags are emulated.
+ return $cpu->{kvm} && ($cpu->{kept} || !is_host_cpu_model($cpu));
+ },
+ check => sub {
+ my ($cpu, $source, $target) = @_;
+
+ my ($source_flags, $target_flags) =
+ ($source->{'kvm-flags'}, $target->{'kvm-flags'});
+ return if !$source_flags;
+
+ # QEMU refuses to start with unsupported Hyper-V enlightenments, and with any other
+ # unsupported flag only if 'enforce' is set. Requiring support on the source skips
+ # properties that are no CPU flags. hv-evmcs is only enabled on Intel hosts, so the
+ # target does not enable it if the CPU is generated again there.
+ my @missing = sort grep {
+ ($cpu->{enforce} || m/^hv-/)
+ && ($cpu->{kept} || $_ ne 'hv-evmcs')
+ && $source_flags->{$_}
+ && !$target_flags->{$_}
+ } keys $cpu->{flags}->%*;
+ return if !scalar(@missing);
+
+ return "KVM on the node does not support flags of the VM's virtual CPU: "
+ . format_flag_list(\@missing);
+ },
+ },
];
# Returns the issues of the target node. If it lacks CPU information needed by a check that can
@@ -338,6 +375,18 @@ my sub get_target_cpu_issues {
return $issues;
}
+# Returns the flags a CPU model enables by default, as QEMU of the running VM defines them.
+my sub get_cpu_model_flags {
+ my ($vmid, $model, $understood) = @_;
+
+ my $expansion =
+ mon_cmd($vmid, 'query-cpu-model-expansion', type => 'full', model => { name => $model });
+
+ # the expansion also includes CPU properties that are no flags
+ return [grep { !$understood || $understood->{$_} }
+ PVE::QemuServer::CPUFlags::get_cpu_expansion_flags($expansion)];
+}
+
=head3 is_running_cpu_kept
my $kept = is_running_cpu_kept($conf);
@@ -380,6 +429,22 @@ sub check_target_cpu_compatibility {
my $cpu = parse_qemu_cpu_string(PVE::QemuServer::CPUConfig::get_cpu_from_running_vm($pid));
my $arch = PVE::QemuServer::Helpers::get_vm_arch($conf);
$cpu->{kvm} = $conf->{kvm} // PVE::QemuServer::CPUConfig::is_native_arch($arch);
+ $cpu->{kept} = is_running_cpu_kept($conf);
+ $cpu->{enforce} = PVE::JSONSchema::parse_boolean($cpu->{props}->{enforce} // 'off');
+
+ my $understood = get_understood_cpu_flags();
+
+ $cpu->{flags} = {};
+ if ($cpu->{enforce} && $cpu->{kvm} && !is_host_cpu_model($cpu)) {
+ my $model_flags = eval { get_cpu_model_flags($vmid, $cpu->{model}, $understood) };
+ warn "unable to query the flags of CPU model '$cpu->{model}' - $@" if $@;
+ $cpu->{flags}->{$_} = 1 for ($model_flags // [])->@*;
+ }
+ for my $prop (keys $cpu->{props}->%*) {
+ my $enabled = PVE::JSONSchema::parse_boolean($cpu->{props}->{$prop});
+ next if !defined($enabled);
+ $enabled ? ($cpu->{flags}->{$prop} = 1) : delete($cpu->{flags}->{$prop});
+ }
my $checks = [grep { $_->{applies}->($cpu) } $target_cpu_checks->@*];
return {} if !scalar($checks->@*);
@@ -390,7 +455,7 @@ sub check_target_cpu_compatibility {
my $source_info = get_node_cpu_info($local_node);
$source_info = PVE::QemuServer::Helpers::get_host_cpu_info() if !scalar(keys $source_info->%*);
$source_info->{'kvm-flags'} = get_node_kvm_cpu_flags($local_node);
- $source_info->{'understood-flags'} = get_understood_cpu_flags();
+ $source_info->{'understood-flags'} = $understood;
my $issues_by_node = {};
for my $node ($nodes->@*) {
diff --git a/src/test/MigrationTest/QemuMigrateMock.pm b/src/test/MigrationTest/QemuMigrateMock.pm
index e35aba9f..6f351375 100644
--- a/src/test/MigrationTest/QemuMigrateMock.pm
+++ b/src/test/MigrationTest/QemuMigrateMock.pm
@@ -238,6 +238,15 @@ $MigrationTest::Shared::qemu_migrate_helpers_module->mock(
return $MigrationTest::Shared::qemu_migrate_helpers_module->original(
'check_target_cpu_compatibility')->(@_);
},
+ mon_cmd => sub {
+ my ($vmid, $command, %params) = @_;
+
+ if ($command eq 'query-cpu-model-expansion') {
+ my $flags = $test_cpu_info->{'model-flags'}->{ $params{model}->{name} } // [];
+ return { model => { props => { map { $_ => JSON::true } $flags->@* } } };
+ }
+ die "mon_cmd (mocked) - implement me: $command";
+ },
);
$MigrationTest::Shared::cluster_module->mock(
@@ -261,7 +270,7 @@ $MigrationTest::Shared::cluster_module->mock(
my $qemu_server_cpuflags_module = Test::MockModule->new("PVE::QemuServer::CPUFlags");
$qemu_server_cpuflags_module->mock(
query_understood_cpu_flags => sub {
- return [qw(avx512f fpu hv-relaxed lahf-lm sse sse4.2)];
+ return [qw(avx512f avx512vl fpu hv-relaxed lahf-lm sse sse4.2)];
},
);
diff --git a/src/test/run_api_tests.pl b/src/test/run_api_tests.pl
index 634b909a..8e1d80ad 100755
--- a/src/test/run_api_tests.pl
+++ b/src/test/run_api_tests.pl
@@ -363,6 +363,8 @@ subtest 'migration preconditions of the CPU of a running VM' => sub {
check_local_resources => sub {
return ([], {}, { map { $_ => [] } $nodes->@* });
},
+ # the expansion of the CPU model, which enables no flags by default
+ mon_cmd => sub { return { model => { props => {} } }; },
);
my $cpu_flags_module = Test::MockModule->new('PVE::QemuServer::CPUFlags');
$cpu_flags_module->mock(
@@ -422,6 +424,8 @@ subtest 'migration preconditions of the CPU of a running VM' => sub {
$cpu_reasons->('kvm64,enforce,+avx512f,+kvm_pv_eoi,+kvm_pv_unhalt'),
{
'other-vendor' => ['warning: cpu-vendor'],
+ 'missing-flag' => ['vm-cpu-flags'],
+ 'no-cpu-info' => ['warning: missing-cpu-info'],
},
'reasons for another CPU model',
);
diff --git a/src/test/run_qemu_migrate_tests.pl b/src/test/run_qemu_migrate_tests.pl
index ffd62701..a08cac19 100755
--- a/src/test/run_qemu_migrate_tests.pl
+++ b/src/test/run_qemu_migrate_tests.pl
@@ -609,8 +609,9 @@ my $tests = [
# target_volids - hash of volids on the target at the beginning
# vm_status - hash with running, runningmachine and optionally runningcpu
# cpu_info - hash with the CPU information of the 'source' node and of each
- # other node in 'nodes', and the KVM CPU flags of each node in
- # 'kvm-flags', see cpu_migration_test() for tests of the CPU checks
+ # other node in 'nodes', the KVM CPU flags of each node in
+ # 'kvm-flags', and the flags each CPU model enables by default in
+ # 'model-flags', see cpu_migration_test() for tests of the CPU checks
# expected_calls - hash whose keys are calls which are required
# to be made if the migration gets far enough
# expect_die - expect the migration call to fail, and an error message
@@ -1724,6 +1725,105 @@ my $tests = [
. " 2.00GHz'",
],
),
+ cpu_migration_test(
+ name => '1033_running_kept_cpu_supported_flags',
+ cpu => 'kvm64,flags=+nested-virt',
+ runningcpu => 'kvm64,enforce,+vmx,hv_evmcs,hv_relaxed,hv_spinlocks=0x1fff,+kvm_pv_eoi',
+ cpu_kept => 1,
+ cpu_info => {
+ 'kvm-flags' => {
+ pve0 => 'fpu hv-evmcs hv-relaxed hv-spinlocks kvm-pv-eoi sse vmx',
+ pve1 => 'fpu hv-evmcs hv-relaxed kvm-pv-eoi sse vmx',
+ },
+ },
+ ),
+ cpu_migration_test(
+ name => '1033_running_kept_cpu_unsupported_flags',
+ cpu => 'kvm64,flags=+nested-virt',
+ runningcpu => 'kvm64,enforce,+vmx,hv_evmcs,hv_relaxed,hv_spinlocks=0x1fff,+kvm_pv_eoi',
+ cpu_info => {
+ nodes => { pve1 => { vendor => 'AuthenticAMD' } },
+ 'kvm-flags' => {
+ pve0 => 'fpu hv-evmcs hv-relaxed hv-spinlocks kvm-pv-eoi sse vmx',
+ pve1 => 'fpu hv-relaxed kvm-pv-eoi sse svm',
+ },
+ },
+ expect_die => "can't migrate VM to 'pve1' - incompatible CPU: KVM on the node does not"
+ . " support flags of the VM's virtual CPU: hv-evmcs, vmx",
+ ),
+ cpu_migration_test(
+ # hv-evmcs is only enabled on Intel hosts, so the target generates the CPU without it
+ name => '1033_running_builtin_cpu_hv_evmcs_other_vendor',
+ cpu => 'x86-64-v2-AES',
+ config => { ostype => 'win11' },
+ runningcpu => 'qemu64,+aes,enforce,hv_evmcs,hv_relaxed,+kvm_pv_eoi,+sse4.2',
+ cpu_info => {
+ nodes => { pve1 => { vendor => 'AuthenticAMD' } },
+ 'kvm-flags' => {
+ pve0 => 'aes fpu hv-evmcs hv-relaxed kvm-pv-eoi sse sse4.2 vmx',
+ pve1 => 'aes fpu hv-relaxed kvm-pv-eoi sse sse4.2 svm',
+ },
+ },
+ expect_log => [
+ "CPU of node 'pve1' might be incompatible: live migration from GenuineIntel to"
+ . " AuthenticAMD is not guaranteed to work",
+ ],
+ ),
+ cpu_migration_test(
+ # with TCG, all flags are emulated
+ name => '1033_running_kept_cpu_tcg_target_without_kvm_flags',
+ cpu => 'custom-mycpu',
+ config => { kvm => 0 },
+ runningcpu => 'kvm64,enforce,+sse4.2',
+ cpu_kept => 1,
+ cpu_info => {
+ 'kvm-flags' => { pve1 => undef },
+ },
+ ),
+ cpu_migration_test(
+ name => '1033_running_builtin_cpu_missing_flags',
+ cpu => 'x86-64-v3',
+ runningcpu =>
+ 'qemu64,enforce,+abm,+aes,+avx,+avx2,+kvm_pv_eoi,+sse4.2,vendor=GenuineIntel',
+ cpu_info => {
+ 'kvm-flags' => {
+ pve0 => 'abm aes avx avx2 fpu kvm-pv-eoi sse sse4.2',
+ pve1 => 'abm aes avx fpu kvm-pv-eoi sse sse4.2',
+ },
+ },
+ expect_die => "can't migrate VM to 'pve1' - incompatible CPU: KVM on the node does not"
+ . " support flags of the VM's virtual CPU: avx2",
+ ),
+ cpu_migration_test(
+ name => '1033_running_named_cpu_missing_model_flags',
+ cpu => 'Skylake-Server',
+ runningcpu => 'Skylake-Server,enforce,+kvm_pv_eoi,-avx512vl',
+ cpu_info => {
+ 'kvm-flags' => {
+ pve0 => 'avx512f avx512vl fpu kvm-pv-eoi migratable sse sse4.2',
+ pve1 => 'fpu kvm-pv-eoi sse',
+ },
+ 'model-flags' => {
+ 'Skylake-Server' => [qw(avx512f avx512vl fpu migratable sse sse4_2)],
+ },
+ },
+ expect_die => "can't migrate VM to 'pve1' - incompatible CPU: KVM on the node does not"
+ . " support flags of the VM's virtual CPU: avx512f, sse4.2",
+ ),
+ cpu_migration_test(
+ name => '1033_running_named_cpu_supported_model_flags',
+ cpu => 'Skylake-Server',
+ runningcpu => 'Skylake-Server,enforce,+kvm_pv_eoi,-avx512vl',
+ cpu_info => {
+ 'kvm-flags' => {
+ pve0 => 'avx512f fpu kvm-pv-eoi migratable sse sse4.2',
+ pve1 => 'avx512f fpu kvm-pv-eoi sse sse4.2',
+ },
+ 'model-flags' => {
+ 'Skylake-Server' => [qw(avx512f avx512vl fpu migratable sse sse4_2)],
+ },
+ },
+ ),
{
name => '105_replicated_to_non_replication_target',
target => 'pve1',
--
2.47.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH qemu-server v3 13/18] api: migrate: check the CPU of the target before requesting HA migration
2026-11-30 18:09 [PATCH docs/manager/qemu-server v3 00/18] check the target node's CPU before live migrating a VM Jonas Theisen
` (11 preceding siblings ...)
2026-11-30 18:09 ` [PATCH qemu-server v3 12/18] migrate: block live migration if the target cannot run the virtual CPU Jonas Theisen
@ 2026-11-30 18:09 ` Jonas Theisen
2026-11-30 18:09 ` [PATCH manager v3 14/18] pvestatd: broadcast host CPU information relevant for live migration Jonas Theisen
` (4 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Jonas Theisen @ 2026-11-30 18:09 UTC (permalink / raw)
To: pve-devel
For HA-managed VMs, the migrate API only requests the migration from
the HA stack, which then runs it in a separate task on the LRM. If the
target node's CPU cannot run the VM, that task fails, but the API call
and its task have already succeeded, so the caller only learns about it
from the LRM's task log or the HA status.
Run the CPU compatibility check before requesting the HA migration, as
done for the storage checks already, so that the API call fails with the
reason directly. Options that override an incompatibility, like
'allow-missing-cpu-flags', are honored as in the migration itself, but
only if they are forwarded to the HA stack, which requires pve-manager
9.2.31 or newer on this node. The warnings are not reported here, as the
migration task of the LRM logs them.
Migrations that the HA stack starts on its own, for example for
maintenance mode or automatic rebalancing, do not use this API path and
still fail in the migration task, after which the HA stack currently
retries them without backoff, see bug #8059.
Link: https://bugzilla.proxmox.com/show_bug.cgi?id=8059
Signed-off-by: Jonas Theisen <j.theisen@proxmox.com>
---
src/PVE/API2/Qemu.pm | 19 +++++++--
src/test/run_api_tests.pl | 87 +++++++++++++++++++++++++++++++++++++++
2 files changed, 102 insertions(+), 4 deletions(-)
diff --git a/src/PVE/API2/Qemu.pm b/src/PVE/API2/Qemu.pm
index 9824a59c..3f520125 100644
--- a/src/PVE/API2/Qemu.pm
+++ b/src/PVE/API2/Qemu.pm
@@ -5934,7 +5934,8 @@ __PACKAGE__->register_method({
PVE::QemuConfig->check_lock($conf);
- if (PVE::QemuServer::check_running($vmid)) {
+ my $pid = PVE::QemuServer::check_running($vmid);
+ if ($pid) {
die "can't migrate running VM without --online\n" if !$param->{online};
my $repl_conf = PVE::ReplicationConfig->new();
@@ -5980,15 +5981,25 @@ __PACKAGE__->register_method({
}
if (PVE::HA::Config::vm_is_ha_managed($vmid) && $rpcenv->{type} ne 'ha') {
+ # Only nodes with pve-manager 9.2.31 or newer have an ha-manager that accepts
+ # additional migration options.
+ my $forwards_options =
+ PVE::Cluster::node_pvecfg_version_at_least($localnode, 9, 2, 31);
+
+ # The HA stack migrates the VM in a separate task later, so refuse an incompatible
+ # target here, where the caller sees why. The task logs the warnings. Options that
+ # override an incompatibility only count if they reach the HA stack.
+ my $check_opts = $forwards_options ? $param : {};
+ PVE::QemuMigrate::Helpers::assert_target_cpu_compatibility(
+ $vmid, $conf, $pid, $target, $check_opts,
+ ) if $param->{online};
my $hacmd = sub {
my $upid = shift;
my $extra_opts = '';
my $cmd = ['ha-manager', 'migrate', "vm:$vmid", $target];
- # Only nodes with pve-manager 9.2.31 or newer have an ha-manager that accepts
- # additional migration options.
- if (PVE::Cluster::node_pvecfg_version_at_least($localnode, 9, 2, 31)) {
+ if ($forwards_options) {
for my $prop (sort keys $ha_migrate_props->%*) {
if (defined(my $value = $param->{$prop})) {
push($cmd->@*, "--$prop", $value);
diff --git a/src/test/run_api_tests.pl b/src/test/run_api_tests.pl
index 8e1d80ad..5eeb7e83 100755
--- a/src/test/run_api_tests.pl
+++ b/src/test/run_api_tests.pl
@@ -435,6 +435,93 @@ subtest 'migration preconditions of the CPU of a running VM' => sub {
mock_unreachable_config();
};
+subtest 'migration of an HA-managed VM checks the CPU before requesting it' => sub {
+ $node_versions->{pve2} = $min_version;
+ # the version of the local node decides whether migration options are forwarded to the HA stack
+ my $inotify_module = Test::MockModule->new('PVE::INotify');
+ $inotify_module->mock(nodename => sub { return 'localhost'; });
+ $node_versions->{localhost} = '9.2.31';
+ $cluster_module->mock(get_config => sub { return $raw_without_identity; });
+ $qemu_config_module->mock(
+ load_config => sub { return { memory => 512 }; },
+ check_lock => sub { return; },
+ );
+ $replication_config_module->mock(find_local_replication_job => sub { return; });
+ $qemu_server_module->mock(check_storage_availability => sub { return; });
+ my $rpcenv_module = Test::MockModule->new('PVE::RPCEnvironment');
+ $rpcenv_module->mock(fork_worker => sub { die "reached fork_worker\n"; });
+
+ my $ha_managed;
+ my $ha_config_module = Test::MockModule->new('PVE::HA::Config');
+ $ha_config_module->mock(vm_is_ha_managed => sub { return $ha_managed; });
+
+ # the arguments of the last CPU check, and its error
+ my ($checked, $cpu_error);
+ my $migrate_helpers_module = Test::MockModule->new('PVE::QemuMigrate::Helpers');
+ $migrate_helpers_module->mock(
+ assert_target_cpu_compatibility => sub {
+ my ($vmid, $conf, $pid, $node, $opts) = @_;
+ $checked = { vmid => $vmid, pid => $pid, node => $node, opts => { $opts->%* } };
+ die $cpu_error if defined($cpu_error);
+ return [];
+ },
+ );
+
+ # stopped VMs are migrated offline, which is expected
+ local $SIG{__WARN__} = sub { warn $_[0] if $_[0] !~ m/^VM isn't running/ };
+
+ my $refused = "can't migrate VM to 'pve2' - incompatible CPU: some reason\n";
+ for my $running (1234, 0) {
+ $qemu_server_module->mock(check_running => sub { return $running; });
+ for my $managed (1, 0) {
+ $ha_managed = $managed;
+ my $what = ($running ? 'running' : 'stopped') . ($managed ? ', HA-managed' : '');
+ my $checks = $running && $managed;
+
+ ($checked, $cpu_error) = (undef, $refused);
+ is(
+ api_error(
+ 'migrate_vm',
+ { target => 'pve2', online => 1, 'allow-missing-cpu-flags' => 1 },
+ ),
+ $checks ? $refused : "reached fork_worker\n",
+ "VM $what: " . ($checks ? 'incompatible CPU refused' : 'CPU not checked'),
+ );
+ next if !$checks;
+
+ is_deeply(
+ [$checked->@{qw(vmid pid node)}, $checked->{opts}->{'allow-missing-cpu-flags'}],
+ [100, 1234, 'pve2', 1],
+ "VM $what: the running VM is checked with the migration options",
+ );
+
+ $cpu_error = undef;
+ is(
+ api_error('migrate_vm', { target => 'pve2', online => 1 }),
+ "reached fork_worker\n",
+ "VM $what: compatible CPU, HA migration requested",
+ );
+ }
+ }
+
+ $qemu_server_module->mock(check_running => sub { return 1234; });
+ ($ha_managed, $cpu_error, $node_versions->{localhost}) = (1, undef, '9.2.30');
+ api_error('migrate_vm', { target => 'pve2', online => 1, 'allow-missing-cpu-flags' => 1 });
+ is(
+ $checked->{opts}->{'allow-missing-cpu-flags'},
+ undef,
+ 'options the HA stack of an older node does not get do not override the check',
+ );
+ $node_versions->{localhost} = undef;
+
+ $qemu_server_module->mock(check_running => sub { return 0; });
+ $qemu_server_module->unmock('check_storage_availability');
+ $replication_config_module->unmock('find_local_replication_job');
+ $qemu_config_module->unmock('check_lock');
+ $cluster_module->unmock('get_config');
+ mock_unreachable_config();
+};
+
subtest 'clone target nodes' => sub {
my $inotify_module = Test::MockModule->new('PVE::INotify');
$inotify_module->mock(nodename => sub { return 'pve1'; });
--
2.47.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH manager v3 14/18] pvestatd: broadcast host CPU information relevant for live migration
2026-11-30 18:09 [PATCH docs/manager/qemu-server v3 00/18] check the target node's CPU before live migrating a VM Jonas Theisen
` (12 preceding siblings ...)
2026-11-30 18:09 ` [PATCH qemu-server v3 13/18] api: migrate: check the CPU of the target before requesting HA migration Jonas Theisen
@ 2026-11-30 18:09 ` Jonas Theisen
2026-11-30 18:09 ` [PATCH manager v3 15/18] ui: migrate: show why the CPU of the target node is incompatible Jonas Theisen
` (3 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Jonas Theisen @ 2026-11-30 18:09 UTC (permalink / raw)
To: pve-devel
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, currently the
CPU vendor and model name of the node, so that the source node of
a migration can check this. The information cannot change while
pvestatd runs, so it is only queried once, but broadcast again if the
node key-value entry got lost.
Signed-off-by: Jonas Theisen <j.theisen@proxmox.com>
---
PVE/Service/pvestatd.pm | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/PVE/Service/pvestatd.pm b/PVE/Service/pvestatd.pm
index 2f6a2671..dd2b207a 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;
@@ -170,6 +171,19 @@ my sub broadcast_static_node_info {
}
}
+# the host CPU cannot change while pvestatd is running
+my $host_cpu_info;
+
+my sub broadcast_host_cpu_info {
+ $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
@@ -295,6 +309,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
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH manager v3 15/18] ui: migrate: show why the CPU of the target node is incompatible
2026-11-30 18:09 [PATCH docs/manager/qemu-server v3 00/18] check the target node's CPU before live migrating a VM Jonas Theisen
` (13 preceding siblings ...)
2026-11-30 18:09 ` [PATCH manager v3 14/18] pvestatd: broadcast host CPU information relevant for live migration Jonas Theisen
@ 2026-11-30 18:09 ` Jonas Theisen
2026-11-30 18:09 ` [PATCH manager v3 16/18] fix #6535: ui: migrate: show CPU warnings for the target node Jonas Theisen
` (2 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Jonas Theisen @ 2026-11-30 18:09 UTC (permalink / raw)
To: pve-devel
Show the reasons the migration precondition API reports for target
nodes whose CPU cannot run a VM after a live migration, instead of
only failing once the migration task runs.
If root can override all of these reasons with migration options, offer
a checkbox to ignore the incompatibility, which sets these options and
shows the reasons as warnings instead. Which options to set is taken
from the API, so that further overridable checks need no UI changes.
The checkbox is also shown for HA-managed VMs, as the migration API
forwards the override options to the HA stack.
Signed-off-by: Jonas Theisen <j.theisen@proxmox.com>
---
www/manager6/window/Migrate.js | 54 ++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)
diff --git a/www/manager6/window/Migrate.js b/www/manager6/window/Migrate.js
index 3dd2b9ee..206fcfe3 100644
--- a/www/manager6/window/Migrate.js
+++ b/www/manager6/window/Migrate.js
@@ -29,6 +29,8 @@ Ext.define('PVE.window.Migrate', {
allowedNodes: undefined,
overwriteLocalResourceCheck: false,
hasLocalResources: false,
+ ignoreCpuIncompatibility: false,
+ cpuOverrides: [],
withConntrackState: true,
bothHaveDbusVmstate: false,
configCheck: true,
@@ -64,6 +66,7 @@ Ext.define('PVE.window.Migrate', {
return false;
}
},
+ cpuOverrideCheckboxHidden: (get) => !get('migration.cpuOverrides').length,
conntrackStateCheckboxHidden: (get) =>
!get('running') ||
get('vmtype') !== 'qemu' ||
@@ -147,6 +150,12 @@ Ext.define('PVE.window.Migrate', {
params.force = 1;
}
+ if (vm.get('migration.ignoreCpuIncompatibility')) {
+ for (const override of vm.get('migration.cpuOverrides')) {
+ params[override] = 1;
+ }
+ }
+
if (vm.get('migration.bothHaveDbusVmstate') && vm.get('migration.withConntrackState')) {
params['with-conntrack-state'] = 1;
}
@@ -358,6 +367,30 @@ Ext.define('PVE.window.Migrate', {
me.checkGuestIdentitySupport(migration, disallowed);
+ let cpuBlockers = disallowed['incompatible-cpu'] ?? [];
+ // the override options are reserved for root
+ let canOverrideCpu =
+ Proxmox.UserName === 'root@pam' &&
+ cpuBlockers.length > 0 &&
+ cpuBlockers.every((blocker) => blocker.override);
+ migration.cpuOverrides = canOverrideCpu
+ ? [...new Set(cpuBlockers.map((blocker) => blocker.override))]
+ : [];
+
+ for (const cpuBlocker of cpuBlockers) {
+ const text = Ext.String.format(
+ gettext('CPU of selected target is incompatible: {0}'),
+ cpuBlocker.message,
+ );
+
+ if (canOverrideCpu && migration.ignoreCpuIncompatibility) {
+ migration.preconditions.push({ text, severity: 'warning' });
+ } else {
+ migration.possible = false;
+ migration.preconditions.push({ text, severity: 'error' });
+ }
+ }
+
let blockingResources = [];
let mappedResources = migrateStats['mapped-resource-info'] ?? {};
@@ -751,6 +784,27 @@ Ext.define('PVE.window.Migrate', {
},
},
},
+ {
+ xtype: 'proxmoxcheckbox',
+ name: 'ignoreCpuIncompatibility',
+ fieldLabel: gettext('Ignore CPU incompatibility'),
+ autoEl: {
+ tag: 'div',
+ 'data-qtip': gettext(
+ 'Migrate even if the CPU of the selected target is incompatible. The VM might crash or fail to migrate.',
+ ),
+ },
+ bind: {
+ hidden: '{cpuOverrideCheckboxHidden}',
+ value: '{migration.ignoreCpuIncompatibility}',
+ },
+ listeners: {
+ change: {
+ fn: 'checkMigratePreconditions',
+ extraArg: true,
+ },
+ },
+ },
{
xtype: 'proxmoxcheckbox',
name: 'withConntrackState',
--
2.47.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH manager v3 16/18] fix #6535: ui: migrate: show CPU warnings for the target node
2026-11-30 18:09 [PATCH docs/manager/qemu-server v3 00/18] check the target node's CPU before live migrating a VM Jonas Theisen
` (14 preceding siblings ...)
2026-11-30 18:09 ` [PATCH manager v3 15/18] ui: migrate: show why the CPU of the target node is incompatible Jonas Theisen
@ 2026-11-30 18:09 ` Jonas Theisen
2026-11-30 18:09 ` [PATCH manager v3 17/18] api: nodes: migrateall: skip VMs whose CPU is incompatible with the target Jonas Theisen
2026-11-30 18:09 ` [PATCH docs v3 18/18] qm: document the CPU checks for live migration Jonas Theisen
17 siblings, 0 replies; 19+ messages in thread
From: Jonas Theisen @ 2026-11-30 18:09 UTC (permalink / raw)
To: pve-devel
Show the warnings the migration precondition API reports for the CPU
of the selected target node, for example when live migrating between
CPU vendors, which is not guaranteed to work.
Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=6535
Signed-off-by: Jonas Theisen <j.theisen@proxmox.com>
---
www/manager6/window/Migrate.js | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/www/manager6/window/Migrate.js b/www/manager6/window/Migrate.js
index 206fcfe3..4f919127 100644
--- a/www/manager6/window/Migrate.js
+++ b/www/manager6/window/Migrate.js
@@ -391,6 +391,15 @@ Ext.define('PVE.window.Migrate', {
}
}
+ for (const cpuWarning of migrateStats['cpu-warnings']?.[target] ?? []) {
+ const text = Ext.String.format(
+ gettext('CPU of selected target might be incompatible: {0}'),
+ cpuWarning.message,
+ );
+
+ migration.preconditions.push({ text, severity: 'warning' });
+ }
+
let blockingResources = [];
let mappedResources = migrateStats['mapped-resource-info'] ?? {};
--
2.47.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH manager v3 17/18] api: nodes: migrateall: skip VMs whose CPU is incompatible with the target
2026-11-30 18:09 [PATCH docs/manager/qemu-server v3 00/18] check the target node's CPU before live migrating a VM Jonas Theisen
` (15 preceding siblings ...)
2026-11-30 18:09 ` [PATCH manager v3 16/18] fix #6535: ui: migrate: show CPU warnings for the target node Jonas Theisen
@ 2026-11-30 18:09 ` Jonas Theisen
2026-11-30 18:09 ` [PATCH docs v3 18/18] qm: document the CPU checks for live migration Jonas Theisen
17 siblings, 0 replies; 19+ messages in thread
From: Jonas Theisen @ 2026-11-30 18:09 UTC (permalink / raw)
To: pve-devel
The migration precondition API reports target nodes whose CPU cannot
run a VM after a live migration. Skip such VMs with the reason in the
log, like for the other failed preconditions, instead of starting
a migration task that fails right away.
Signed-off-by: Jonas Theisen <j.theisen@proxmox.com>
---
PVE/API2/Nodes.pm | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm
index aa35a696..4eb36fe2 100644
--- a/PVE/API2/Nodes.pm
+++ b/PVE/API2/Nodes.pm
@@ -2684,6 +2684,11 @@ my $create_migrate_worker = sub {
$invalidConditions .= "\n Has unavailable resources: ";
$invalidConditions .= join(', ', $unavail_resources->@*);
}
+
+ if (my $incompatible_cpu = $not_allowed_nodes->{$target}->{'incompatible-cpu'}) {
+ $invalidConditions .= "\n Has incompatible CPU: ";
+ $invalidConditions .= join('; ', map { $_->{message} } $incompatible_cpu->@*);
+ }
}
if ($invalidConditions && $invalidConditions ne '') {
--
2.47.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH docs v3 18/18] qm: document the CPU checks for live migration
2026-11-30 18:09 [PATCH docs/manager/qemu-server v3 00/18] check the target node's CPU before live migrating a VM Jonas Theisen
` (16 preceding siblings ...)
2026-11-30 18:09 ` [PATCH manager v3 17/18] api: nodes: migrateall: skip VMs whose CPU is incompatible with the target Jonas Theisen
@ 2026-11-30 18:09 ` Jonas Theisen
17 siblings, 0 replies; 19+ messages in thread
From: Jonas Theisen @ 2026-11-30 18:09 UTC (permalink / raw)
To: pve-devel
Document that live migrations known not to work because of the target
node's CPU are now refused, for all CPU types, how root can override the
check of the CPU flags for VMs with the 'host' or 'max' CPU type, the
warnings about live migrations between different CPU vendors and models,
and how the checks apply to HA-managed VMs.
Signed-off-by: Jonas Theisen <j.theisen@proxmox.com>
---
qm.adoc | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/qm.adoc b/qm.adoc
index cfa8587..102966b 100644
--- a/qm.adoc
+++ b/qm.adoc
@@ -1867,6 +1867,38 @@ For Live Migration to work, there are some things required:
vendor *might* work depending on the actual models and VMs CPU type
configured, but it cannot be guaranteed - so please test before deploying
such a setup in production.
++
+{pve} refuses live migrations that are known not to work:
++
+--
+** VMs with the CPU type `host`, or `max` with KVM, to a node with a CPU from a
+ different vendor, or whose CPU lacks flags of the source node's CPU, as the
+ guest might use them.
+** VMs with any other CPU type and KVM, for example `x86-64-v3` or a custom CPU
+ type, to a node that does not support all flags of the VM's virtual CPU,
+ including the flags the CPU type enables by default. QEMU would refuse to
+ start the VM on such a node.
+--
++
+The migration dialog and `qm migrate` show the reason, and migrating all VMs
+of a node skips such VMs. For live migrations between CPU vendors with other
+CPU types, a warning is shown, as guests can become unstable, sometimes only a
+while after the migration. A warning is also shown for VMs with the CPU type
+`host` or `max` if the CPU models of the nodes differ, as live migration with
+these CPU types is only reliable between identical CPUs. Checking the CPU vendor
+and model requires the target node to run a {pve} version that reports them.
+Otherwise, a warning is shown for VMs with the CPU type `host` or `max`.
++
+As the flags supported by KVM also depend on the kernel version, `root@pam`
+can override the check of the flags for the CPU types `host` and `max` with
+the `--allow-missing-cpu-flags` option of `qm migrate`, or the 'Ignore CPU
+incompatibility' checkbox of the migration dialog. The `--force` option, which
+the HA stack uses for its migrations, does not override this check.
++
+The checks also apply to migrations of HA-managed VMs. A migration requested
+through the API or web interface is refused right away. Migrations that the HA
+stack starts on its own, for example for maintenance mode, cannot override the
+check and fail.
Conntrack State Migration
^^^^^^^^^^^^^^^^^^^^^^^^^
--
2.47.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
end of thread, other threads:[~2026-11-30 18:13 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 18:09 [PATCH docs/manager/qemu-server v3 00/18] check the target node's CPU before live migrating a VM Jonas Theisen
2026-11-30 18:09 ` [PATCH qemu-server v3 01/18] buildsys: ignore migration test runtime files Jonas Theisen
2026-11-30 18:09 ` [PATCH qemu-server v3 02/18] test: migration: allow checking for warnings and errors in the log Jonas Theisen
2026-11-30 18:09 ` [PATCH qemu-server v3 03/18] cpu flags: normalize underscores in all CPU flag names Jonas Theisen
2026-11-30 18:09 ` [PATCH qemu-server v3 04/18] test: api: factor out validating the migration preconditions Jonas Theisen
2026-11-30 18:09 ` [PATCH qemu-server v3 05/18] cpu flags: factor out parsing the broadcast CPU flags of a node Jonas Theisen
2026-11-30 18:09 ` [PATCH qemu-server v3 06/18] migrate: factor out whether the running virtual CPU is kept Jonas Theisen
2026-11-30 18:09 ` [PATCH qemu-server v3 07/18] cpu flags: factor out the flags of a CPU model expansion Jonas Theisen
2026-11-30 18:09 ` [PATCH qemu-server v3 08/18] migrate: block live migration of host CPU VMs between CPU vendors Jonas Theisen
2026-11-30 18:09 ` [PATCH qemu-server v3 09/18] fix #6535: migrate: warn about live migration " Jonas Theisen
2026-11-30 18:09 ` [PATCH qemu-server v3 10/18] fix #2924: migrate: block live migration of host CPU VMs to nodes lacking flags Jonas Theisen
2026-11-30 18:09 ` [PATCH qemu-server v3 11/18] migrate: warn about live migration of host CPU VMs between CPU models Jonas Theisen
2026-11-30 18:09 ` [PATCH qemu-server v3 12/18] migrate: block live migration if the target cannot run the virtual CPU Jonas Theisen
2026-11-30 18:09 ` [PATCH qemu-server v3 13/18] api: migrate: check the CPU of the target before requesting HA migration Jonas Theisen
2026-11-30 18:09 ` [PATCH manager v3 14/18] pvestatd: broadcast host CPU information relevant for live migration Jonas Theisen
2026-11-30 18:09 ` [PATCH manager v3 15/18] ui: migrate: show why the CPU of the target node is incompatible Jonas Theisen
2026-11-30 18:09 ` [PATCH manager v3 16/18] fix #6535: ui: migrate: show CPU warnings for the target node Jonas Theisen
2026-11-30 18:09 ` [PATCH manager v3 17/18] api: nodes: migrateall: skip VMs whose CPU is incompatible with the target Jonas Theisen
2026-11-30 18:09 ` [PATCH docs v3 18/18] qm: document the CPU checks for live migration Jonas Theisen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox