|
|
楼主 |
发表于 2018-12-8 17:56:58
|
显示全部楼层
virsh start vm1368544020451:" }1 Y. _5 l0 w: {- [
' ?& B! b' f/ U1 \6 g# U, a error: Failed to start domain vm1368544020451
0 m( [' @+ A, `$ ~9 _* V. G4 q! U7 c( }- F5 M8 q
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; v1 K2 f! _- k- n; P" ]3 f9 H
4 u) c1 j: U- U' w) J
镜像格式错误,用qemu-img info 检查镜像和xml配置文件中指定的type是否一致。
1 }3 @( H' S& e* h; O% r+ f
K( A; Y' k4 P8 p: k |1 |
" T& J! ^0 e3 J# Y2 Jerror: Failed to start domain vm0
9 n3 C1 X% l) q6 R! U9 H( E X' ]" p( q# Y% }) i
error: internal error process exited while connecting to monitor: Could not access KVM kernel module: No such file or directory
: z; n- V/ @$ {! `; tfailed to initialize KVM: No such file or directory/ t# t5 K8 i6 F0 O
No accelerator found!
1 k% D, j) j: F5 s( z上面的提示信息就是因为QEMU在初始化阶段因为无法找到kvm内核模块。' L2 r4 X/ ^2 q5 O
# X9 Q, z! h0 {; [3 L/ x9 u
sudo modprobe kvm #载入指定的模块0 T9 z! |. ^3 _5 n f
4 k5 b; I5 G# O; D4 \5 i' @" m
重启电脑,进入bios界面,设置advance选项里面的virtualization标签为Enabled$ C7 @# O. i7 s9 l: b
# W! q) z" p3 C* w; ?
通过命令 lsmod | grep kvm #显示已载入的模块( ~( q5 j; V9 t5 r
5 `4 R0 b# r& q. P 虚拟机迁移:- t# W6 f( ] w: z/ Y
9 {* s& Q5 l0 J0 M/ |
# virsh migrate --live 1 qemu+tcp://192.168.0.121 --p2p --tunnelled --unsafe
7 @$ K! V4 x5 ?5 Terror: operation failed: Failed to connect to remote libvirt URI qemu+tcp://192.168.0.121(在URI后面加上/system,‘system’相当于root用户的访问权限)
( h5 J: Z5 u6 m5 C$ ]7 C& O
y4 {. s7 `+ \7 j5 ?7 ~ G% u#virsh migrate --live 2 qemu+tcp://192.168.0.121/system --p2p --tunnelled
! z0 T8 Z. [4 n9 q error: Unsafe migration: Migration may lead to data corruption if disks use cache != none(加上--unsafe参数)
; i# c( h% E. Y4 T: j. H) ]8 T4 C6 F+ ^1 u7 P
#virsh migrate --live 2 qemu+tcp://192.168.0.121/system --p2p --tunnelled --unsafe
" t7 P) y& _- a; v% j+ derror: Timed out during operation: cannot acquire state change lock (启动虚拟机有时也会遇此错误),需要重启libvirtd进程
: |, z% l4 ~) K3 C I, F5 [; b' ^- R& w6 \/ D4 f" p+ O8 m
virsh:
" w8 I! w: D$ u, ~5 b3 f( H% B7 ~0 c, a7 A/ e7 n9 r) E
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Connection refused(libvirtd 进程没有启动,libvirtd是一个监听客户端请求的进程)" `6 s8 n$ w6 K- p; S0 S1 k
- a2 j7 x f) ?" w* k& c" a% U, @, A
$ virsh -c qemu:///system list+ ]& S/ y5 L& @, {/ w
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied
& [5 l7 u# V# u' F2 w# Perror: failed to connect to the hypervisor2 z& y( `2 I. z" J7 b
8 R8 P D, T% Q% X% L
(当前用户没有权限,修改/etc/libvirt/libvirtd.conf,unix_sock_rw_perms = 0777,使所有用户都有权限读写)+ E; j! `1 p* @3 G- w
. T8 p% l( r/ g" K
启动libvirtd进程出错:* y0 ~; Q, o: M5 j9 L' D" p
3 v; J' n' z+ a C /usr/local/sbin/libvirtd -d -l --config /usr/local/etc/libvirt/libvirtd.conf (编译安装的启动方式)/ e6 F9 t9 m( e- e. L
error:/usr/local/sbin/libvirtd: initialization failed
& m1 |5 g# I, p1 I: V4 Y& _6 _5 p. k- t
try to install libpcap-devel RPM and rebuild libvirt http://comments.gmane.org/gmane.comp.emulators.libvirt/58218
5 G1 p7 o) b/ I
J- m( x, C! A, ]( n* Lapt-get install libpcap-dev
8 I5 K6 K* J& v! K2 [, m
& L" \% u9 o% U1 t# \5 t6 p8 q上面的方法好像都没有效果,但是尝试了http://wiki.libvirt.org/page/The_daemon_cannot_be_started说的,把配置文件里的
5 N! m/ G5 R: k4 f, j
: b: Y" V) E: Vlisten_tls = 0注释取消(更奇怪的问题,在我的客户端链接不对)
4 s% _9 Y- L' o# X5 v$ H# i; i V# ]) N* _
启动虚拟机:Connection reset by peer/ M+ v/ W! V6 z" `+ @3 f; o5 R/ T
# ?' b' R+ P8 }: P/ O# ~3 V
virsh start vm1355991767186
$ U9 G. N7 A) W% _error: Failed to start domain vm1355991767186
! [+ y" q; {, v, l# }& verror: Unable to read from monitor: Connection reset by peer' p, m7 R4 k6 J( J7 r: H! W
: H' s' Q2 X+ N7 r, D2 F5 x8 C- u5 P
还有可能是这样提示:+ O" @2 Q! c7 Z7 c2 b/ F5 F
" U1 Y) }9 w/ t$ v& H
error: internal error process exited while connecting to monitor: Failed to allocate 16332619776 B: Cannot allocate memory
0 K) }4 b+ { m* _- g. e3 \7 d
1 j0 h5 U0 n/ B& M/ r这个问题可能是因为为VM分配的内存过大(甚至超过的物理主机的内存大小)0 V8 G4 V3 C2 ]% O8 Y
7 y) P4 w" O+ {
Unable to load library 'virt': libvirt.so: cannot open shared object file: No such file or directory
5 y1 y/ s0 K# {+ s
' k& [, x$ S1 U; S( Flinux 环境:
( K' y( e1 j3 k' C- i" g9 R/ ^, `7 ]* K ln -s /usr/lib/libvirt.so.0 /usr/lib/libvirt.so
8 a+ s: X$ j( F* u1 [windows 环境
# h" b+ I: O# U7 A 将libvirt-0.dll改名为virt.dll
! S |0 s6 z" E" x4 e" a% E% {$ } l $ P$ G$ w% ], G
# virsh undefine vm13546958949903 N9 ^$ |9 K3 N0 y9 l9 Y
error: Refusing to undefine while domain managed save image exists
3 U* D# T: @5 [4 o0 y: f9 k+ o5 c! t6 U4 z
http://www.redhat.com/archives/l ... -July/msg01219.html+ U L& n& [! O# J* h# h
6 r. V% Y# V: D" |/ h, C managedsave
' m9 h" i+ D& K! v+ H
: W; s7 A# B, @5 O0 F" q. @' a解决办法:virsh undefine $domain --managed-save
% ~" X2 ~/ @6 Q$ a- I* C . ~( V! [" r7 c' Y
在centos下面Define虚拟机时,确实没有/usr/bin/kvm,加软链接. w% v4 r" p! B7 U' L j+ P
error: Failed to define domain from xxx.xml
4 f2 _9 J* Z/ Merror: Cannot find QEMU binary /usr/bin/kvm: No such file or directory
# U4 B; e9 E0 v3 U2 [/ I. L; D. I6 }$ x% {
解决办法:ln -s /usr/libexec/qemu-kvm /usr/bin/kvm/ F6 q& K1 P7 K& a4 M; z5 W
|
|