我正在将域名从“旧电脑”导出到“新电脑”
# Export domain (from old pc)
ssh user@"$REMOTE_IP" "virsh --connect qemu:///system suspend --domain magento-base > /dev/null 2>&1" # Pause vm
ssh user@"$REMOTE_IP" "virsh --connect qemu:///system dumpxml --update-cpu --domain magento-base > ~/workspaces/virtual-machines/magento-base/magento-base.xml" # Export vm
ssh user@"$REMOTE_IP" "virsh --connect qemu:///system snapshot-dumpxml --domain magento-base --snapshotname snapshot1 > ~/workspaces/virtual-machines/magento-base/snapshots/snapshot1.xml" # Export snapshot1
# Import domain (to new pc)
virsh --connect qemu:///system destroy --domain magento-base > /dev/null 2>&1 # Stop old vm
virsh --connect qemu:///system undefine --domain magento-base > /dev/null 2>&1 # Delete old vm
virsh --connect qemu:///system define ~/workspaces/virtual-machines/magento-base/magento-base.xml # Import new vm
virsh --connect qemu:///system snapshot-create --domain magento-base --xmlfile ~/workspaces/virtual-machines/magento-base/snapshots/snapshot1.xml --atomic --redefine --current --halt # Import snapshot1
问题 当我在新电脑中启动域或快照时,出现错误:
The CPU is incompatible with host CPU
修复此错误的正确方法是什么?谢谢。
答案1
目前没有办法修复此问题。“旧 PC”和“新 PC”都必须支持相同的 CPU 标志。
来源:来自 libvirt IRC 频道的这个答案:
- when you save the running VM state, the details of the current exposed guest CPU are recorded.
- when we restore the guest from saved state, we must ensure the host CPU is able to support all the features the guest was currently run with IOW, your new host lacks some CPU flags that the old host had.
- there's no safe way to "fix" this problem in general.
- unless there's a BIOS update you're missing for your new host.