📝

KVMホストPCのOS変更に伴うKVM仮想マシンの移動(CentOS6 ⇒ CentOS8)

2021/04/10に公開

サーバ用に使っているPCをリプレイスしてみた

消費税が10%増税っていうこともあり、サーバ用に使っているPCもこの際なので新調してみた。というのもあるけどホストサーバのOSを CentOS8 にしてみたかったっていうのが大きい。

イメージファイルを移動しただけだと動かなかった!!

ゲストOSのバックアップ&リストア は、こっちをみてもらううとして。

起動すると下記のようなエラー(/var/log/messages)が。。。”unsupported machine type” ですか、マシンタイプが違うと。

error : qemuMonitorIORead:609 : モニターから読み込みできません: 接続が相手からリセットされました
error : qemuProcessReportLogError:1923 : 内部エラー: qemu unexpectedly closed the monitor: 2019-10-04T23:21:12.485357Z qemu-kvm: -machine rhel6.4.0,accel=kvm,usb=off,dump-guest-core=off: unsupported machine type

修正点

<type arch='x86_64' machine='rhel6.4.0'>hvm</type>
↓
<type arch='x86_64' machine='pc-i440fx-rhel7.6.0'>hvm</type>

起動したあああああああああああ

だが・・・

# /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

ついでに、仮想マシンのCPU数上限をあげてみる(1⇒2)

# virsh setvcpus ゲストOS名 2 --config --maximum

KVM仮想マシンのCPU数 / メモリサイズ変更

GitHubで編集を提案

Discussion