- 积分
- 16843
在线时间 小时
最后登录1970-1-1
|

楼主 |
发表于 2018-12-8 17:56:58
|
显示全部楼层
virsh start vm1368544020451:
) J3 W% T+ H9 Z9 E; b1 A
- a* s- o3 C# R7 l; I' p error: Failed to start domain vm1368544020451 T$ ]2 R7 H9 V5 N2 C; E% Y
7 G/ m% _7 ]0 O# [' J; Aerror: internal error process exited while connecting to monitor: kvm: -drive file=/dev/sp1368155439693/v1368544020461,if=none,id=drive-virtio-disk0,format=qcow2: could not open disk image /dev/sp1368155439693/v1368544020461: Invalid argument
2 P! ~( b# i8 P
. I% w a2 d# Z3 J镜像格式错误,用qemu-img info 检查镜像和xml配置文件中指定的type是否一致。
6 G9 m1 |; ]7 r! u$ M) q$ ]- M# n+ O7 J* P6 `! z0 p
& j- C( l/ H# G; u2 _
error: Failed to start domain vm0- S3 }" W, m) Q: U. ~' ?
7 }0 R& r+ R7 } K$ |/ E
error: internal error process exited while connecting to monitor: Could not access KVM kernel module: No such file or directory
/ h+ `. \3 K- @% m ~, S: \1 lfailed to initialize KVM: No such file or directory
8 m9 g" Q/ k% Z! G# j% Z) l1 n. FNo accelerator found!1 Y( g. t0 V8 K* e4 D0 [& H& u
上面的提示信息就是因为QEMU在初始化阶段因为无法找到kvm内核模块。 v2 C: Z8 }* T# Q7 d
' H2 u& M, q9 g* R+ Z5 M3 dsudo modprobe kvm #载入指定的模块
- w) z, f T9 L3 \6 f$ w' u
: ^! n+ X* ^( H, u重启电脑,进入bios界面,设置advance选项里面的virtualization标签为Enabled
' {+ ?, f8 u1 \' Q( f, N9 z7 v/ X$ T* M% j7 J, e) N$ U, x0 M
通过命令 lsmod | grep kvm #显示已载入的模块
. D$ e# e& y) I& R1 h+ `, p: _* t4 }
虚拟机迁移:
$ K5 B0 `& u8 `9 S4 Q `0 K' l l4 D
# virsh migrate --live 1 qemu+tcp://192.168.0.121 --p2p --tunnelled --unsafe ; p) C2 I5 X9 a1 J% ]+ L. O
error: operation failed: Failed to connect to remote libvirt URI qemu+tcp://192.168.0.121(在URI后面加上/system,‘system’相当于root用户的访问权限)# H2 A2 `* {) g8 z) I8 z" m
: c3 C) L# z, W+ y3 S- w1 {#virsh migrate --live 2 qemu+tcp://192.168.0.121/system --p2p --tunnelled+ V" B" X$ P5 X/ a3 C
error: Unsafe migration: Migration may lead to data corruption if disks use cache != none(加上--unsafe参数): W- X- m2 R4 M U8 Q
& O W" I& ~ }; `0 \" P5 a$ s6 e#virsh migrate --live 2 qemu+tcp://192.168.0.121/system --p2p --tunnelled --unsafe
* u; b1 J% T. I: p% O4 }- Rerror: Timed out during operation: cannot acquire state change lock (启动虚拟机有时也会遇此错误),需要重启libvirtd进程% j% S& |" f! P% ]& z" v
- G q/ a- ?( n' A6 c$ Yvirsh:- M" z' f# l" t6 y' Y
! u: U# x3 L9 t+ P
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Connection refused(libvirtd 进程没有启动,libvirtd是一个监听客户端请求的进程)3 S$ k1 c5 V. j. K
: d! k/ p1 Y9 f: o# u1 M- n( R3 ?$ virsh -c qemu:///system list: G6 s/ B6 X0 u. L3 {5 U; [7 z
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied
9 }5 e" B( B) |( ~5 K$ {# Jerror: failed to connect to the hypervisor+ [4 H) [: |+ [1 `! b, g2 `7 f
8 _% o/ k: l3 V5 z, x(当前用户没有权限,修改/etc/libvirt/libvirtd.conf,unix_sock_rw_perms = 0777,使所有用户都有权限读写)
2 N3 ~& c; W" G9 S7 t4 Y3 J0 g0 K
! [8 T1 E! l8 G$ v启动libvirtd进程出错:
0 i, I' d7 V+ x9 E# @: o* n
0 B. r' |% ?! _# v /usr/local/sbin/libvirtd -d -l --config /usr/local/etc/libvirt/libvirtd.conf (编译安装的启动方式)8 M$ h$ A% H$ x6 [
error:/usr/local/sbin/libvirtd: initialization failed7 v4 j# J! [' W5 Y4 m) U# n
% P0 A& M( k! w4 d# Vtry to install libpcap-devel RPM and rebuild libvirt http://comments.gmane.org/gmane.comp.emulators.libvirt/58218% S6 D W2 M, `$ }# b
2 }* a0 e' k3 @; |1 C% C
apt-get install libpcap-dev
4 ]/ L8 _. E/ S; Q, e! ?+ s5 s) y: P
上面的方法好像都没有效果,但是尝试了http://wiki.libvirt.org/page/The_daemon_cannot_be_started说的,把配置文件里的- S6 @) u' Z. }$ W3 T# b
/ |9 T: v* V0 {) b. M% a$ N% Z. j
listen_tls = 0注释取消(更奇怪的问题,在我的客户端链接不对)/ d" ^( z& z- S) d9 ~0 \
8 k) P9 v' ^: t5 r# G
启动虚拟机:Connection reset by peer6 ?; `' ^! a3 G4 G6 y5 d8 w2 @- T
1 \ ^8 R: X. X! A" h8 V1 x, S
virsh start vm1355991767186. r! K: J1 B# R A4 @3 m
error: Failed to start domain vm1355991767186
, f% Z% ?: y( {+ m {9 D9 Xerror: Unable to read from monitor: Connection reset by peer7 r) {& ?" Q$ p4 y9 T
: \- l1 h' x( G3 {, q
还有可能是这样提示:
4 V* Y: {: A4 V0 L1 w0 A3 R' S- H
error: internal error process exited while connecting to monitor: Failed to allocate 16332619776 B: Cannot allocate memory
& D9 v2 b G v% `+ \, u: d' ?( a( I: C$ E0 B1 j/ I
这个问题可能是因为为VM分配的内存过大(甚至超过的物理主机的内存大小)
- ?+ z' p. i' ^" r2 W2 i; T. @& H A8 _
Unable to load library 'virt': libvirt.so: cannot open shared object file: No such file or directory
7 t$ O# ~) ]! U/ N' Y" @- i+ p
) x# w3 f7 X, }5 X5 X2 w5 K) Elinux 环境:; T6 j8 m* }/ k; M5 e- ]
ln -s /usr/lib/libvirt.so.0 /usr/lib/libvirt.so
! V% N8 A6 P/ d( y9 k1 C9 ?/ ?windows 环境
6 z' T% @- ]0 \- ~ 将libvirt-0.dll改名为virt.dll
" P+ j+ x+ z% U# f: H) f$ p
& H: R1 p5 V8 R) I% a* B. d! C/ z# virsh undefine vm13546958949909 _5 Y8 \% x0 n) z0 J& }
error: Refusing to undefine while domain managed save image exists5 c8 X" `- ]0 g6 f6 P3 z' v9 ~
S% T9 ^, w+ }1 [8 j2 W! }" J
http://www.redhat.com/archives/l ... -July/msg01219.html
2 Z( M0 ^( e' e3 L
: U& _2 d! R( H0 E, S managedsave- U/ w" e7 ]7 G# z3 V* Q
1 Q3 u$ w5 J4 k" a
解决办法:virsh undefine $domain --managed-save
# L" }. a$ I5 T$ g( q: N
4 x/ T8 O) H ~/ f- v在centos下面Define虚拟机时,确实没有/usr/bin/kvm,加软链接
6 U- z9 _' e7 q9 W. Perror: Failed to define domain from xxx.xml2 s o/ @' `3 b: ~' `* ?- |1 l! q
error: Cannot find QEMU binary /usr/bin/kvm: No such file or directory
6 E2 {( T$ I* T: Q# I+ F" G5 W* r- d" D3 g5 o* f
解决办法:ln -s /usr/libexec/qemu-kvm /usr/bin/kvm0 ?, [. u" \- ] q _
|
|