CentOS6/KVM


CentOS7で作ったディスクイメージを持ってきてCentOS6で動かす

CentOS7で作ったディスクイメージを普通にコピーしてから動かそうとしたら起動しない。
# scp -pr CentOS7:/var/lib/libvirt/images/CentOS7.qcow2 /var/lib/libvirt/images
# virt-install --name CentOS7 --import --noreboot --vcpus=2 --ram 2048 \
  --disk /var/lib/libvirt/images/CentOS7.qcow2 \
  --network bridge=br0,model=e1000
# virsh start CentOS7 --console

SeaBIOS (version seabios-0.6.1.2-26.el6)



gPXE (http://etherboot.org) - 00:03.0 C100 PCI2.10 PnP BBS PMM7FE0@10 C100


Booting from Hard Disk...
Boot failed: not a bootable disk

Booting from ROM...
gPXE (PCI 00:03.0) starting execution
gPXE initialising devices...
ディスクが認識していないようだ・・・

ドライバがおかしいことが判明したので編集して起動するとエラー。
# virsh edit CentOS7
<driver name='qemu' type='raw' cache='none'/>
↓
<driver name='qemu' type='qcow2' cache='none'/>
# virsh start CentOS7 --console

エラー: ドメイン CentOS7 の起動に失敗しました
エラー: internal error process exited while connecting to monitor: char device redirected to /dev/pts/10
qemu-kvm: -drive file=/var/lib/libvirt/images/CentOS7.qcow2,if=none,id=drive-ide0-0-0,format=qcow2,cache=none: 'drive-ide0-0-0' uses a qcow2 feature which is not supported by this qemu version: QCOW version 3
qemu-kvm: -drive file=/var/lib/libvirt/images/CentOS7.qcow2,if=none,id=drive-ide0-0-0,format=qcow2,cache=none: could not open disk image /var/lib/libvirt/images/CentOS7.qcow2: Operation not supported
qcowのバージョンが合わないとか言われた。
qcow3に対応していないと言われているように見える。

調べてみたところ、旧バージョンに対応する形でのコンバートが必要。(コンバートはCentOS7のホストで作業する)
qcow3からqcow2へのコンバートなのだろうか?
# cd /var/lib/libvirt/images
# qemu-img convert -o compat=0.10 -f qcow2 -O qcow2 -p CentOS7.qcow2 CentOS7-2.qcow2
# scp -pr CentOS7-2.qcow2 CentOS6:/var/lib/libvirt/images/CentOS7.qcow2

再実行
# virsh start CentOS7 --console

CentOS Linux 7 (Core)
Kernel 3.10.0-123.9.3.el7.x86_64 on an x86_64

CentOS7 login:
起動した!



  • 最終更新:2016-01-15 16:51:29

このWIKIを編集するにはパスワード入力が必要です

認証パスワード