今天部署了一套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 查看确定下,发现已经启动起来了:

[root@localhost ~]# 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 命令,同样得到如下错误:

[root@localhost ~]# 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再次尝试执行命令,同样返回错误:

[root@localhost ~]# 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:

[root@localhost ~]# 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, -, _, -.
#
# Following the '=' may be any valid libvirt connection
# URI, including arbitrary parameters #uri_aliases = [
# "hail=qemu+ssh://root@hail.cloud.example.com/system",
# "sleet=qemu+ssh://root@sleet.cloud.example.com/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个错误:

[root@localhost ~]# systemctl status libvirtd
libvirtd.service - Virtualization daemon
Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled)
Active: active (running) since Fri -- :: CST; 4s ago
Docs: man:libvirtd()
http://libvirt.org
Main PID: (libvirtd)
CGroup: /system.slice/libvirtd.service
└─ /usr/sbin/libvirtd --listen Aug :: localhost.localdomain libvirtd[]: libvirt version: 1.2., package: .el7_1. (CentOS BuildSystem <http://bugs.centos.org>, 2015-05-12-20:12:58, worker1.bsys.centos.org)
Aug :: localhost.localdomain libvirtd[]: failed to load module /usr/lib64/libvirt/connection-driver/libvirt_driver_storage.so /usr/lib64/libvirt/connection-driver/...e reference
Aug :: localhost.localdomain libvirtd[]: failed to load module /usr/lib64/libvirt/connection-driver/libvirt_driver_qemu.so /usr/lib64/libvirt/connection-driver/lib...eFileCreate
Aug :: localhost.localdomain libvirtd[]: Module /usr/lib64/libvirt/connection-driver/libvirt_driver_lxc.so not accessible
Aug :: localhost.localdomain systemd[]: 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:

[root@localhost ~]# ll /usr/lib64/libvirt/connection-driver/
total
-rwxr-xr-x root root May : libvirt_driver_interface.so
-rwxr-xr-x root root May : libvirt_driver_network.so
-rwxr-xr-x root root May : libvirt_driver_nodedev.so
-rwxr-xr-x root root May : libvirt_driver_nwfilter.so
-rwxr-xr-x root root May : libvirt_driver_qemu.so
-rwxr-xr-x root root May : libvirt_driver_secret.so
-rwxr-xr-x root root May : libvirt_driver_storage.so

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

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

[root@localhost ~]# yum install libvirt-daemon-lxc

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

[root@localhost ~]# systemctl status libvirtd
libvirtd.service - Virtualization daemon
Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled)
Active: active (running) since Fri -- :: CST; 3s ago
Docs: man:libvirtd()
http://libvirt.org
Main PID: (libvirtd)
CGroup: /system.slice/libvirtd.service
└─ /usr/sbin/libvirtd --listen Aug :: localhost.localdomain libvirtd[]: libvirt version: 1.2., package: .el7_1. (CentOS BuildSystem <http://bugs.centos.org>, 2015-05-12-20:12:58, worker1.bsys.centos.org)
Aug :: localhost.localdomain libvirtd[]: failed to load module /usr/lib64/libvirt/connection-driver/libvirt_driver_storage.so /usr/lib64/libvirt/connection-driver/...e reference
Aug :: localhost.localdomain libvirtd[]: failed to load module /usr/lib64/libvirt/connection-driver/libvirt_driver_qemu.so /usr/lib64/libvirt/connection-driver/lib...eFileCreate
Aug :: localhost.localdomain systemd[]: 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:

[root@localhost ~]# yum update device-mapper

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

[root@localhost ~]# systemctl restart libvirtd
[root@localhost ~]# systemctl status libvirtd
libvirtd.service - Virtualization daemon
Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled)
Active: active (running) since Fri -- :: CST; 2s ago
Docs: man:libvirtd()
http://libvirt.org
Main PID: (libvirtd)
CGroup: /system.slice/libvirtd.service
└─ /usr/sbin/libvirtd --listen Aug :: localhost.localdomain systemd[]: Started Virtualization daemon.

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

[root@localhost ~]# virsh list
Id Name State
----------------------------------------------------

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

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

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

    原文网址:http://www.111cn.net/sj/android/44496.htm 下面介绍一篇Android出现“Read-only file system”解决办法 有碰到这类问题的朋友 ...

  2. (转载)Android出现“Read-only file system”解决办法

    下面介绍一篇Android出现“Read-only file system”解决办法 有碰到这类问题的朋友可参考参考.   Android-出现Read-only file system的解决方法 输 ...

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

    原文网址:http://blog.csdn.net/whu_zhangmin/article/details/25364349 手机连接PC后 adb shell su rm -r /system/a ...

  4. Android SDK Manager检查更新时遇到Failed to fetch URL xxxxxxx reason: Connection to xxxxxx的错误的解决办法!

    首先说明的是这个问题并不是每个人都存在,但是我和我的一个同学都有这种情况,所以我同学百度了一下,找出了解决办法. 问题描述: 使用Android SDK Manager检查在线更新,提示以下错误: & ...

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

    操作设备文件系统上的文件结果遇到"... Read-only file system". 解决办法: 1. 最简单的,adb remount 2. 不行的话,adb shell s ...

  6. ORA-00845 MEMORY_TARGET not supported on this system解决办法

    ORA-00845: MEMORY_TARGET not supported on this system报错解决 Oracle 11g数据库修改pfile参数后启动数据库报错ora-00845 SQ ...

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

    在eclipse中,启动server时报此错,是因为文件系统不同步造成的,解决方法有两个: (1)选中工程,右键,选择F5(手动刷新): (2)Window->Preferences->G ...

  8. Powershell cannot be loaded because running scripts is disabled on this system 解决办法

    问题背景 第一次跑ps时,出现了下面的提示.这是因为windows不允许执行脚本而已,不要大惊小怪. 解决办法 这个需要管理员执行,不然会出现以下的情况 正常情况

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

    在服务器上安装了一个RabbitMq,并新创建了一个用户授予了管理员角色,登录控制台查看一切正常,兴高采烈启动项目进行连接,结果一盆冷水下来,报如下错误: o.s.a.r.l.SimpleMessag ...

随机推荐

  1. 学习记录014-ssh批量分发

    一.ssh服务介绍 1.ssh安全的加密协议用于远程连接服务器 2.默认端口是22,安全协议版本ssh2,它能同时支持RSA和DSA秘钥,SSH1只支持RSA 3.服务端主要包含两个服务功能ssh远程 ...

  2. shaerpoint designer 无法创建 visio 2013工作流

    问题描述 当我想创建一个SharePoint 2013 工作流的时候,打开SharePoint 2013 Designer(一下简称SPD),发现没有SharePoint 2013 工作流的选项.原来 ...

  3. bzoj 2428: [HAOI2006]均分数据

    #include<cstdio> #include<iostream> #include<cstdlib> #include<ctime> #inclu ...

  4. C#窗体的加载等待(BackgroundWorker控件)实现

    窗体拉一个Button按钮和一个加载等待显示的label, label默认隐藏,点击按钮时显示这个label,加载完再隐藏 1.工具箱拉BackgroundWorker控件到窗体 2.backgrou ...

  5. Deep Learning In NLP 神经网络与词向量

    0. 词向量是什么 自然语言理解的问题要转化为机器学习的问题,第一步肯定是要找一种方法把这些符号数学化. NLP 中最直观,也是到目前为止最常用的词表示方法是 One-hot Representati ...

  6. dbcp连接池配置参数

    1.<!-- 数据源1 --> 2. <bean id="dataSource" 3. class="org.apache.commons.dbcp.B ...

  7. Xcode6中segue取消原push与modal(deprecated)

    xcode6 之后push 和modal 就被废弃了.只能用于ios8之前.在拖线的时候我们就可以看见. 这两个方法被废弃了,我们需要找到合适的方法来代替,这时候我们发现 show 和Present ...

  8. [网络技术][转]PPTP连接过程

    转自:http://blog.csdn.net/zhu_hit/article/details/5698958 在未来几天会总结一下PPTP的工作过程,分为以下3篇讲述. 1. PPTP连接过程: 2 ...

  9. [网络技术]网关 路由器 OSI

    tracert 1.网关与路由 关键的区别:网关是这样一个网络节点:以两个不同协议搭建的网络可以通过它进行通信.路由器是这样一种设备:它能在计算机网络间收发数据包,同时创建一个覆盖网络(overlay ...

  10. 项目管理软件---redmine安装配置

    redmine是一个开源的项目管理软件,其主页是:http://www.redmine.org redmine是基于Ruby on Rails框架的,跨平台和跨数据库. 安装过程 ========== ...