易陆发现互联网技术论坛

 找回密码
 开始注册
查看: 6027|回复: 2
收起左侧

ERROR nova.virt.libvirt.host [req-77f4f218-4f36-4744-aa4b-6e0d0e58704a - - - - -

[复制链接]
发表于 2018-12-2 00:02:38 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?开始注册

x
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host [req-77f4f218-4f36-4744-aa4b-6e0d0e58704a - - - - -] Exception handling connection event: AttributeError: 'NoneType' object has no attribute 'rfind'
& \$ i4 v4 P3 j6 d$ N: p* z2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host Traceback (most recent call last):9 f6 r# l/ l" W# m1 ]$ N" N& i
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host   File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/host.py", line 148, in _dispatch_conn_event4 J( J5 H$ `+ ?0 Z
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     handler()& }0 o# ~- \  q5 n! I0 @* u7 C
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host   File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/host.py", line 397, in handler" A' J4 Z. {% U# G5 @# O
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     return self._conn_event_handler(*args, **kwargs)
; Y" _. u- ]9 W( B9 W  a2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host   File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 486, in _handle_conn_event5 o( ?* W# s6 z. W' `" q
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     self._set_host_enabled(enabled, reason)
% x( H9 a. o  B/ ?4 S8 }2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host   File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 3812, in _set_host_enabled
% b; |+ ]0 Q' q  ^2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     mount.get_manager().host_up(self._host)
$ g$ f" N/ f3 c6 g$ ~2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host   File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/volume/mount.py", line 134, in host_up
  A+ T" p! S- l0 u: r1 u: V" j2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     self.state = _HostMountState(host, self.generation)
# j1 B! [2 W1 f, e0 O1 V% p5 L2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host   File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/volume/mount.py", line 229, in __init__
) I! h& q4 |4 g( k8 j: O' X4 p2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     mountpoint = os.path.dirname(disk.source_path)( B* j$ f! O1 X9 B. B" D) o2 m
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host   File "/usr/lib64/python2.7/posixpath.py", line 129, in dirname- Z' H+ n3 w$ {: o
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     i = p.rfind('/') + 1; _  z; M  G" T) }. W0 e( ?' [% N
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host AttributeError: 'NoneType' object has no attribute 'rfind'
; i3 @- Y  A7 d0 z2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host   t; d- C: f; Z9 u: n2 D! d
2018-12-02 00:00:33.488 23735 INFO nova.virt.libvirt.host [-] Libvirt host capabilities <capabilities>1 l. t* L& A& [3 b) m6 ]6 I3 s
 楼主| 发表于 2018-12-2 00:08:24 | 显示全部楼层
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host [req-e2d53673-c705-4928-a3bb-b092e65e99eb - - - - -] Exception handling connection event: AttributeError: 'NoneType' object has no attribute 'rfind'
- f9 y  f+ E! r  _- q% ?6 y( ~* V( J2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host Traceback (most recent call last):/ I  J+ h" T3 @" E4 S/ ]& m5 h% @! G
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host   File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/host.py", line 148, in _dispatch_conn_event
" n6 h' s0 u6 |6 W6 @# ^' g, O2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     handler()
4 A; X3 X: t# a5 ]2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host   File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/host.py", line 397, in handler
7 p) z- S" F+ x6 C; g* d& ]2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     return self._conn_event_handler(*args, **kwargs)
& o6 n) C$ k* L4 N9 F/ [) c2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host   File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 486, in _handle_conn_event4 u7 p" N4 W4 k& K
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     self._set_host_enabled(enabled, reason)) \- H# u3 {2 O% f4 L  h
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host   File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 3812, in _set_host_enabled5 R" X2 R6 V) b
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     mount.get_manager().host_up(self._host)( [- A5 p5 V) F$ `' G6 j# H
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host   File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/volume/mount.py", line 134, in host_up/ z9 H, Z5 n+ r" G
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     self.state = _HostMountState(host, self.generation)
4 |  W8 v$ F) N. ]( h  y& P! w2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host   File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/volume/mount.py", line 229, in __init__
$ H) \% m' x  O% x5 ?8 i+ M2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     mountpoint = os.path.dirname(disk.source_path)
5 ], ?4 O7 s& v, B* Y" ?2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host   File "/usr/lib64/python2.7/posixpath.py", line 129, in dirname
% J! V( O- Y( q  \! F2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     i = p.rfind('/') + 1  W7 B' B1 f5 J' Y( m+ g
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host AttributeError: 'NoneType' object has no attribute 'rfind'
3 O. `& B+ X3 u2 ]' L7 U6 k( r; W2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host
 楼主| 发表于 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
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

站长推荐上一条 /4 下一条

北京云银创陇科技有限公司以云计算运维,代码开发

QQ|返回首页|Archiver|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )点击这里给我发消息

GMT+8, 2026-4-8 21:20 , Processed in 0.041122 second(s), 23 queries .

Powered by Discuz! X3.4 Licensed

© 2012-2025 Discuz! Team.

快速回复 返回顶部 返回列表