For stateful VM migration, do the hosts need to have the same CPU?

This is my first post, long time LXD user.
Note: I posted this on another thread, but don’t want to hijack that thread and now I can post new topics!

I have been exploring running VM’s on LXD 5.15 on Ubuntu 22.04, in order to run all my instances on LXD.

When I try to live migrate or copy a stateful instance, I get errors in the log:

This is when copying a stateful snapshot to the remote:
lxc info --show-log ubuntu
Name: ubuntu
Status: STOPPED
Type: virtual-machine
Architecture: x86_64
Created: 2023/07/25 13:36 EDT

Log:

qemu-system-x86_64: Missing section footer for 0000:00:1f.0/ICH9LPC
qemu-system-x86_64: warning: TSC frequency mismatch between VM (2199978 kHz) and host (2304013 kHz), and TSC scaling unavailable
qemu-system-x86_64: error: failed to set MSR 0x202 to 0x380000000000
qemu-system-x86_64: ../target/i386/kvm/kvm.c:3292: kvm_buf_set_msrs: Assertion `ret == cpu->kvm_msr_buf->nmsrs' failed.

I am trying to determine if the CPU difference between hosts is causing this cpu->kvm_msr_buf->nmsrs’ failed error?

For a running VM migration shows this on the monitor of the remote host:
ERROR [2023-07-25T14:00:43-04:00] Failed migration on target clusterMoveSourceName= err="Failed restoring checkpoint from source: Monitor is disconnected" instance=ubuntu2 live=true project=default push=false

Both hosts are running lxd version 5.15, on Ubuntu 22.04 - but are a different CPU, Xeon to Core i7 CPU. Not sure how similar they need to be.

Thank you

I’m not certain, but I do think the stateful migration format of QEMU is somewhat CPU dependent.

You could try using raw.qemu -cpu qemu64 instance setting to see if passing a generic CPU helps.

See https://qemu-project.gitlab.io/qemu/system/qemu-cpu-models.html#default-x86-cpu-models

The default QEMU CPU models are designed such that they can run on all hosts. If an application does not wish to do perform any host compatibility checks before launching guests, the default is guaranteed to work.

The default CPU models will, however, leave the guest OS vulnerable to various CPU hardware flaws, so their use is strongly discouraged. Applications should follow the earlier guidance to setup a better CPU configuration, with host passthrough recommended if live migration is not needed.

1 Like