找回密码
 注册
查看: 6032|回复: 2

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

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2018-12-2 00:02:38 | 显示全部楼层 |阅读模式
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'
* a; m3 O2 J4 [( f3 q% b2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host Traceback (most recent call last):& ^, x# g* ]6 d/ S7 {* Q
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_event
8 C5 h/ C7 t- [6 p6 S4 w5 h2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     handler()
9 H* u& @' }3 C! S# C% o4 W2018-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' `' H- A1 ?3 }5 U+ z
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     return self._conn_event_handler(*args, **kwargs)
8 ?' r, r. I! V" u3 f" ^, P2018-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_event
1 L, J& a! f2 j: D2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     self._set_host_enabled(enabled, reason)
& e0 A4 j1 G  v: g2018-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' F& T- _# N6 N9 a# P+ g
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     mount.get_manager().host_up(self._host): h9 t. M  m3 M9 X6 X1 F
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
+ h/ a: e" m, ]( }6 ^2 M2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     self.state = _HostMountState(host, self.generation)
5 _& F) ~; S8 e2018-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__
; E. Q3 o; Q- r0 x2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     mountpoint = os.path.dirname(disk.source_path)
2 j$ w5 n3 h% J8 s8 F; `0 M8 b2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host   File "/usr/lib64/python2.7/posixpath.py", line 129, in dirname$ X+ [0 O' |6 [- k0 r8 Z5 M' n+ E
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     i = p.rfind('/') + 11 t0 i6 n# ~7 a2 u2 C+ E, S" F1 a0 N
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host AttributeError: 'NoneType' object has no attribute 'rfind'1 N8 X: v8 E$ ]  f1 M
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host 4 ]6 R1 Q% E0 c* G! v1 `: i
2018-12-02 00:00:33.488 23735 INFO nova.virt.libvirt.host [-] Libvirt host capabilities <capabilities>) d2 i- p7 T8 w; o: W( F: @, I! M# n

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 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'
* L0 \( \. G4 g! I  [& k9 g! i- l, [2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host Traceback (most recent call last):
+ e2 Z% S, m" \: e, i9 P9 I2018-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- {  h& |: a$ j
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     handler()* o' k: n4 Z5 f2 P0 d+ G7 b
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
, |; m9 ?& j) W& d7 A2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     return self._conn_event_handler(*args, **kwargs)* ?7 o" V4 v7 S# P' w
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 486, in _handle_conn_event7 x+ D  r4 [' k; H
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     self._set_host_enabled(enabled, reason)+ Y3 }2 r9 H3 l. N0 ^
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_enabled
8 Q: ~6 c' f% M$ L5 ?2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     mount.get_manager().host_up(self._host)3 Z1 h! S* M$ Q! V+ q/ p% B8 A
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
9 m) I% v9 V) G8 ?! w2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     self.state = _HostMountState(host, self.generation)- u. j* e7 P4 c0 K/ u- u9 }) R
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 229, in __init__  @9 e. B# F8 U( b
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     mountpoint = os.path.dirname(disk.source_path)+ w* C4 {) E* S
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host   File "/usr/lib64/python2.7/posixpath.py", line 129, in dirname
1 Z9 j0 d4 _4 a7 J! e2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     i = p.rfind('/') + 1
: [* z' e) d5 u5 c7 S' e4 n5 X" F2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host AttributeError: 'NoneType' object has no attribute 'rfind'
* J$ z2 r# h0 s7 M: u7 [2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 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
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 03:37 , Processed in 0.017820 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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