libvirtError: no connection driver available for qemu:///system 解决办法

今天部署了一套K版的OpenStack环境后,启动nova-compute后,日志里狂报如下错误(因为其内部有定时任务需要去连libvirtd进程):

2015-08-14 10:01:00.061 28580 TRACE nova.virt.libvirt.host   File "/usr/lib64/python2.7/site-packages/libvirt.py", line 105, in openAuth
2015-08-14 10:01:00.061 28580 TRACE nova.virt.libvirt.host     if ret is None:raise libvirtError(‘virConnectOpenAuth() failed‘)
2015-08-14 10:01:00.061 28580 TRACE nova.virt.libvirt.host libvirtError: no connection driver available for qemu:///system

刚开始看到这个错误,首先第一反应是不是 libvirtd 进程没有启起来,于是 ps 查看确定下,发现已经启动起来了:

[[email protected] ~]# ps aux | grep libvirtd
root      2648  0.0  0.0 112640   980 pts/1    S+   10:34   0:00 grep --color=auto libvirtd
root     31850  0.1  0.0 1053776 7264 ?        Ssl  10:17   0:01 /usr/sbin/libvirtd --listen

后来,尝试直接执行下 virsh list 命令,同样得到如下错误:

[[email protected] ~]# virsh list
error: failed to connect to the hypervisor
error: no valid connection
error: no connection driver available for <null>
error: Failed to reconnect to the hypervisor

然后在想是不是URI不对,于是我指定URI再次尝试执行命令,同样返回错误:

[[email protected] ~]# virsh -c qemu:///system list
error: failed to connect to the hypervisor
error: no connection driver available for qemu:///system

为保持每次使用的URI都正确,后来我将 /etc/libvirt/libvirt.conf 配置文件里的 uri_default 直接设置为 qemu:///system:

[[email protected] ~]# cat /etc/libvirt/libvirt.conf
#
# This can be used to setup URI aliases for frequently
# used connection URIs. Aliases may contain only the
# characters  a-Z, 0-9, _, -.
#
# Following the ‘=‘ may be any valid libvirt connection
# URI, including arbitrary parameters

#uri_aliases = [
#  "hail=qemu+ssh://[email protected]/system",
#  "sleet=qemu+ssh://[email protected]/system",
#]

#
# This can be used to prevent probing of the hypervisor
# driver when no URI is supplied by the application.

uri_default = "qemu:///system"

然后重启 libvirtd 进程,通过 systemctl 命令查看下 libvirtd 进程的状态,发现有如下3个错误:

[[email protected] ~]# systemctl status libvirtd
libvirtd.service - Virtualization daemon
   Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled)
   Active: active (running) since Fri 2015-08-14 10:11:13 CST; 4s ago
     Docs: man:libvirtd(8)
           http://libvirt.org
 Main PID: 30568 (libvirtd)
   CGroup: /system.slice/libvirtd.service
           └─30568 /usr/sbin/libvirtd --listen

Aug 14 10:11:13 localhost.localdomain libvirtd[30568]: libvirt version: 1.2.8, package: 16.el7_1.3 (CentOS BuildSystem <http://bugs.centos.org>, 2015-05-12-20:12:58, worker1.bsys.centos.org)
Aug 14 10:11:13 localhost.localdomain libvirtd[30568]: failed to load module /usr/lib64/libvirt/connection-driver/libvirt_driver_storage.so /usr/lib64/libvirt/connection-driver/...e reference
Aug 14 10:11:13 localhost.localdomain libvirtd[30568]: failed to load module /usr/lib64/libvirt/connection-driver/libvirt_driver_qemu.so /usr/lib64/libvirt/connection-driver/lib...eFileCreate
Aug 14 10:11:13 localhost.localdomain libvirtd[30568]: Module /usr/lib64/libvirt/connection-driver/libvirt_driver_lxc.so not accessible
Aug 14 10:11:13 localhost.localdomain systemd[1]: Started Virtualization daemon.
Hint: Some lines were ellipsized, use -l to show in full.

从上面错误来看,两个错误是由于libvirt_driver_storage.so、libvirt_driver_qemu.so加载失败,一个错误是由于没有libvirt_driver_lxc.so module。

于是查看下目录 /usr/lib64/libvirt/connection-driver/ 看看是否都有上面三个module:

[[email protected] ~]# ll /usr/lib64/libvirt/connection-driver/
total 1996
-rwxr-xr-x 1 root root  107440 May 13 04:16 libvirt_driver_interface.so
-rwxr-xr-x 1 root root  148600 May 13 04:16 libvirt_driver_network.so
-rwxr-xr-x 1 root root  107144 May 13 04:16 libvirt_driver_nodedev.so
-rwxr-xr-x 1 root root  165688 May 13 04:16 libvirt_driver_nwfilter.so
-rwxr-xr-x 1 root root 1175776 May 13 04:16 libvirt_driver_qemu.so
-rwxr-xr-x 1 root root   86448 May 13 04:16 libvirt_driver_secret.so
-rwxr-xr-x 1 root root  233448 May 13 04:16 libvirt_driver_storage.so

发现libvirt_driver_storage.so、libvirt_driver_qemu.so存在,而libvirt_driver_lxc.so确实不存在。

对于 libvirt_driver_lxc.so不存在 的情况,应该是相应的rpm包没有安装,我们只需要安装下即可:

[[email protected] ~]# yum install libvirt-daemon-lxc

安装完后,再次通过 systemctl 查看下 libvirtd 进程的状态,剩下两个错误还是没有得到解决:

[[email protected] ~]# systemctl status libvirtd
libvirtd.service - Virtualization daemon
   Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled)
   Active: active (running) since Fri 2015-08-14 10:14:23 CST; 3s ago
     Docs: man:libvirtd(8)
           http://libvirt.org
 Main PID: 31204 (libvirtd)
   CGroup: /system.slice/libvirtd.service
           └─31204 /usr/sbin/libvirtd --listen

Aug 14 10:14:22 localhost.localdomain libvirtd[31204]: libvirt version: 1.2.8, package: 16.el7_1.3 (CentOS BuildSystem <http://bugs.centos.org>, 2015-05-12-20:12:58, worker1.bsys.centos.org)
Aug 14 10:14:22 localhost.localdomain libvirtd[31204]: failed to load module /usr/lib64/libvirt/connection-driver/libvirt_driver_storage.so /usr/lib64/libvirt/connection-driver/...e reference
Aug 14 10:14:23 localhost.localdomain libvirtd[31204]: failed to load module /usr/lib64/libvirt/connection-driver/libvirt_driver_qemu.so /usr/lib64/libvirt/connection-driver/lib...eFileCreate
Aug 14 10:14:23 localhost.localdomain systemd[1]: Started Virtualization daemon.
Hint: Some lines were ellipsized, use -l to show in full.

于是查看 /var/log/message 关于libvirtd进程的系统日志,发现错误日志:

Aug 14 10:14:22 localhost journal: failed to load module /usr/lib64/libvirt/connection-driver/libvirt_driver_storage.so /usr/lib64/libvirt/connection-driver/libvirt_driver_storage.so: symbol dm_task_get_info_with_deferred_remove, version Base not defined in file libdevmapper.so.1.02 with link time reference
Aug 14 10:14:23 localhost journal: failed to load module /usr/lib64/libvirt/connection-driver/libvirt_driver_qemu.so /usr/lib64/libvirt/connection-driver/libvirt_driver_qemu.so: undefined symbol: virStorageFileCreate

从上面错误来看,undefined symbol,很明显,是因为driver所需要的引用未定义,于是想应该是 libdevmapper.so.1.02 库太老,与 libvirtd 库不匹配,于是就尝试更新下 device-mapper:

[[email protected] ~]# yum update device-mapper

更新后,重启 libvirtd 进程,再次查看其状态:

[[email protected] ~]# systemctl restart libvirtd
[[email protected] ~]# systemctl status libvirtd
libvirtd.service - Virtualization daemon
   Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled)
   Active: active (running) since Fri 2015-08-14 10:17:20 CST; 2s ago
     Docs: man:libvirtd(8)
           http://libvirt.org
 Main PID: 31850 (libvirtd)
   CGroup: /system.slice/libvirtd.service
           └─31850 /usr/sbin/libvirtd --listen

Aug 14 10:17:20 localhost.localdomain systemd[1]: Started Virtualization daemon.

发现没有问题出现了,尝试执行 virsh list 命令,也OK了:

[[email protected] ~]# virsh list
 Id    Name                           State
----------------------------------------------------

最后,启动openstack-nova-compute,也不再出现最初的错误了。

时间: 2024-10-10 07:48:48

libvirtError: no connection driver available for qemu:///system 解决办法的相关文章

【转】Android出现“Read-only file system”解决办法

原文网址:http://www.111cn.net/sj/android/44496.htm 下面介绍一篇Android出现“Read-only file system”解决办法 有碰到这类问题的朋友可参考参考. Android-出现Read-only file system的解决方法 输入命令:  代码如下 复制代码 mount -o remount rw /system (每次都要执行一次) 有的朋友说是是“/”的问题,命令改为:adb push AlarmClock.apk systema

Android出现“Read-only file system”解决办法

操作设备文件系统上的文件结果遇到"... Read-only file system". 解决办法: 1. 最简单的,adb remount 2. 不行的话,adb shell su之后将文件系统remount为读写权限: mount -o remount rw /system.出于安全考虑,记得完事后remount回只读: mount -o ro,remount /system 3. 和方法2类似,mount -o rw,remount -t ext3 /dev/block/mmcb

【转】Android adb shell操作时出现“ XXX ... Read-only file system”解决办法--不错

原文网址:http://blog.csdn.net/whu_zhangmin/article/details/25364349 手机连接PC后 adb shell su rm -r /system/app/Launcher2.apk 提示:rm failed for /system/app/Launcher2.apk, Read-only file system 解决方法: mount -o remount rw  /system 也就是将/system分区重新挂载为可读写分区 如果操作完后想恢

ssh_exchange_identification: read: Connection reset by peer 报错解决办法

当你登录一台linux机器,登录不了,出现Connection reset by peer 报错,请参照以下解决步骤: 1.ssh -vvv -p22  123.10.98.22 如: localhost:~$ ssh -vvv -p22 123.10.98.22 OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011 debug1: Reading configuration data /etc/ssh_config debug1: /etc/ssh_config

Resource is out of sync with the file system 解决办法

出现提示: 在eclipse中搜索.删除文件时,有时候会弹出错误对话框,错误摘录如下:Resource is out of sync with the file system...... 问题分析: 这个问题是由于eclipse中文件不同步引起的.在eclipse中,工程文件是由eclipse自动扫描添加的,如果在外部修改了工程目录中的文件但又关闭了自动刷新功能,则会引起文件不同步, 从而搜索或删除文件时出现Resource is out of sync with the file system

oracle启动报错ORA-00845: MEMORY_TARGET not supported on this system解决办法

oracle启动报错ORA-00845: MEMORY_TARGET not supported on this system 原因可能:ORACLE MEMORY_TARGET参数设置超过了oracle服务器本身内存.或超过了现在服务器空闲内存(就是oracle启动时无法获取设置的内存) eg: oracle version:11gR2 OS version:RedHat 6.4企业版 服务器:虚拟机 分析步骤: 1.查看当前 MEMORY_TARGET参数的值为*.memory_target

yii框架:CDbConnection failed to open the DB connection: could not find driver的解决办法

这个问题是因为php中缺少pdo mysql造成的.解决方法是为php添加此扩展.前往你最早的php安装文件,进入ext/pdo_mysql/目录下,然后./configure --with-php-config=/home/work/service/php_for_apache2/bin/php-config --with-pdo-mysql=/home/work/service/mysql 然后make make install,然后屏幕上会提示pdo库安装到的路径,把此路径记下来然后添加到

com.rabbitmq.client.impl.ForgivingExceptionHandler.log:119 -An unexpected connection driver error occured

在服务器上安装了一个RabbitMq,并新创建了一个用户授予了管理员角色,登录控制台查看一切正常,兴高采烈启动项目进行连接,结果一盆冷水下来,报如下错误: o.s.a.r.l.SimpleMessageListenerContainer : Failed to check/redeclare auto-delete queue(s). org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connect

MySQL 警告WARN: Establishing SSL connection without server&#39;s identity verification is not recommended.解决办法

Success loading Mysql Driver!Mon Apr 04 15:43:00 CST 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by d