找回密码
 注册
查看: 6031|回复: 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'- f) B. f8 a6 b' ~* H
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host Traceback (most recent call last):
" d- Y8 B% x$ x1 F6 m4 J) _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
" h( K' v. O1 d! ?2 s- S2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     handler()4 Y/ {' Q% Q# a% t/ M9 }
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
. M3 T! N) d+ w+ u/ \- j: J9 X" u2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     return self._conn_event_handler(*args, **kwargs)! C0 ^1 G5 Y: }% f3 x! [
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 486, in _handle_conn_event# r( {' M2 {. ?8 s
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     self._set_host_enabled(enabled, reason)8 h, n3 \; e' \, }/ E' O) E
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
1 j% D' c7 e( k; Q. L2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     mount.get_manager().host_up(self._host)
/ C, H- w8 n; L& k- R. Q/ d, V2018-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* g/ v; R3 i1 r" v5 @. t3 P! K
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     self.state = _HostMountState(host, self.generation)" H4 J) Q- S# v
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 229, in __init__
/ C- ^/ \4 R6 R  R+ v. |2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     mountpoint = os.path.dirname(disk.source_path)0 H; y# p' \! E, q; a" _2 M0 ^( B
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host   File "/usr/lib64/python2.7/posixpath.py", line 129, in dirname; \  M  o' k& K. J
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     i = p.rfind('/') + 10 P: h/ F9 ]" G/ N2 \/ {
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host AttributeError: 'NoneType' object has no attribute 'rfind'# c" B* I# h3 N+ ]/ _4 C0 b
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host ) t  r# H9 y  O5 U! Z( v
2018-12-02 00:00:33.488 23735 INFO nova.virt.libvirt.host [-] Libvirt host capabilities <capabilities>
" p; H: g* n" K6 L- z9 L3 _+ p

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'/ [( t& A3 X0 N2 C- W
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host Traceback (most recent call last):
( d8 m: G7 S  V. \7 d" z! |+ E2018-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
6 ]. Q; h# t& \; g2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     handler()
- g8 \0 }9 O& H3 \  x2018-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
8 S8 l# h3 z. k" y. W2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     return self._conn_event_handler(*args, **kwargs)2 O9 T+ U" g; z- ?+ q$ q
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_event! w1 |6 a! t+ B& m
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     self._set_host_enabled(enabled, reason)
* e1 E+ h8 t: v2 h2018-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
1 p: l9 q. U4 I2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     mount.get_manager().host_up(self._host)/ Y! w: p7 l: z  ^" k5 t# `
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
0 K8 C' H" V$ [) D2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     self.state = _HostMountState(host, self.generation). R& a6 D# T, @% L$ |8 k% l
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__
3 T! Z; z: {% B# I/ E/ d1 U2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     mountpoint = os.path.dirname(disk.source_path)
7 m  b- n3 o8 F  p2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host   File "/usr/lib64/python2.7/posixpath.py", line 129, in dirname
2 j6 ]' h% \$ ~$ M3 L( v4 \2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     i = p.rfind('/') + 1
  y$ |1 e- B; [0 B; X2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host AttributeError: 'NoneType' object has no attribute 'rfind'( k, a/ @' s( _4 j- p
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:
: E* \& a0 i* E) Q& [' |$ u/ f0 G& m4 J7 l: G  |: M
 error: Failed to start domain vm13685440204511 V3 h. |+ j7 H
% U" \9 r- i* f8 @. x, }7 `4 f
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 {, o. V" |0 F7 j
2 e! Y) R9 ~8 I2 Q
镜像格式错误,用qemu-img info 检查镜像和xml配置文件中指定的type是否一致。
* L7 R8 |) |$ {' n+ p) T
( v# |: Y) ~3 T
! T5 ~/ u% _6 P5 K' T3 Yerror: Failed to start domain vm0
) X+ b1 D, s" U. E$ ^: y
3 o! x* [) J# A1 [error: internal error process exited while connecting to monitor: Could not access KVM kernel module: No such file or directory0 i/ x4 `* M# U8 W% W& Q
failed to initialize KVM: No such file or directory) b8 D( m! R6 A" m# g% l. d
No accelerator found!
# l8 Y% N7 x1 E1 W$ Q( {$ C( P; D: d上面的提示信息就是因为QEMU在初始化阶段因为无法找到kvm内核模块。1 k! x% {, {( N) _
+ ]/ @( ~5 P; M& ]) W. R
sudo modprobe kvm   #载入指定的模块( P! N' @( e5 s1 n: P. L) q

6 z) X* D) W$ e/ I9 [重启电脑,进入bios界面,设置advance选项里面的virtualization标签为Enabled: x, S1 k3 E1 A1 z

" M; s  a; q4 w% @通过命令 lsmod | grep kvm    #显示已载入的模块
* `4 \0 J5 o/ \! y( G; s" }$ f- v% K) H) M9 E4 C8 j" u" S5 g# U1 v2 l2 W
 虚拟机迁移:1 \$ d4 D$ L+ j  [: N, c& a9 K
- }( t5 K7 \/ U2 T
# virsh migrate --live 1 qemu+tcp://192.168.0.121 --p2p --tunnelled --unsafe * ~( w9 D4 x4 q4 @
error: operation failed: Failed to connect to remote libvirt URI qemu+tcp://192.168.0.121(在URI后面加上/system,‘system’相当于root用户的访问权限)
! ?. H8 M2 O" C5 b. f0 c/ Q% g' ^- L
% n6 U4 o$ p4 M#virsh migrate --live 2 qemu+tcp://192.168.0.121/system --p2p --tunnelled
0 C6 s6 r$ ]+ B. L error: Unsafe migration: Migration may lead to data corruption if disks use cache != none(加上--unsafe参数)  a. r* w# p" N9 |- R; |  r; k. p

: B2 F1 P2 G  Y8 C#virsh migrate --live 2 qemu+tcp://192.168.0.121/system --p2p --tunnelled --unsafe 
2 E  {7 y1 r5 z# @1 ?/ Q4 rerror: Timed out during operation: cannot acquire state change lock (启动虚拟机有时也会遇此错误),需要重启libvirtd进程& A6 D: F* a/ H! _

2 x$ f" Q$ ]% X8 o7 ]virsh:
9 K5 o1 H9 L8 s/ D8 y. X0 Q( P( R0 @/ R1 V; @8 f
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Connection refused(libvirtd 进程没有启动,libvirtd是一个监听客户端请求的进程)
& i7 V% f1 g& ]  y, B3 Y2 u4 Y* f+ N- p4 D
$ virsh -c qemu:///system list0 R2 f; @, A6 F- ^: s+ C
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied$ U- }  `4 z* r' [: B- T8 ^! Q) t1 ~
error: failed to connect to the hypervisor& [' e2 K1 @% T8 f' R. H

8 y* |9 }6 A  r; E% Q(当前用户没有权限,修改/etc/libvirt/libvirtd.conf,unix_sock_rw_perms = 0777,使所有用户都有权限读写)
3 E% M& |2 ~# `  r) Y7 L8 X8 h" n+ Y/ C5 C* B& u$ d9 @& C
启动libvirtd进程出错:5 b& Z  R9 r# s6 c2 A0 ?

! P6 T! p: q1 U7 D7 a- U /usr/local/sbin/libvirtd -d -l --config /usr/local/etc/libvirt/libvirtd.conf (编译安装的启动方式)
2 t2 v: Z5 w9 ?2 C* qerror:/usr/local/sbin/libvirtd: initialization failed
: Q/ C5 L; V- l- C! A: ~
6 C  t5 E  z. e, o7 L9 D) {/ Btry to install libpcap-devel RPM and rebuild libvirt  http://comments.gmane.org/gmane.comp.emulators.libvirt/58218
' y; U/ v" P6 Y3 y% J/ U% Y- Y
$ y0 _5 G5 {$ ?" h4 gapt-get install libpcap-dev
9 R8 H) o+ \7 s; h" M/ G$ g, O# I+ h+ ^  v$ m4 p" Q# ~+ E' E
上面的方法好像都没有效果,但是尝试了http://wiki.libvirt.org/page/The_daemon_cannot_be_started说的,把配置文件里的
9 a$ g) d& A5 G, D' c5 V3 x0 H5 p, y. K7 S2 I  \
listen_tls = 0注释取消(更奇怪的问题,在我的客户端链接不对)7 M. g/ K) o. K& C2 r( g

% y% s1 }- \$ ?4 \1 E7 T. x$ E: O' h启动虚拟机:Connection reset by peer2 |) V( K7 F; l+ r  r
( m: }/ V: v: v" V1 g) Y; t: h
virsh start vm1355991767186
: G4 L! ]& H- Yerror: Failed to start domain vm1355991767186/ |0 o# M3 N" v+ {* `, q+ `% p
error: Unable to read from monitor: Connection reset by peer
3 h% p" f% m' {- X0 W& ~! {, t- X! N; Z) _1 c5 u( L, H
 还有可能是这样提示:
# m# {! u+ s* F" z' N% i4 V& v1 H8 `& e5 h, N6 P
error: internal error process exited while connecting to monitor: Failed to allocate 16332619776 B: Cannot allocate memory% h# E7 Y. L' i7 t: d9 M

. |- W# a& y1 A8 p) i2 E* x这个问题可能是因为为VM分配的内存过大(甚至超过的物理主机的内存大小)
0 q- r/ r$ U! m* O" ?: \1 j& a+ l- e
; j: @# D, `% Y9 P1 zUnable to load library 'virt': libvirt.so: cannot open shared object file: No such file or directory
6 N# Y' Q( R. D2 h) _
) [" e. i0 `7 @, z4 W" U6 Jlinux 环境:
0 |  w4 k9 r/ t+ l7 y5 N) p  a     ln -s /usr/lib/libvirt.so.0   /usr/lib/libvirt.so
# f: }- v7 b' d8 B5 m0 V/ X5 Gwindows 环境
! z6 q' `# o3 j$ {3 Y8 i     将libvirt-0.dll改名为virt.dll
2 m, W6 g0 Y* v- e  - j) a( J" z; [+ _# E4 i, c
# virsh undefine vm1354695894990$ a) _7 n6 @0 c' E- ]3 ?& G, P) _
error: Refusing to undefine while domain managed save image exists' R2 z$ I) l1 K, b6 M. C  ~4 c

3 N; @1 |  |4 b+ j8 U9 Fhttp://www.redhat.com/archives/l ... -July/msg01219.html4 o( x8 D! x8 @5 T' r8 {" M8 G

0 o: A+ q) y1 m managedsave
0 c0 D. u' {# u4 k) T0 k$ _9 u3 Q% b+ `, A  S+ N/ I+ J- d
解决办法:virsh undefine $domain  --managed-save
1 ?0 b% }6 A; v/ y6 t1 R: @/ i 
$ ~. v: B  G* o/ E# l" d: e在centos下面Define虚拟机时,确实没有/usr/bin/kvm,加软链接
7 X9 L+ {+ V# x3 A: w. Kerror: Failed to define domain from xxx.xml
2 C' g( O; e# B/ uerror: Cannot find QEMU binary /usr/bin/kvm: No such file or directory
- r! y6 R+ d, x( b  J
$ r% Y, {3 Q! s. ^解决办法:ln -s /usr/libexec/qemu-kvm /usr/bin/kvm% N6 h- F& J# ]8 J
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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