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

楼主 |
发表于 2018-12-8 17:56:58
|
显示全部楼层
virsh start vm1368544020451:3 `( ^( q. \7 J/ |, Y
+ d" O$ d- D2 W& [4 o; s/ Y R error: Failed to start domain vm1368544020451
5 j0 A( A+ r$ L" c6 R
5 i: h" P9 X& }) F, l# z. ?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 argument6 u+ a a; [' T2 r
/ Z, K* q0 |* E; N6 K镜像格式错误,用qemu-img info 检查镜像和xml配置文件中指定的type是否一致。' B$ h6 Q9 @- u e% D4 V
. o9 U; [5 w; o3 l
6 H6 W& Q8 A5 y6 U
error: Failed to start domain vm0
' p6 S4 j H- B2 a+ {8 }
. ]3 M" |! S. J `- Rerror: internal error process exited while connecting to monitor: Could not access KVM kernel module: No such file or directory! m6 Q" d0 h: \7 g, |6 Z& g
failed to initialize KVM: No such file or directory ^& N# ?# q# e/ G3 R, U$ @, n3 D' J' {$ }
No accelerator found!. E) {/ Z* M1 K- k' N" V6 b
上面的提示信息就是因为QEMU在初始化阶段因为无法找到kvm内核模块。3 j, P, j! K8 }2 c+ E
8 B* R3 B4 o* G: Z0 C5 M0 Vsudo modprobe kvm #载入指定的模块 {2 G. }; i! _0 j3 a5 h
0 A1 ?; J, k/ g0 g- A0 Q
重启电脑,进入bios界面,设置advance选项里面的virtualization标签为Enabled6 w, ~* l7 O: C9 w& ?
( {( }2 H: m% h# ?1 A2 Z通过命令 lsmod | grep kvm #显示已载入的模块8 P& x1 d4 B3 V4 J8 w% ^% I
" d" R- g# d; Y; m* p 虚拟机迁移:
& n3 j6 K- d* H5 |. [2 k2 N5 [" f/ | H2 x
# virsh migrate --live 1 qemu+tcp://192.168.0.121 --p2p --tunnelled --unsafe * t/ n* f( T( Q3 }: v+ D% w$ a
error: operation failed: Failed to connect to remote libvirt URI qemu+tcp://192.168.0.121(在URI后面加上/system,‘system’相当于root用户的访问权限)
& u$ z! P4 M2 v: H6 ^- F
6 y- p3 I% S0 i5 q, ~7 q, y1 `#virsh migrate --live 2 qemu+tcp://192.168.0.121/system --p2p --tunnelled+ r3 n H, C5 H4 W: h! R
error: Unsafe migration: Migration may lead to data corruption if disks use cache != none(加上--unsafe参数)
4 I" r' F% N! I! h8 \2 x& c+ t1 z+ U6 s) E+ B. H3 p" r2 Z
#virsh migrate --live 2 qemu+tcp://192.168.0.121/system --p2p --tunnelled --unsafe 0 ^: E: E, f2 t0 w8 V/ s) k V
error: Timed out during operation: cannot acquire state change lock (启动虚拟机有时也会遇此错误),需要重启libvirtd进程
5 T8 c9 E+ K, x, H1 m& r0 ^
. d4 v" J# `3 H W1 _# g" a8 U' T+ gvirsh:
! Q* H# o* u1 Y9 {) q3 S' ]; b0 r9 k2 Q/ }9 K3 d- n
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Connection refused(libvirtd 进程没有启动,libvirtd是一个监听客户端请求的进程)
6 H8 r# v( C) `* u3 p( i G% q5 R* ]: w9 d4 u. {2 c- l, T
$ virsh -c qemu:///system list
) }7 n' J& T% uerror: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied
+ {% j' t" M* Derror: failed to connect to the hypervisor+ q# O8 N9 \) ^8 ~% G& ?) o- o+ v
7 D$ a* h3 m3 A1 i! m* t
(当前用户没有权限,修改/etc/libvirt/libvirtd.conf,unix_sock_rw_perms = 0777,使所有用户都有权限读写)/ f4 H% N# e: ~8 j6 o( J
9 C2 B7 F$ u) e. i启动libvirtd进程出错:- A9 k: {; l9 H% p
* B; z: M7 V6 {; Z( L7 k# n! B /usr/local/sbin/libvirtd -d -l --config /usr/local/etc/libvirt/libvirtd.conf (编译安装的启动方式)
( z* x! H* j) ~" S N8 i3 Derror:/usr/local/sbin/libvirtd: initialization failed
3 G$ `% x0 ]) ]0 U! r5 S2 n! S9 o* m/ ~8 Q1 O3 o1 e8 p
try to install libpcap-devel RPM and rebuild libvirt http://comments.gmane.org/gmane.comp.emulators.libvirt/58218
; ?- T; A2 L+ {. }! c, P
( i2 |( L+ O: t% q/ F, b# Capt-get install libpcap-dev) m Z) W/ V3 l
G5 O/ J4 @, O. j% y. G上面的方法好像都没有效果,但是尝试了http://wiki.libvirt.org/page/The_daemon_cannot_be_started说的,把配置文件里的9 [/ D H3 V6 C. i/ j: G E
0 X1 B2 D5 w$ O# M8 H: vlisten_tls = 0注释取消(更奇怪的问题,在我的客户端链接不对)) W' c: \4 Z7 e
. e6 H( ?* R Y1 T9 m( H
启动虚拟机:Connection reset by peer
! l# ]. d/ U* F7 E1 O# L, d% o/ }2 t, q0 S) i
virsh start vm1355991767186
1 w4 S( `9 h% O, z0 _, m r* l5 _error: Failed to start domain vm1355991767186
. N% w9 Q$ C7 z7 a- s# U5 uerror: Unable to read from monitor: Connection reset by peer% n/ U' J. ^ L }0 a2 N8 w
8 i; G/ K# X/ ~1 y+ E7 G
还有可能是这样提示:7 Q8 E& ?9 @+ F% U& ]4 m% T
; M e0 U( } t' {3 }( i. _! e: p5 Gerror: internal error process exited while connecting to monitor: Failed to allocate 16332619776 B: Cannot allocate memory
, e, T" t) T( j2 r$ y
, @2 P5 m% m9 H t8 @2 L7 W这个问题可能是因为为VM分配的内存过大(甚至超过的物理主机的内存大小)
s" Z. d# u- ]6 f% w. t% B
$ q8 y0 |, B( ?) q9 V; X' aUnable to load library 'virt': libvirt.so: cannot open shared object file: No such file or directory
9 {, ~1 T+ d* e, g9 a, I0 J: [8 V; o/ B7 G/ @; A+ f
linux 环境:1 d5 b' `/ G5 J% r
ln -s /usr/lib/libvirt.so.0 /usr/lib/libvirt.so
# N0 R- N2 h. `7 \windows 环境
6 Z6 J6 N$ i$ C 将libvirt-0.dll改名为virt.dll
, D) ~3 L; r4 [ 1 V" [% o7 ?" N Y1 i
# virsh undefine vm1354695894990
; m- J& v$ n! B" [/ g& Lerror: Refusing to undefine while domain managed save image exists c C. @ b3 }2 J' c7 z( M
% ^. c Z* H# y" l" n* Z$ Uhttp://www.redhat.com/archives/l ... -July/msg01219.html9 \1 Z( V( d# x8 L% z: B3 u% L
/ q; {" { i: {& c# Q$ [
managedsave
2 z; a2 e: d6 a6 O: c2 H6 L' {+ a
- F/ s4 [3 l# W8 r( [8 K) p7 k解决办法:virsh undefine $domain --managed-save/ b- g2 M1 U/ x
% f2 f K6 l4 h# c# j7 K在centos下面Define虚拟机时,确实没有/usr/bin/kvm,加软链接) C- C9 K+ U1 {- j; g
error: Failed to define domain from xxx.xml
' @) s! c( ^# Q# @$ R. }- u$ J5 berror: Cannot find QEMU binary /usr/bin/kvm: No such file or directory
0 ]$ D* Y( L. r4 @
& N) y1 k8 a' q解决办法:ln -s /usr/libexec/qemu-kvm /usr/bin/kvm
- o* x+ U; ~* q( m* v |
|