CentOS8からubuntu20.04へのKVMゲスト移動

CentOS8で作成したKVMゲストをubuntu20.04へ移動した際のメモ。

CentOS8側[VMのxmlをダンプする]

# virsh dumpxml vm_machine01 > vm_machine01.xml

ubuntu20.04側[xmlを別なKVMホストへインポートする]

#virsh create vm_machine01.xml

でもだいたいはこのままだとエラーでてしまう。
よくあるエラー箇所はここ。

[CentOS8の場合]

# virsh edit vm_machine01
<os>
<type arch='x86_64' machine='pc-i440fx-rhel7.0.0'>hvm</type>
</os>


[ubuntu20.04の場合]

# virsh edit vm_machine01
<os>
<type arch='x86_64' machine='pc-1.0-qemu-kvm'>hvm</type>
</os>

ディストリビューションで若干のマシンタイプ表記が違うからみたいですね。

[CentOS8]
$ /usr/libexec/qemu-kvm -machine help
Supported machines are:
pc RHEL 7.6.0 PC (i440FX + PIIX, 1996) (alias of pc-i440fx-rhel7.6.0)
pc-i440fx-rhel7.6.0 RHEL 7.6.0 PC (i440FX + PIIX, 1996) (default)
pc-i440fx-rhel7.5.0 RHEL 7.5.0 PC (i440FX + PIIX, 1996)
pc-i440fx-rhel7.4.0 RHEL 7.4.0 PC (i440FX + PIIX, 1996)
pc-i440fx-rhel7.3.0 RHEL 7.3.0 PC (i440FX + PIIX, 1996)
pc-i440fx-rhel7.2.0 RHEL 7.2.0 PC (i440FX + PIIX, 1996)
pc-i440fx-rhel7.1.0 RHEL 7.1.0 PC (i440FX + PIIX, 1996)
pc-i440fx-rhel7.0.0 RHEL 7.0.0 PC (i440FX + PIIX, 1996)
q35 RHEL-7.6.0 PC (Q35 + ICH9, 2009) (alias of pc-q35-rhel7.6.0)
pc-q35-rhel7.6.0 RHEL-7.6.0 PC (Q35 + ICH9, 2009)
pc-q35-rhel7.5.0 RHEL-7.5.0 PC (Q35 + ICH9, 2009)
pc-q35-rhel7.4.0 RHEL-7.4.0 PC (Q35 + ICH9, 2009)
pc-q35-rhel7.3.0 RHEL-7.3.0 PC (Q35 + ICH9, 2009)
none empty machine

[ubuntu20.04]
$ qemu-system-x86_64 -machine help
Supported machines are:
pc-0.13 Standard PC (i440FX + PIIX, 1996)
pc-i440fx-2.0 Standard PC (i440FX + PIIX, 1996)
pc-1.0-qemu-kvm Standard PC (i440FX + PIIX, 1996) (alias of pc-1.0)
pc-1.0 Standard PC (i440FX + PIIX, 1996)
pc-q35-1.7 Standard PC (Q35 + ICH9, 2009)
pc-1.1 Standard PC (i440FX + PIIX, 1996)
q35 Standard PC (Q35 + ICH9, 2009) (alias of pc-q35-2.0)
pc-q35-2.0 Standard PC (Q35 + ICH9, 2009)
pc-i440fx-1.4 Standard PC (i440FX + PIIX, 1996)
pc-i440fx-1.5 Standard PC (i440FX + PIIX, 1996)
pc-0.14 Standard PC (i440FX + PIIX, 1996)
pc-0.15 Standard PC (i440FX + PIIX, 1996)
xenfv Xen Fully-virtualized PC
pc-q35-1.4 Standard PC (Q35 + ICH9, 2009)
isapc ISA-only PC
pc-0.10 Standard PC (i440FX + PIIX, 1996)
pc Ubuntu 14.04 PC (i440FX + PIIX, 1996) (alias of pc-i440fx-trusty)
pc-i440fx-trusty Ubuntu 14.04 PC (i440FX + PIIX, 1996) (default)
pc-1.2 Standard PC (i440FX + PIIX, 1996)
pc-0.11 Standard PC (i440FX + PIIX, 1996)
pc-i440fx-1.7 Standard PC (i440FX + PIIX, 1996)
pc-i440fx-1.6 Standard PC (i440FX + PIIX, 1996)
none empty machine
xenpv Xen Para-virtualized PC
pc-q35-1.5 Standard PC (Q35 + ICH9, 2009)
pc-1.0-precise Standard PC (i440FX + PIIX, 1996) (alias of pc-1.0-qemu-kvm)
pc-1.0-qemu-kvm Standard PC (i440FX + PIIX, 1996)
pc-q35-1.6 Standard PC (Q35 + ICH9, 2009)
pc-0.12 Standard PC (i440FX + PIIX, 1996)
pc-1.3 Standard PC (i440FX + PIIX, 1996)

ubutuやdebian系は遊ぶのにいろいろとマシンタイプが増やせたりするので選択肢が多い感じです。x86とかarmとか。