找回密码
 注册
查看: 6030|回复: 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'
% E8 r8 J$ |9 h! V, F2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host Traceback (most recent call last):* I8 ~+ r: F; P' W* n; H
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_event2 B! V4 T; p* b( j8 Q% ^7 H6 [) @
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     handler()5 e6 W9 y! R! \  I3 g, j; g! o
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 handler1 x) A  K% Q5 z: Z/ Q- n& t: ~* t
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     return self._conn_event_handler(*args, **kwargs)4 J1 O- |7 b0 i
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
( E2 k" e' n1 E$ [9 {2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     self._set_host_enabled(enabled, reason)5 p4 p  ]+ H' S2 Y! y
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
4 n; n9 B9 o3 O. M" v# B$ W- p2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     mount.get_manager().host_up(self._host)
! ?. K; R/ ^/ M( i, S* u2018-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
( N2 J$ \7 ]9 b/ y2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     self.state = _HostMountState(host, self.generation)
! T' G8 n3 q9 v5 V  S2018-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__/ `+ `. Q3 e5 c" P% P* p0 V5 A" R
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     mountpoint = os.path.dirname(disk.source_path)' _! F4 R0 |' Z; k( G
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host   File "/usr/lib64/python2.7/posixpath.py", line 129, in dirname
- Q5 N1 ^; q% w3 D! Y2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     i = p.rfind('/') + 1
& {! l5 C" U" u0 X( f# [2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host AttributeError: 'NoneType' object has no attribute 'rfind'7 Z$ o5 T# ]# A" L2 r7 o
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host
- p5 B% {$ |8 m% k9 |9 a( c8 d2018-12-02 00:00:33.488 23735 INFO nova.virt.libvirt.host [-] Libvirt host capabilities <capabilities>; X$ b2 o$ k$ F" J+ T( I- x

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'
$ Z( v6 \$ J7 U8 Q6 s' P% @# z2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host Traceback (most recent call last):
9 t. P8 E& `) M5 f% d% b& `( q; ]5 {: V2018-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" G7 O/ o, A# w
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     handler()4 X" ~8 d0 o: W4 s7 q
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! B6 |0 Z$ P/ G  p* c: M/ D5 E
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     return self._conn_event_handler(*args, **kwargs)
6 M  z0 D8 U1 v5 C7 N2018-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
. L* @% i1 _$ e2 P! y( ?2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     self._set_host_enabled(enabled, reason)& P' e4 ^7 a  A; u5 ]5 `0 x
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+ h0 O4 U6 ?8 a# @0 r
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     mount.get_manager().host_up(self._host)
7 x% x6 I% m, j6 s0 l8 {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: Y5 ^! ~4 G' [0 m
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     self.state = _HostMountState(host, self.generation)
$ J/ m6 ~+ U: g0 m2018-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__
% s; t8 ^# x/ [5 n2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     mountpoint = os.path.dirname(disk.source_path)
2 v& Y4 n8 m' g2 U8 g: R5 t& C, y2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host   File "/usr/lib64/python2.7/posixpath.py", line 129, in dirname
, c& F% t/ e8 _/ ~" A  n2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     i = p.rfind('/') + 12 T: z0 @6 b" S  Z' t+ B. n% ?
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host AttributeError: 'NoneType' object has no attribute 'rfind': s/ j1 X; ~8 D9 A, w5 U7 }9 H( X- @
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:
3 u7 V% ?1 K* @6 d6 |1 ^9 }* O. f2 v" l4 S8 Q
 error: Failed to start domain vm1368544020451% M% V0 o* i( L8 Z  R' N4 e

/ N% U) \" g2 a2 Z2 u3 Uerror: 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* a+ [2 Q8 |+ M+ n& _/ v
, X  r; {- [1 v
镜像格式错误,用qemu-img info 检查镜像和xml配置文件中指定的type是否一致。
/ `/ F8 u$ E7 v) |$ ~
9 O( y2 ~9 K; t; F* q0 D
) h" M5 |* b# ^error: Failed to start domain vm0# B: W. L7 r+ ?" e

0 s  l1 }0 h# f# `" f) t$ `error: internal error process exited while connecting to monitor: Could not access KVM kernel module: No such file or directory
' V! L) f+ t! G; P$ F9 B) D8 Bfailed to initialize KVM: No such file or directory1 I, s4 [+ J  _  x
No accelerator found!7 h; m" h% R3 J6 Q- ~+ `* i1 _/ y1 H3 x
上面的提示信息就是因为QEMU在初始化阶段因为无法找到kvm内核模块。
! i9 T: t  Y* h0 N
5 v5 n4 f4 s8 I1 }sudo modprobe kvm   #载入指定的模块
" K$ H8 Q" D. Y, ^: d6 }. N+ {; }' l6 [; R! d0 ?
重启电脑,进入bios界面,设置advance选项里面的virtualization标签为Enabled
+ h5 h7 q8 S+ N2 y1 W5 e. U
, d6 J6 W' X& _9 G! c% q9 @通过命令 lsmod | grep kvm    #显示已载入的模块
0 [- I$ d; T. Y' a- |6 v1 L8 k  ~8 ?4 ?. ?6 ~
 虚拟机迁移:
2 r* P3 f% x* {+ g9 z
2 o. v. v6 T+ |- V2 o& |# virsh migrate --live 1 qemu+tcp://192.168.0.121 --p2p --tunnelled --unsafe 4 }7 ]( R+ |! h- i9 e# _
error: operation failed: Failed to connect to remote libvirt URI qemu+tcp://192.168.0.121(在URI后面加上/system,‘system’相当于root用户的访问权限)
- _( b. C2 @4 J- h
. b8 O3 q8 D0 u1 I7 W1 x8 T#virsh migrate --live 2 qemu+tcp://192.168.0.121/system --p2p --tunnelled
( O( C5 `7 k3 B* e2 S# S/ a% [2 c9 [ error: Unsafe migration: Migration may lead to data corruption if disks use cache != none(加上--unsafe参数)
; i7 L8 A$ N* Q2 J
& A5 d% I: H; X! Z- E/ g#virsh migrate --live 2 qemu+tcp://192.168.0.121/system --p2p --tunnelled --unsafe 8 n. S3 K4 l. F- |7 {
error: Timed out during operation: cannot acquire state change lock (启动虚拟机有时也会遇此错误),需要重启libvirtd进程9 b: t; H( o- A, {, C8 ?% B

" [( R+ @5 r4 {virsh:
( \7 i3 l3 C( s6 F0 d
' `% L, u! B7 C) W& nerror: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Connection refused(libvirtd 进程没有启动,libvirtd是一个监听客户端请求的进程)
: L; K. A+ \3 @1 d/ I* _0 q. W0 n4 F" i
$ virsh -c qemu:///system list  B4 w' u, R2 T$ i- \$ `/ ~7 w) n: R
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied
/ C+ ^5 f+ V' H( ~6 Berror: failed to connect to the hypervisor. z, \2 U' k3 V% o# |& D
3 y7 `$ o1 Y" M$ v9 p
(当前用户没有权限,修改/etc/libvirt/libvirtd.conf,unix_sock_rw_perms = 0777,使所有用户都有权限读写)
' U8 m# H9 D8 y5 H- y0 f+ Y
+ L4 L4 ]# \: w  {2 a% ~. U3 d启动libvirtd进程出错:
7 g" J  W+ J. x9 C
5 Z/ m5 v7 ?' b5 C) ?2 v3 V- q* Z /usr/local/sbin/libvirtd -d -l --config /usr/local/etc/libvirt/libvirtd.conf (编译安装的启动方式)! j( R2 t" G' h
error:/usr/local/sbin/libvirtd: initialization failed
3 Y8 f- C$ U/ s- ~8 e
, s' ^0 [9 q- G' _$ b# C* F5 H# w2 B2 Rtry to install libpcap-devel RPM and rebuild libvirt  http://comments.gmane.org/gmane.comp.emulators.libvirt/58218+ I- _1 _6 G4 z' z! D4 g

3 \; |+ q$ }( i& r# d0 qapt-get install libpcap-dev
& R' ]8 t" T6 W6 C4 n/ w: c& N2 W2 r% J5 A  c7 c$ ]
上面的方法好像都没有效果,但是尝试了http://wiki.libvirt.org/page/The_daemon_cannot_be_started说的,把配置文件里的
" J  C& J9 F; z
5 e) X  w; R+ \# \3 v* g& Olisten_tls = 0注释取消(更奇怪的问题,在我的客户端链接不对)
) m: O/ X/ L2 M( F# n. p; y0 m& N1 F
启动虚拟机:Connection reset by peer5 z' x) B; [4 c5 R' C: l! H

; I! z" P) }- w6 Hvirsh start vm1355991767186# Z$ j5 W, V, _2 r
error: Failed to start domain vm1355991767186
" a) l5 Y4 w( B8 \6 \# perror: Unable to read from monitor: Connection reset by peer
. g" Q5 x6 Y# B- o: E% {0 @3 }$ a  g# {5 U( `
 还有可能是这样提示:* X3 U! H3 K) t! |! X& Y% D2 o

8 H2 Q9 M6 T% l* ]" i; Berror: internal error process exited while connecting to monitor: Failed to allocate 16332619776 B: Cannot allocate memory
1 S) [0 U/ F% s2 T3 f7 n
9 L7 s* a. A0 B) K这个问题可能是因为为VM分配的内存过大(甚至超过的物理主机的内存大小)
6 h: i3 n( W- E
- |( i, F/ ?& k; P+ i* lUnable to load library 'virt': libvirt.so: cannot open shared object file: No such file or directory
+ {5 ]$ h& a# [4 @( s& V; l5 B3 }9 B! N7 e! [8 ~: C# `
linux 环境:
. W" P$ h* Z( H8 F4 A# L: q, q) M3 n4 H     ln -s /usr/lib/libvirt.so.0   /usr/lib/libvirt.so
7 [) e1 o, i( ~windows 环境# C8 O: A4 Z$ O2 E2 f) [
     将libvirt-0.dll改名为virt.dll
+ z' i& K# `' C  " M( p$ A5 E1 P. }
# virsh undefine vm1354695894990- }* V; V$ Z4 u/ Q, P7 O0 p& J
error: Refusing to undefine while domain managed save image exists
9 w9 e9 P% a5 x4 v/ D
- a* F1 Y, n0 ]: ]! k  Ihttp://www.redhat.com/archives/l ... -July/msg01219.html
6 I; y3 k# Z2 y
6 y9 ?6 w- J# O2 e' Q* L$ p managedsave1 b5 X( u* a, J# z& d& O2 k

, Z" g; p! ~$ J1 N解决办法:virsh undefine $domain  --managed-save$ \" K! x. g* y. A
 - T4 d  R3 D0 F- O0 ~- L( \
在centos下面Define虚拟机时,确实没有/usr/bin/kvm,加软链接. _. w8 Q& z7 U: D) W" v8 g) B9 q
error: Failed to define domain from xxx.xml- q& B4 p1 P! l
error: Cannot find QEMU binary /usr/bin/kvm: No such file or directory3 D+ m; H* D' F+ Q: k+ ~9 I+ X" v

0 K5 d: A% O( Z6 m* t1 k解决办法:ln -s /usr/libexec/qemu-kvm /usr/bin/kvm
9 Y  X3 F$ t8 ]0 O# ?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-12 02:27 , Processed in 0.019012 second(s), 23 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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