今天部署了一套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. loadrunner 如何做关联

    在页面中为了防止CRSF攻击,每次访问登录页面时,在浏览器器端生成一个token. 在提交时检验这个token是否有效,提交后token自动失效.   如果使用loadrunner来测试此系统话需要做 ...

  2. Linux系统中的日常监控知识点

    1.命令熟悉之w [xiongchao@oc3006745124 Desktop]$ w :: up :, users, load average: 1.48, 1.19, 1.11 USER TTY ...

  3. 学习shell之前你不得不了解的小知识

    1.!!命令                   # 表示上一条输出history |grep 23         #表示历史记录中的第23条!vim                     #上一 ...

  4. spring mvc如何获取问号后的url参数

    @RequestMapping(method=RequestMethod.GET) public ModelAndView allUsers(@RequestParam int page){ Mode ...

  5. [Jquery]网页定位导航特效

    描述:左右联动的导航,非常适合展示页面内容多,区块划分又很明显的,点击右边固定导航项时,左边的内容跟着切换.滑动滚动条的时候,右边的导航也随着左边的展示而进行高亮切换. 思路:比较滚动距离和楼层距离( ...

  6. 四个使用this的典型应用

    (1)在html元素事件属性中使用,如 <input type=”button” onclick=”showInfo(this);” value=”点击一下”/> (2)构造函数 func ...

  7. hihocoder 1138 Islands Travel dijkstra+heap 难度:2

    http://hihocoder.com/problemset/problem/1138 很久不用最短路,几乎连基本性质也忘了,结果这道题就是某些最短路算法空间复杂度是o(n) 这里总结四种算法 算法 ...

  8. 有关嵌入式linux的注意点总结

    知识收集和个人学习过程遇到的问题. 仅供参考. 1.sudo apt-get update 一直无法更新 一,查看网络是否连接上 有几种网络连接方式.常用的两种有网桥网络(Bridged)和网络地址翻 ...

  9. JDBC Thin Driver 的formats三种格式

    格式一:  Oracle JDBC Thin using a ServiceName: jdbc:oracle:thin:@//<host>:<port>/<servic ...

  10. 在VS2010中打开VS2012的项目

    修改工程文件来把VS2012的工程文件移植到VS2010中 首先是修改解决方案文件(.sln文件). 使用记事本打开,把里面的 Microsoft Visual Studio Solution Fil ...