易陆发现互联网技术论坛

 找回密码
 开始注册
查看: 6033|回复: 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'% Q- c! C; J# i( X. P7 a4 q0 H# c
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host Traceback (most recent call last):
; E! |  p( A3 k' B: r; u2018-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! v" j2 ?6 B7 }; Y9 v
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     handler()  W7 K$ A( \) {& {1 w3 ~7 W2 g
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% e" X, a) E$ h( Y) |3 E! x  e3 q; B
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     return self._conn_event_handler(*args, **kwargs)7 g, u' U5 H5 S3 l) `0 X; \/ G' F, 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$ P8 d0 Z/ r6 a" z  ]( v* Q
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     self._set_host_enabled(enabled, reason)' Y9 X4 z7 [2 ^: S% O
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_enabled4 l& o; ]6 y: t9 _, H" W
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     mount.get_manager().host_up(self._host)
( ?0 Y  _/ T( K/ y2018-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
* {* J3 x2 o3 M2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     self.state = _HostMountState(host, self.generation)+ \# o& c! I: _/ C. c: s2 e
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__
( V+ H6 m! c2 I% m: q2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     mountpoint = os.path.dirname(disk.source_path)
! N/ a6 L3 N& ?% a9 t( N9 m2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host   File "/usr/lib64/python2.7/posixpath.py", line 129, in dirname: O, B1 O! t# {' ?# X  ?
2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host     i = p.rfind('/') + 1
/ ~+ V" B/ e/ K- P, C* F2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host AttributeError: 'NoneType' object has no attribute 'rfind'
. P0 {' W& @+ o" p% `* x" G2 k2018-12-02 00:00:33.486 23735 ERROR nova.virt.libvirt.host 6 m2 r# t) S' I0 n5 }: c$ z* J
2018-12-02 00:00:33.488 23735 INFO nova.virt.libvirt.host [-] Libvirt host capabilities <capabilities>" x, s7 U5 S4 {! E* G* M- ~1 }1 B7 {
 楼主| 发表于 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 c9 ~. h# e) L- k/ g( l
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host Traceback (most recent call last):0 S! o& D3 T! ]
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+ ]5 l0 ~4 x  k8 T
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     handler()* e' ?; ]; {" W8 Z. 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
' x  A8 B* t4 B8 e2 p6 z$ e2 N2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     return self._conn_event_handler(*args, **kwargs)
6 ^+ `. Y7 d. Q5 u2 I2018-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_event3 W9 t! z" Y% l
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     self._set_host_enabled(enabled, reason)3 _% S0 a7 W$ I1 s' L; 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 3812, in _set_host_enabled* B) d) A- s, s% i3 p
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     mount.get_manager().host_up(self._host); Y: E1 j1 ^6 J4 R; g& }6 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
: k7 C1 w4 }. X- |9 a2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     self.state = _HostMountState(host, self.generation)# d$ v: a4 l7 i6 n1 F
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__) }, Q3 S+ ]9 ^
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     mountpoint = os.path.dirname(disk.source_path)
! ]; e# _! \! t2 F) W2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host   File "/usr/lib64/python2.7/posixpath.py", line 129, in dirname
) W8 S; |' R: C( `8 o; M2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host     i = p.rfind('/') + 1, I& i4 V6 j/ A* A& w' z
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host AttributeError: 'NoneType' object has no attribute 'rfind'% P7 z0 r, h5 i( v6 q
2018-12-02 00:07:50.443 25041 ERROR nova.virt.libvirt.host
 楼主| 发表于 2018-12-8 17:56:58 | 显示全部楼层
virsh start vm1368544020451:" k8 S; e# @8 C& C( ^4 _

& E' U" _& Z) x6 l6 c" }9 R error: Failed to start domain vm1368544020451# j! M5 p  W2 e/ q/ ]' m

+ V& _6 Q0 q$ p+ U1 \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
' L, x8 }6 p5 f6 w# ?( y! `' Y
8 c4 O/ o- C! X" c/ I镜像格式错误,用qemu-img info 检查镜像和xml配置文件中指定的type是否一致。  {2 @6 U$ n- Q) S3 P4 g+ s

2 r0 X' ^4 R1 ?6 T# @, h# J/ x- d. R0 w( _+ t1 {' c# S; d3 n
error: Failed to start domain vm0
) J2 u' x2 H0 U8 X1 |0 Z2 w/ }/ Z, Z+ Z
error: internal error process exited while connecting to monitor: Could not access KVM kernel module: No such file or directory
0 e, H4 t! @' `2 J+ c' F* `failed to initialize KVM: No such file or directory
& d; \* _3 p/ _  p1 C3 Y" kNo accelerator found!
( l% d% D6 A7 ~0 L% C/ o+ n上面的提示信息就是因为QEMU在初始化阶段因为无法找到kvm内核模块。
, c( J1 T# G8 D4 i  X6 R5 P$ N
" @1 |- s8 R1 s7 @sudo modprobe kvm   #载入指定的模块2 ?+ L8 t( f: _% n' z
4 ^/ d9 H0 G+ F, |  O
重启电脑,进入bios界面,设置advance选项里面的virtualization标签为Enabled
' [; Z2 ]# m6 S7 B$ w3 D1 c7 p- f2 h. }" F# f" l3 C
通过命令 lsmod | grep kvm    #显示已载入的模块
0 v9 D0 ?6 _: W* A4 q
; T! u. v! c! c5 v4 T. J 虚拟机迁移:
' p# U6 N% r5 j+ H0 h# I' w: m& j4 K& D
# virsh migrate --live 1 qemu+tcp://192.168.0.121 --p2p --tunnelled --unsafe 
9 w+ e! J! E' r! ~# v8 Werror: operation failed: Failed to connect to remote libvirt URI qemu+tcp://192.168.0.121(在URI后面加上/system,‘system’相当于root用户的访问权限)
% z# y+ a( ~8 G* p' F
5 j8 I/ ?* c# \9 d# b0 a6 X#virsh migrate --live 2 qemu+tcp://192.168.0.121/system --p2p --tunnelled  H( y+ w% F/ Q2 I0 h
 error: Unsafe migration: Migration may lead to data corruption if disks use cache != none(加上--unsafe参数)5 {& b# W8 t8 H: m

7 r% l  o0 \( f! V. w! [2 y- z#virsh migrate --live 2 qemu+tcp://192.168.0.121/system --p2p --tunnelled --unsafe 6 o6 `- ]" {  z; W
error: Timed out during operation: cannot acquire state change lock (启动虚拟机有时也会遇此错误),需要重启libvirtd进程
) p2 z5 o# l  g6 Y. N& f7 z" }- A8 s. L+ _4 J6 |
virsh:
- u+ o$ ^2 F0 Q0 L  M+ C+ m/ L9 I0 m) W; q4 `! W+ e
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Connection refused(libvirtd 进程没有启动,libvirtd是一个监听客户端请求的进程)1 F% |& j' ]# P$ v2 B1 b8 P
% {7 t( W6 J! t% V6 a6 t
$ virsh -c qemu:///system list$ l7 k; h2 V. D
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied
, [0 P7 b1 s# g7 V4 X6 [" cerror: failed to connect to the hypervisor
# O8 s  L9 I6 _* c7 B' y
' G2 L  S5 R' @1 P( u( E(当前用户没有权限,修改/etc/libvirt/libvirtd.conf,unix_sock_rw_perms = 0777,使所有用户都有权限读写)( V9 S& g# A" u0 z4 c
( Z/ N' \3 F8 e$ p  T2 u' C
启动libvirtd进程出错:
1 a5 j4 m( ?/ {& |( P  H$ D
9 U& ?  Y# [& B* u/ E) ` /usr/local/sbin/libvirtd -d -l --config /usr/local/etc/libvirt/libvirtd.conf (编译安装的启动方式)' I* |! Z* u$ ?
error:/usr/local/sbin/libvirtd: initialization failed
1 L) I3 T# C, r& f' }$ C' a- l
& X/ s" [' d# x' {try to install libpcap-devel RPM and rebuild libvirt  http://comments.gmane.org/gmane.comp.emulators.libvirt/58218
6 w3 R6 J$ N  G2 L  [0 [- r* v  K: L" ?4 [. H  H  d/ }& l
apt-get install libpcap-dev
2 p7 j, k7 K2 C2 k& F1 B6 W5 F. c/ ^! ]  @
上面的方法好像都没有效果,但是尝试了http://wiki.libvirt.org/page/The_daemon_cannot_be_started说的,把配置文件里的
) ?* F1 y, U1 x( i, N8 G" O: [0 k8 N7 e# V( C# j
listen_tls = 0注释取消(更奇怪的问题,在我的客户端链接不对)5 K) b6 ]; `* @

7 B# b8 R; b# m% f3 j启动虚拟机:Connection reset by peer4 U+ c: q9 V2 }- C0 b' I& z
/ N$ J6 \4 m: N% B( Z" Q
virsh start vm13559917671869 `8 ]9 c* p4 ?$ w
error: Failed to start domain vm1355991767186
/ M; K" X* n$ c' B; R  xerror: Unable to read from monitor: Connection reset by peer  J/ G7 Y: @  O- q( }
% H/ L! _" v0 M% N& F) K
 还有可能是这样提示:" R( y3 |! |$ R$ o! \8 {& N/ @/ K
, \: H. G  u5 I7 F# D+ A9 D  h2 {
error: internal error process exited while connecting to monitor: Failed to allocate 16332619776 B: Cannot allocate memory
& B, W5 h2 ~! U5 \! D/ J  l7 Q( [4 V( i) A+ g
这个问题可能是因为为VM分配的内存过大(甚至超过的物理主机的内存大小)
$ a  t' `( j1 z0 F6 C
; @9 @! }6 ?% B  d- p/ ^; nUnable to load library 'virt': libvirt.so: cannot open shared object file: No such file or directory
: ~* V3 ^! Y8 s+ m: O5 \, e2 ^  Q; A7 }) D
linux 环境:! j8 `# p* Z; a: M; E$ J% h: `: y8 [
     ln -s /usr/lib/libvirt.so.0   /usr/lib/libvirt.so) ?2 _7 Q+ |  Q( t, t
windows 环境
  J& J2 C9 {( s4 c     将libvirt-0.dll改名为virt.dll# ~. u# x3 E/ u+ z& o
  
: f: P) }, Z: r' R( _6 k) n# virsh undefine vm1354695894990
2 Y: }  {: y) u! t5 h) [error: Refusing to undefine while domain managed save image exists; g$ L0 O8 h, K% V( \8 q
* k; b$ _8 x' V' V
http://www.redhat.com/archives/l ... -July/msg01219.html6 B6 [2 {' G! a, N& s" E

. Q. d" X+ Z9 B managedsave4 ~: O, {7 ~: Y( g0 d
* ~1 H1 X2 _% p) `' H
解决办法:virsh undefine $domain  --managed-save$ }% s5 Y- Q! \( k) m
 ' f- ]0 A* q" V3 d) T
在centos下面Define虚拟机时,确实没有/usr/bin/kvm,加软链接% v0 x9 k4 a# u- a' D
error: Failed to define domain from xxx.xml
' S: w. r) Q$ i8 k  uerror: Cannot find QEMU binary /usr/bin/kvm: No such file or directory
; J. f7 {2 r( N9 k: }# F0 }( X5 L' _- `) ?# W& {
解决办法:ln -s /usr/libexec/qemu-kvm /usr/bin/kvm
5 Z% w! k  v7 H' V( }3 q7 _
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

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

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

QQ|返回首页|Archiver|小黑屋|易陆发现技术论坛 点击这里给我发消息

GMT+8, 2026-4-8 15:26 , Processed in 0.040239 second(s), 22 queries .

Powered by Discuz! X3.4 Licensed

© 2012-2025 Discuz! Team.

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