|
|
楼主 |
发表于 2018-12-8 17:56:58
|
显示全部楼层
virsh start vm1368544020451:
( g7 q- n9 ~( }0 J3 I8 q, C, H& R% m
error: Failed to start domain vm1368544020451( t/ m" o% q* C8 v' o. D
@% U% {) V( n0 U) s0 D7 l( }* n
error: 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 argument8 u/ M2 [# `' ^ }. v* y
4 h2 T. w8 o" _镜像格式错误,用qemu-img info 检查镜像和xml配置文件中指定的type是否一致。. h6 A. J- q. ], ]2 V
+ b; z/ d% [ r' Q. F6 I5 h! R+ c% o. Z
! y. z' c1 q9 w: |error: Failed to start domain vm00 v, H; V% C# `5 j3 O
2 M2 g% C. l: z$ ~; D1 V' ^3 s
error: internal error process exited while connecting to monitor: Could not access KVM kernel module: No such file or directory+ w i8 b1 z+ M0 o& W1 W1 I& ?, X
failed to initialize KVM: No such file or directory$ _7 L) b5 o: W% G! w% m2 ^
No accelerator found!
+ _5 E0 `% M6 R7 k上面的提示信息就是因为QEMU在初始化阶段因为无法找到kvm内核模块。$ u. k3 B+ N, G) G+ p6 ]" I" H
- s# K% D- F. b: Ksudo modprobe kvm #载入指定的模块" k, x f) }- I# u8 K
4 ?+ d9 f W! B- I2 h" q9 v重启电脑,进入bios界面,设置advance选项里面的virtualization标签为Enabled/ H W# t) Z [ Q7 G- Z$ A
: I% e0 [, d+ n) M( T2 O通过命令 lsmod | grep kvm #显示已载入的模块
* y2 w, q, ` E! O/ O0 n. ]
0 W" S3 d! e% e' [ 虚拟机迁移:' L8 z' v: A1 D
6 u/ A' d/ ]1 L, N# q
# virsh migrate --live 1 qemu+tcp://192.168.0.121 --p2p --tunnelled --unsafe
% f( a4 Z* o$ A9 t/ gerror: operation failed: Failed to connect to remote libvirt URI qemu+tcp://192.168.0.121(在URI后面加上/system,‘system’相当于root用户的访问权限)
1 Y, S; l/ G9 G( g6 x7 Y) S7 `7 O4 }* V9 @! `* q/ a9 d8 H
#virsh migrate --live 2 qemu+tcp://192.168.0.121/system --p2p --tunnelled
: W3 ~5 K# Q; s$ `& _) T error: Unsafe migration: Migration may lead to data corruption if disks use cache != none(加上--unsafe参数)! S) z( Q3 H, k4 }- A
+ S v2 H& l- T0 U) H#virsh migrate --live 2 qemu+tcp://192.168.0.121/system --p2p --tunnelled --unsafe
, o& ^, G U1 p8 ~error: Timed out during operation: cannot acquire state change lock (启动虚拟机有时也会遇此错误),需要重启libvirtd进程% }" P2 ^0 ^' k M
; O; c# K# L& I6 {6 f
virsh:. K, H6 z9 A a: d
: _, w8 r/ S8 j d6 O# E
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Connection refused(libvirtd 进程没有启动,libvirtd是一个监听客户端请求的进程)
) g# z" m2 G5 g4 j9 x9 C2 n$ a" A( ?) Z
$ virsh -c qemu:///system list* D+ R6 ]3 t( g1 {0 P+ r
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied8 A- M3 Z* G6 ^8 _7 M# j0 @
error: failed to connect to the hypervisor
! y+ \2 x! M& k* n0 {/ Z
: L$ |* m! c( {* |' L(当前用户没有权限,修改/etc/libvirt/libvirtd.conf,unix_sock_rw_perms = 0777,使所有用户都有权限读写)4 }! R% |; W1 ^
$ P+ p4 O6 O! ^. O& `4 m启动libvirtd进程出错:: Q {: t( F8 `% e, G+ n
0 n( l7 S5 Z/ a& m |2 C /usr/local/sbin/libvirtd -d -l --config /usr/local/etc/libvirt/libvirtd.conf (编译安装的启动方式)& E% \# L4 O( j& k
error:/usr/local/sbin/libvirtd: initialization failed, Z+ s0 V( c3 K, w" \! }
0 N( x( D& o: M4 n. z& d. F% h. a# rtry to install libpcap-devel RPM and rebuild libvirt http://comments.gmane.org/gmane.comp.emulators.libvirt/582185 ]2 {$ Z8 \# x' f8 s: H/ k
( G, q- [9 t* b/ @$ Qapt-get install libpcap-dev5 A+ I. G- K# ~
7 m' v+ E& U8 q
上面的方法好像都没有效果,但是尝试了http://wiki.libvirt.org/page/The_daemon_cannot_be_started说的,把配置文件里的2 k; h, K0 ]% l5 K7 H
0 ]9 D- q! k( y* v
listen_tls = 0注释取消(更奇怪的问题,在我的客户端链接不对)
5 T* e7 p+ t# { Q
; j1 R% i+ N0 L. f U$ w启动虚拟机:Connection reset by peer
: Q* P+ S% q5 n+ Q6 X5 m. `6 C4 j, C; b# k E
virsh start vm1355991767186
4 M) B' G" o/ ^" `error: Failed to start domain vm1355991767186
/ q' B" K/ D" G2 H T# kerror: Unable to read from monitor: Connection reset by peer5 j$ g) J/ R# } i8 `+ l* ^7 w: I
# q% G' j" i2 N- N! f* w
还有可能是这样提示:
- Y9 M8 Z0 m+ {* q, U7 f+ _% [9 M+ P, C3 ?6 ~. q
error: internal error process exited while connecting to monitor: Failed to allocate 16332619776 B: Cannot allocate memory1 u) c# j O+ a" y
2 Y( u$ _, D4 ^这个问题可能是因为为VM分配的内存过大(甚至超过的物理主机的内存大小)3 L2 P% u/ q7 s8 z4 b% B. }
2 `* L/ Z6 m* U+ X B6 _3 ?6 F
Unable to load library 'virt': libvirt.so: cannot open shared object file: No such file or directory f6 Q& a3 s( o* u9 R# r
) H* W. A2 Y3 f: |' i4 u# |
linux 环境:
7 W' ~) t- u1 ?: T, t# B- G ln -s /usr/lib/libvirt.so.0 /usr/lib/libvirt.so
! e2 M6 r3 A D5 L' q2 z. swindows 环境
) F/ h2 x d/ G( S# a- l; a 将libvirt-0.dll改名为virt.dll* F ]: n, |6 u2 H" ~% A
5 O6 R7 j+ J# p0 i. s; V( k
# virsh undefine vm1354695894990
, K; l: c, v! f s+ P0 ]; Jerror: Refusing to undefine while domain managed save image exists
4 T7 ], O2 V+ }9 A
1 A$ b' c, J1 E$ Mhttp://www.redhat.com/archives/l ... -July/msg01219.html
?0 ~- i# p" p5 j4 V2 _ S7 J. W+ Z2 h2 x6 L! c
managedsave1 ]0 x1 m& e5 s/ g2 v8 }6 Z4 T2 y
9 h) C" i+ ^7 S' v9 G" O2 H5 z解决办法:virsh undefine $domain --managed-save
! X3 v8 p. I# E' {. X. ^
: u9 g. ]7 u% p: N+ ]; J- a在centos下面Define虚拟机时,确实没有/usr/bin/kvm,加软链接- V" j$ I, P b3 k; T
error: Failed to define domain from xxx.xml% l7 O, L: h/ E
error: Cannot find QEMU binary /usr/bin/kvm: No such file or directory
. c$ E; W) I5 @" @
4 i! g4 G& H% \0 f+ N, C解决办法:ln -s /usr/libexec/qemu-kvm /usr/bin/kvm
7 s2 F) [2 H" N- t* y* q |
|