易陆发现互联网技术论坛

 找回密码
 开始注册
查看: 6028|回复: 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'9 Q6 q, {: o  c6 D! @  ?, O
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host Traceback (most recent call last):
+ }0 q7 N  e- I& y# e2018-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% J6 a8 J9 d: R1 z5 s3 }2 A+ O$ P
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     handler()& o; E6 F3 ]6 r
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
- a7 c% h+ }; E( @8 j2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     return self._conn_event_handler(*args, **kwargs)
4 u3 S/ N% S, W" t' N5 T! m2018-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_event1 B; ?$ d5 v& u( J# V+ B( X
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     self._set_host_enabled(enabled, reason)
' Y' l$ i  L7 }' d+ D0 x* E9 M2018-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_enabled9 y, d2 @- n; M! R
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     mount.get_manager().host_up(self._host). ^" }; B( r) s1 j7 Y) H$ z
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: z, h$ a3 U  W' @
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     self.state = _HostMountState(host, self.generation)( X. F' n+ Q0 [: C9 S0 s0 X
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__* u& c' T( g; G  i
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     mountpoint = os.path.dirname(disk.source_path)/ v! A5 N. [! l  F5 \7 ]- r- D
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host   File "/usr/lib64/python2.7/posixpath.py", line 129, in dirname1 X; T. W# Q5 L( H
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     i = p.rfind('/') + 1
) ?- }9 ^- N) U) Z2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host AttributeError: 'NoneType' object has no attribute 'rfind'( S0 ~- l, b/ N
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host : d( }5 x2 D6 U3 @! K, r
2018-12-02 00:00:33.488 23735 INFO nova.virt.libvirt.host [-] Libvirt host capabilities <capabilities>
& W& o9 P+ l( g- @
 楼主| 发表于 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'
% @/ `0 X0 G4 g- }  ]4 s) k2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host Traceback (most recent call last):
! d* R0 A& c" K. |% p2 y2018-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; x0 \. x7 ^$ k9 _& W( P: c* E1 b
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     handler()( J# O: M* b. H4 G1 N9 h
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; z% |5 u" X* f5 Z
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     return self._conn_event_handler(*args, **kwargs)" g; R, N/ O0 @4 ~0 S# _' A; B
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' E$ e, e! ^/ c0 w! H8 P& r
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     self._set_host_enabled(enabled, reason)+ F) Z  D& ]: q7 D% C5 B& F& t, j% P
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
, X2 R# v$ P5 T; ~' E" v2 z( C2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     mount.get_manager().host_up(self._host)( ]; f7 n& R0 x% y: d
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
% D1 {9 {/ I% L2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     self.state = _HostMountState(host, self.generation), f) S+ a$ P9 [! Z% j, t& i
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__
* P! A0 I7 J' I2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     mountpoint = os.path.dirname(disk.source_path), g" j& q9 K) X* }! k
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host   File "/usr/lib64/python2.7/posixpath.py", line 129, in dirname
  l. ^* n: f, u& M& _7 @+ b$ q2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     i = p.rfind('/') + 1; n" i! z/ Z4 N
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host AttributeError: 'NoneType' object has no attribute 'rfind'4 V' a+ V$ F; N  c6 W
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host
 楼主| 发表于 2018-12-8 17:56:58 | 显示全部楼层
virsh start vm1368544020451:
) J3 W% T+ H9 Z9 E; b1 A
- a* s- o3 C# R7 l; I' p error: Failed to start domain vm1368544020451  T$ ]2 R7 H9 V5 N2 C; E% Y

7 G/ m% _7 ]0 O# [' J; Aerror: 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
2 P! ~( b# i8 P
. I% w  a2 d# Z3 J镜像格式错误,用qemu-img info 检查镜像和xml配置文件中指定的type是否一致。
6 G9 m1 |; ]7 r! u$ M) q$ ]- M# n+ O7 J* P6 `! z0 p
& j- C( l/ H# G; u2 _
error: Failed to start domain vm0- S3 }" W, m) Q: U. ~' ?
7 }0 R& r+ R7 }  K$ |/ E
error: internal error process exited while connecting to monitor: Could not access KVM kernel module: No such file or directory
/ h+ `. \3 K- @% m  ~, S: \1 lfailed to initialize KVM: No such file or directory
8 m9 g" Q/ k% Z! G# j% Z) l1 n. FNo accelerator found!1 Y( g. t0 V8 K* e4 D0 [& H& u
上面的提示信息就是因为QEMU在初始化阶段因为无法找到kvm内核模块。  v2 C: Z8 }* T# Q7 d

' H2 u& M, q9 g* R+ Z5 M3 dsudo modprobe kvm   #载入指定的模块
- w) z, f  T9 L3 \6 f$ w' u
: ^! n+ X* ^( H, u重启电脑,进入bios界面,设置advance选项里面的virtualization标签为Enabled
' {+ ?, f8 u1 \' Q( f, N9 z7 v/ X$ T* M% j7 J, e) N$ U, x0 M
通过命令 lsmod | grep kvm    #显示已载入的模块
. D$ e# e& y) I& R1 h+ `, p: _* t4 }
 虚拟机迁移:
$ K5 B0 `& u8 `9 S4 Q  `0 K' l  l4 D
# virsh migrate --live 1 qemu+tcp://192.168.0.121 --p2p --tunnelled --unsafe ; p) C2 I5 X9 a1 J% ]+ L. O
error: operation failed: Failed to connect to remote libvirt URI qemu+tcp://192.168.0.121(在URI后面加上/system,‘system’相当于root用户的访问权限)# H2 A2 `* {) g8 z) I8 z" m

: c3 C) L# z, W+ y3 S- w1 {#virsh migrate --live 2 qemu+tcp://192.168.0.121/system --p2p --tunnelled+ V" B" X$ P5 X/ a3 C
 error: Unsafe migration: Migration may lead to data corruption if disks use cache != none(加上--unsafe参数): W- X- m2 R4 M  U8 Q

& O  W" I& ~  }; `0 \" P5 a$ s6 e#virsh migrate --live 2 qemu+tcp://192.168.0.121/system --p2p --tunnelled --unsafe 
* u; b1 J% T. I: p% O4 }- Rerror: Timed out during operation: cannot acquire state change lock (启动虚拟机有时也会遇此错误),需要重启libvirtd进程% j% S& |" f! P% ]& z" v

- G  q/ a- ?( n' A6 c$ Yvirsh:- M" z' f# l" t6 y' Y
! u: U# x3 L9 t+ P
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Connection refused(libvirtd 进程没有启动,libvirtd是一个监听客户端请求的进程)3 S$ k1 c5 V. j. K

: d! k/ p1 Y9 f: o# u1 M- n( R3 ?$ virsh -c qemu:///system list: G6 s/ B6 X0 u. L3 {5 U; [7 z
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied
9 }5 e" B( B) |( ~5 K$ {# Jerror: failed to connect to the hypervisor+ [4 H) [: |+ [1 `! b, g2 `7 f

8 _% o/ k: l3 V5 z, x(当前用户没有权限,修改/etc/libvirt/libvirtd.conf,unix_sock_rw_perms = 0777,使所有用户都有权限读写)
2 N3 ~& c; W" G9 S7 t4 Y3 J0 g0 K
! [8 T1 E! l8 G$ v启动libvirtd进程出错:
0 i, I' d7 V+ x9 E# @: o* n
0 B. r' |% ?! _# v /usr/local/sbin/libvirtd -d -l --config /usr/local/etc/libvirt/libvirtd.conf (编译安装的启动方式)8 M$ h$ A% H$ x6 [
error:/usr/local/sbin/libvirtd: initialization failed7 v4 j# J! [' W5 Y4 m) U# n

% P0 A& M( k! w4 d# Vtry to install libpcap-devel RPM and rebuild libvirt  http://comments.gmane.org/gmane.comp.emulators.libvirt/58218% S6 D  W2 M, `$ }# b
2 }* a0 e' k3 @; |1 C% C
apt-get install libpcap-dev
4 ]/ L8 _. E/ S; Q, e! ?+ s5 s) y: P
上面的方法好像都没有效果,但是尝试了http://wiki.libvirt.org/page/The_daemon_cannot_be_started说的,把配置文件里的- S6 @) u' Z. }$ W3 T# b
/ |9 T: v* V0 {) b. M% a$ N% Z. j
listen_tls = 0注释取消(更奇怪的问题,在我的客户端链接不对)/ d" ^( z& z- S) d9 ~0 \
8 k) P9 v' ^: t5 r# G
启动虚拟机:Connection reset by peer6 ?; `' ^! a3 G4 G6 y5 d8 w2 @- T
1 \  ^8 R: X. X! A" h8 V1 x, S
virsh start vm1355991767186. r! K: J1 B# R  A4 @3 m
error: Failed to start domain vm1355991767186
, f% Z% ?: y( {+ m  {9 D9 Xerror: Unable to read from monitor: Connection reset by peer7 r) {& ?" Q$ p4 y9 T
: \- l1 h' x( G3 {, q
 还有可能是这样提示:
4 V* Y: {: A4 V0 L1 w0 A3 R' S- H
error: internal error process exited while connecting to monitor: Failed to allocate 16332619776 B: Cannot allocate memory
& D9 v2 b  G  v% `+ \, u: d' ?( a( I: C$ E0 B1 j/ I
这个问题可能是因为为VM分配的内存过大(甚至超过的物理主机的内存大小)
- ?+ z' p. i' ^" r2 W2 i; T. @& H  A8 _
Unable to load library 'virt': libvirt.so: cannot open shared object file: No such file or directory
7 t$ O# ~) ]! U/ N' Y" @- i+ p
) x# w3 f7 X, }5 X5 X2 w5 K) Elinux 环境:; T6 j8 m* }/ k; M5 e- ]
     ln -s /usr/lib/libvirt.so.0   /usr/lib/libvirt.so
! V% N8 A6 P/ d( y9 k1 C9 ?/ ?windows 环境
6 z' T% @- ]0 \- ~     将libvirt-0.dll改名为virt.dll
" P+ j+ x+ z% U# f: H) f$ p  
& H: R1 p5 V8 R) I% a* B. d! C/ z# virsh undefine vm13546958949909 _5 Y8 \% x0 n) z0 J& }
error: Refusing to undefine while domain managed save image exists5 c8 X" `- ]0 g6 f6 P3 z' v9 ~
  S% T9 ^, w+ }1 [8 j2 W! }" J
http://www.redhat.com/archives/l ... -July/msg01219.html
2 Z( M0 ^( e' e3 L
: U& _2 d! R( H0 E, S managedsave- U/ w" e7 ]7 G# z3 V* Q
1 Q3 u$ w5 J4 k" a
解决办法:virsh undefine $domain  --managed-save
# L" }. a$ I5 T$ g( q: N 
4 x/ T8 O) H  ~/ f- v在centos下面Define虚拟机时,确实没有/usr/bin/kvm,加软链接
6 U- z9 _' e7 q9 W. Perror: Failed to define domain from xxx.xml2 s  o/ @' `3 b: ~' `* ?- |1 l! q
error: Cannot find QEMU binary /usr/bin/kvm: No such file or directory
6 E2 {( T$ I* T: Q# I+ F" G5 W* r- d" D3 g5 o* f
解决办法:ln -s /usr/libexec/qemu-kvm /usr/bin/kvm0 ?, [. u" \- ]  q  _
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

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

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

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

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

Powered by Discuz! X3.4 Licensed

© 2012-2025 Discuz! Team.

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