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

楼主 |
发表于 2018-12-8 17:56:58
|
显示全部楼层
virsh start vm1368544020451:
9 ^+ ?3 Y1 q- S5 Q) z& P3 }4 J
4 j0 U8 a1 j' Z* y error: Failed to start domain vm1368544020451( d8 n x6 c4 y: y7 `$ O [
8 W; G2 ?" o4 i1 p
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 argument
- i- ^( L( `2 l
- F8 P _" l1 j$ s镜像格式错误,用qemu-img info 检查镜像和xml配置文件中指定的type是否一致。
7 r- j1 Q! q/ m: [
/ f5 j3 r* e, u; z6 O$ Y& |# ^
# e0 J' F) X* ierror: Failed to start domain vm0( i" R; W! {: Y" C! T
3 R% P. F- {4 N% Yerror: internal error process exited while connecting to monitor: Could not access KVM kernel module: No such file or directory
, m& f2 M* F9 H) `failed to initialize KVM: No such file or directory- c' ]3 r) T+ h' S
No accelerator found!
) A. E: Z4 `! N3 R* g/ {6 h/ k% \上面的提示信息就是因为QEMU在初始化阶段因为无法找到kvm内核模块。& R5 s2 |/ z6 L4 D1 I1 q
! {6 n/ Q$ Y* b `5 U" l' K( [5 ysudo modprobe kvm #载入指定的模块
# L# x# {4 H: Z6 B4 I* V0 Q) v, T
! V0 V9 t% S% x* `重启电脑,进入bios界面,设置advance选项里面的virtualization标签为Enabled
- x. Y; O( g/ K
: e9 R- o C/ ^0 e& l* Q通过命令 lsmod | grep kvm #显示已载入的模块4 ~! y2 r4 t1 x. U! |6 s9 N
1 p: T. a* A4 w7 b/ i 虚拟机迁移:: O& p0 q. d( \) v( F$ f/ Y+ Q
+ K0 V7 |- g9 E* W' N! {7 S# virsh migrate --live 1 qemu+tcp://192.168.0.121 --p2p --tunnelled --unsafe
, b, B$ U* _) u, d [- Z4 V( gerror: operation failed: Failed to connect to remote libvirt URI qemu+tcp://192.168.0.121(在URI后面加上/system,‘system’相当于root用户的访问权限)" p/ e9 M w$ N/ O$ ~( f
! U" m, N6 L6 {4 H V9 d {#virsh migrate --live 2 qemu+tcp://192.168.0.121/system --p2p --tunnelled8 X% S: ?% I4 C3 F! [( B
error: Unsafe migration: Migration may lead to data corruption if disks use cache != none(加上--unsafe参数)
" Q: l$ W2 }+ s" @# f* u3 e, I3 k
#virsh migrate --live 2 qemu+tcp://192.168.0.121/system --p2p --tunnelled --unsafe
3 E \2 r' P/ a) C* N5 {error: Timed out during operation: cannot acquire state change lock (启动虚拟机有时也会遇此错误),需要重启libvirtd进程
9 i& H* Q6 I! z: G
. ]/ t7 O, I! [virsh:
6 r$ z. C" O( o" g& `( S% a, |( z5 [0 A( D# X. u c
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Connection refused(libvirtd 进程没有启动,libvirtd是一个监听客户端请求的进程)
/ k: t: M1 j! ], p, S; Q' S! o `3 a7 v4 V5 U N9 ~
$ virsh -c qemu:///system list; Q3 d6 |, b% m% M8 q
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied( E D4 I0 C$ i# a! p" A1 H( g; v& J
error: failed to connect to the hypervisor
1 W8 ?/ D( ` X' @$ |
5 m+ c$ E6 h N( j5 e8 Z(当前用户没有权限,修改/etc/libvirt/libvirtd.conf,unix_sock_rw_perms = 0777,使所有用户都有权限读写)
2 Q( b c9 I: z/ D4 ~
4 n/ ^; d+ ]7 I; [9 s+ v* r% E, x/ _$ D启动libvirtd进程出错:8 [. N+ m4 f/ S
+ {' J! s; U, V; ? /usr/local/sbin/libvirtd -d -l --config /usr/local/etc/libvirt/libvirtd.conf (编译安装的启动方式)
% B' r* q6 y* L* verror:/usr/local/sbin/libvirtd: initialization failed
" t3 z. s# ?4 q0 ^ T* ~, A' B# c, v- {7 |
try to install libpcap-devel RPM and rebuild libvirt http://comments.gmane.org/gmane.comp.emulators.libvirt/58218
5 V K' R7 T, v6 h4 M$ z- q. V |+ b" j
apt-get install libpcap-dev
, Z8 U3 O) t! {4 x6 L
/ M) K/ d% E) h( D. N$ V M上面的方法好像都没有效果,但是尝试了http://wiki.libvirt.org/page/The_daemon_cannot_be_started说的,把配置文件里的
/ j* ]5 S+ \7 T) j3 Y# ], N8 S8 |( s: e
listen_tls = 0注释取消(更奇怪的问题,在我的客户端链接不对)
. M/ O' ^% a3 ]6 N6 ?: f8 ]3 a! }) U4 _/ p- [6 A! H j, C# r
启动虚拟机:Connection reset by peer
$ S) G) E4 x" G y
! N9 G. w& T$ t6 `8 C" }; w1 pvirsh start vm1355991767186& T2 k; Z: _. c3 x, B' W, e5 d4 D
error: Failed to start domain vm1355991767186
4 \! y0 Z% q# W! t) h" rerror: Unable to read from monitor: Connection reset by peer
4 N4 y5 ]3 i- M5 h! o/ x- t
$ V9 e; C3 T' j4 g1 H 还有可能是这样提示:. Q+ G# ^. A4 K+ q ?( A6 ?% L2 r2 i
( c, L; r6 W: l- U
error: internal error process exited while connecting to monitor: Failed to allocate 16332619776 B: Cannot allocate memory4 O) m5 w, }3 h' X6 q
% ]/ L$ g( @ O9 x8 \这个问题可能是因为为VM分配的内存过大(甚至超过的物理主机的内存大小)
: d7 _2 ]* ?& U6 n) y1 ?' D: U" \5 L5 S9 Q$ u5 [
Unable to load library 'virt': libvirt.so: cannot open shared object file: No such file or directory
+ _- A( o* t' |$ \. _
! U2 Y- G) H1 s7 w( O& Vlinux 环境:1 C2 o& H2 K% u3 _
ln -s /usr/lib/libvirt.so.0 /usr/lib/libvirt.so1 K+ V1 y; J; W. H
windows 环境2 l# v% I R; V! U$ c# Z
将libvirt-0.dll改名为virt.dll
$ u& ]4 P& _2 b* E
, W+ A5 u/ p9 {$ y/ i2 Q# virsh undefine vm13546958949905 ~) t( E+ S; ]& d% f$ V
error: Refusing to undefine while domain managed save image exists
# A, D& T/ D& n4 Y- x0 J8 N: A7 }( M: c5 i4 f, G/ y$ w
http://www.redhat.com/archives/l ... -July/msg01219.html
- {) x# I! ?% y6 M! X; w# X7 L# a# Z- ^
managedsave" S# i6 d. a0 B, u
' m6 b; k4 U# F5 T解决办法:virsh undefine $domain --managed-save) l/ A; P% p: }
8 U' o& }8 R6 X1 J
在centos下面Define虚拟机时,确实没有/usr/bin/kvm,加软链接
0 Y7 N% Y6 r9 v% D" V! ~% G8 N4 Cerror: Failed to define domain from xxx.xml
. U3 a( h U$ q3 Q4 y5 Terror: Cannot find QEMU binary /usr/bin/kvm: No such file or directory% R8 o. M, p9 q5 @
/ s8 O. @8 _1 Z解决办法:ln -s /usr/libexec/qemu-kvm /usr/bin/kvm, V& k- s+ s, x' l d6 Q- S7 I0 J
|
|