朝にブログ更新して途中で寝てたけど、ずっとエラーでやっと1個作れたw
とりあえず先に大量にあるエラー集的なものを載せといた方が、出来上がりはこれですっていう3分クッキングな内容になってしまうのは防げるかと思うw
時系列で載せます。
すっごい間抜けなものもあるw
ERROR ソケットの '/var/run/libvirt/libvirt-sock' への接続に失敗しました:
そのようなファイルやディレクトリはありません
解決策:libvirtdを起動してなかった。ふはは。
libvirtd デーモンを起動中: 2013-09-17 05:07:33.210+0000: 20731: info :
libvirt version: 0.10.2, package: 18.el6_4.5 (Scientific Linux, 2013-05-16-11:21:40, sl6.fnal.gov)
2013-09-17 05:07:33.210+0000: 20731: warning : virGetHostname:2265 :
getaddrinfo failed for 'take': 名前またはサービスが不明です
解決策:/etc/hostsにホスト名を書くとでなくなるよ。
ERROR Host does not support virtualization type 'hvm'
ERROR Host does not support any virtualization options
解決策:yumでqemu-kvmをインストールした。
※ソースからビルドした時は、qemu-system-x86_64でVM作成していたけど、多分qemu-kvmコマンドがないからこんなおかしなエラーになってる。一番つまったとこ。
Starting install...
ERROR internal error Process exited while reading console log output:
char device redirected to /dev/pts/1
open /dev/kvm: Permission denied
failed to initialize KVM: Operation not permitted
No accelerator found!
Starting install...
ERROR 内部エラー console ログ出力の読み込み中にプロセスが終了しました:
char device redirected to /dev/pts/1
open /dev/kvm: Permission denied
failed to initialize KVM: Operation not permitted
No accelerator found!
解決策?:所有者をkvm:kvmにする。
これはちょっと微妙。
Starting install...
ERROR 内部エラー console ログ出力の読み込み中にプロセスが終了しました:
char device redirected to /dev/pts/1
qemu-kvm: -drive file=/root/vm03.img,if=none,id=drive-ide0-0-0,format=raw,cache=none:
could not open disk image /root/vm03.img: Permission denied
解決策:/var/lib/libvirt以下に作成することにした。
ERROR 内部エラー console ログ出力の読み込み中にプロセスが終了しました:
char device redirected to /dev/pts/1
qemu-kvm: -drive file=/root/CentOS-6.4-x86_64-bin-DVD1.iso,if=none,media=cdrom,id=drive-ide0-1-0,
readonly=on,format=raw: could not open disk image /root/CentOS-6.4-x86_64-bin-DVD1.iso: Permission denied
解決策:イメージ置き場を/rootから/var/isoに変えた。
ERROR OS variant 'centos6' does not exist in our dictionary for OS type 'linux'
解決策:–os-variant=centos6を消した。
ERROR Cannot mix --file, --nonsparse, or --file-size with --disk options.
Use --disk PATH[,size=SIZE][,sparse=yes|no]
解決策:–disk path か –file の内容がかぶってるからどっちかにする。
ERROR Unknown argument '='
解決策:=の前にスペースつけるな。
ERROR Error with storage parameters: The path '/var/lib/libvirt/images'
must be a file or a device, not a directory
解決策:/var/lib/libvirt/imagesの後ろに名前をつけろ、そいつはディレクトリだ。
ERROR 'bridge:br0' においてインターフェースの MTU を取得できません:
そのようなデバイスはありません
解決策:記述が違う。–network bridge=br0 でOK
WARNING Unable to connect to graphical console: virt-viewer not installed. Please install the 'virt-viewer' package.
Domain installation still in progress. You can reconnect to
the console to complete the installation process.
解決策:virt-viewerを入れたらでなくなったけど、別に使わない。なんだこれは。
Starting install...
割り当て中 'cents3' | 1.0 GB 00:00
ERROR モニターから読み込みできません: 接続が相手からリセットされました
解決策:ばっかもーん、そいつがファイアーウォールだ。
Starting install...
ERROR 内部エラー モニターに接続中にプロセスが終了しました: char device redirected to /dev/pts/3
inet_listen_opts: bind(ipv4,0.0.0.0,5900): Address already in use
inet_listen_opts: FAILED
Starting install...
ERROR 内部エラー console ログ出力の読み込み中にプロセスが終了しました: char device redirected to /dev/pts/3
inet_listen_opts: bind(ipv4,127.0.0.1,5900): Address already in use
解決策:ホストサーバーのIPでListenすることにしたらうまくいけた。
Starting install...
ドメインを作成中... | 0 B 00:00
ディスプレイをオープンできません:
Run 'virt-viewer --help' to see a full list of available command line options
解決策:ふははは、これは成功だ。
これで終わりです。
[root@take ~]# virsh list
Id 名前 状態
----------------------------------------------------
10 test 実行中
11 centos 実行中
ミスってできた接続できないVMたち。
[root@take ~]# virsh undefine test
ドメイン test の定義が削除されました
[root@take ~]# virsh undefine centos
ドメイン centos の定義が削除されました
ちゅどーん。
mozさんからコメントいただいて、確認してみたので少し追記しました -2015/04/21
ERROR OS variant ‘centos6′ does not exist in our dictionary for OS type ‘linux’
についてはcentos6という選択肢がないからですかね
というのも仰る通りで、SL6の場合も同じくRHELかなぁ。
takeken@takeken:~$ sudo virt-install --os-variant list | grep cent
takeken@takeken:~$
takeken@takeken:~$ sudo virt-install --os-variant list | grep 6
winxp64 : Microsoft Windows XP (x86_64)
freebsd6 : FreeBSD 6.x
netware6 : Novell Netware 6
fedora16 : Fedora 16
fedora6 : Fedora Core 6
rhel6 : Red Hat Enterprise Linux 6
virtio26 : Generic 2.6.25 or later kernel with virtio
generic26 : Generic 2.6.x kernel
最近はvirshな環境は使ってなかったので、テスト用にUbuntuサーバーに環境を用意しました。せっかくなのでメモを取って追記しておこう。
kvm install memo by ubuntu
インストールしたパッケージ面々
sudo apt-get install libvirt-bin virtinst + 以下の提案パッケージ
以下の特別パッケージがインストールされます:
augeas-lenses bridge-utils cgroup-lite ebtables libaugeas0
libboost-thread1.54.0 libnetcf1 librados2 librbd1 libvirt0 libxen-4.4
libxenstore3.0 libxml2-utils
提案パッケージ:
augeas-doc augeas-tools qemu-kvm qemu radvd lvm2
以下のパッケージが新たにインストールされます:
augeas-lenses bridge-utils cgroup-lite ebtables libaugeas0
libboost-thread1.54.0 libnetcf1 librados2 librbd1 libvirt-bin libvirt0
libxen-4.4 libxenstore3.0 libxml2-utils
xmlファイルを作ってvirsh createやりたかったところですが、今回もvirt-installにしました。
sudo virt-install \
--name=vm01 \
-connect=qemu:///system \
--ram=512 \
--vcpus=1 \
--cdrom /var/iso/CentOS-7-x86_64-DVD-1503-01.iso \
--os-type=linux --os-variant=rhel6 \
--disk path=/var/lib/libvirt/images/vm01,size=5,sparse=false,format=qcow2 \
--network bridge=virbr0 \
--vncport=50002 \
--vnclisten=192.168.24.58 \
--keymap=ja \
--vnc
virbr0を使ったのでホストサーバーのVNCでインストール・・・。
インストールの開始中...
割り当て中 'vm01' | 5.0 GB 00:00
ドメインを作成中... | 0 B 00:00
WARNING グラフィカルコンソールに接続できません; virt-viewer がインストールされていません。'virt-viewer' パッケージをインストールしてください。
ゲスト OS のインストールが進行中です。
インストール処理を完了させるために、コンソールに再接続できます。
takeken@takeken:~$
takeken@takeken:~$ sudo virsh list --all
Id 名前 状態
----------------------------------------------------
- vm01 シャットオフ
設定ファイルはここですね。
/etc/libvirt/qemu/vm01.xml
Centos7が出来上がりました。
takeken@takeken:~$ ssh -l root 192.168.122.3
The authenticity of host '192.168.122.3 (192.168.122.3)' can't be established.
ECDSA key fingerprint is 06:c2:ba:81:87:f2:34:46:a6:f6:1b:ac:4f:b7:ab:53.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.122.3' (ECDSA) to the list of known hosts.
root@192.168.122.3's password:
Last login: Tue Apr 21 11:09:13 2015
[root@cent7 ~]# uname -a
Linux cent7 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Centos7のインストールが終わってからRHEL6を選んだことに気づいた
(・_・;)
XMLを書き換えようかなと思ったらOS Typeがなかった。。
takeken@takeken:~$ sudo cat /etc/libvirt/qemu/vm01.xml | grep -A 4 "<os>"
<os>
<type arch='x86_64' machine='pc-i440fx-trusty'>hvm</type>
<boot dev='hd'/>
</os>
<features>
完全な仮想化ゲストのオペレーティング・システム・バリアントを設定します
とありますが、何か良く分からないです。