Openstack Cinder创建卷错误排错过程



由于项目中使用的OpenStack一直停留在F版本,因此在操作系统(Ubuntu 12.04 LTS)不断更新的情况下,难免会出现各种莫名其妙的问题。

安装完Openstack,各子模块均运行正常,开始功能测试,发现cinder创建volume命令发起之后后台报错:

2014-01-04 09:43:10 WARNING cinder.scheduler.manager [req-668ac624-60d5-488c-9e89-5cb915dc6c72 d6c0ca6fec41473f8ac53a8da4c3c38a c804f639bf4c47a29bb9aac195f4744c] Failed to schedule_create_volume: Scheduler Host Filter AvailabilityZoneFilter, CapacityFilter, CapabilitiesFilter could not be found.
2014-01-04 09:43:10 ERROR cinder.openstack.common.rpc.amqp [-] Exception during message handling
2014-01-04 09:43:10 TRACE cinder.openstack.common.rpc.amqp Traceback (most recent call last):
2014-01-04 09:43:10 TRACE cinder.openstack.common.rpc.amqp   File "/opt/stack/cinder/cinder/openstack/common/rpc/amqp.py", line 276, in _process_data
2014-01-04 09:43:10 TRACE cinder.openstack.common.rpc.amqp     rval = self.proxy.dispatch(ctxt, version, method, **args)
2014-01-04 09:43:10 TRACE cinder.openstack.common.rpc.amqp   File "/opt/stack/cinder/cinder/openstack/common/rpc/dispatcher.py", line 145, in dispatch
2014-01-04 09:43:10 TRACE cinder.openstack.common.rpc.amqp     return getattr(proxyobj, method)(ctxt, **kwargs)
2014-01-04 09:43:10 TRACE cinder.openstack.common.rpc.amqp   File "/opt/stack/cinder/cinder/scheduler/manager.py", line 114, in create_volume
2014-01-04 09:43:10 TRACE cinder.openstack.common.rpc.amqp     context, ex, request_spec)
2014-01-04 09:43:10 TRACE cinder.openstack.common.rpc.amqp   File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__
2014-01-04 09:43:10 TRACE cinder.openstack.common.rpc.amqp     self.gen.next()
2014-01-04 09:43:10 TRACE cinder.openstack.common.rpc.amqp   File "/opt/stack/cinder/cinder/scheduler/manager.py", line 103, in create_volume
2014-01-04 09:43:10 TRACE cinder.openstack.common.rpc.amqp     filter_properties)
2014-01-04 09:43:10 TRACE cinder.openstack.common.rpc.amqp   File "/opt/stack/cinder/cinder/scheduler/filter_scheduler.py", line 66, in schedule_create_volume
2014-01-04 09:43:10 TRACE cinder.openstack.common.rpc.amqp     filter_properties)
2014-01-04 09:43:10 TRACE cinder.openstack.common.rpc.amqp   File "/opt/stack/cinder/cinder/scheduler/filter_scheduler.py", line 118, in _schedule
2014-01-04 09:43:10 TRACE cinder.openstack.common.rpc.amqp     filter_properties)
2014-01-04 09:43:10 TRACE cinder.openstack.common.rpc.amqp   File "/opt/stack/cinder/cinder/scheduler/host_manager.py", line 218, in get_filtered_hosts
2014-01-04 09:43:10 TRACE cinder.openstack.common.rpc.amqp     filter_classes = self._choose_host_filters(filter_class_names)
2014-01-04 09:43:10 TRACE cinder.openstack.common.rpc.amqp   File "/opt/stack/cinder/cinder/scheduler/host_manager.py", line 185, in _choose_host_filters
2014-01-04 09:43:10 TRACE cinder.openstack.common.rpc.amqp     raise exception.SchedulerHostFilterNotFound(filter_name=msg)
2014-01-04 09:43:10 TRACE cinder.openstack.common.rpc.amqp SchedulerHostFilterNotFound: Scheduler Host Filter AvailabilityZoneFilter, CapacityFilter, CapabilitiesFilter could not be found.

Google到的结果大多是G版本更新带入的Bug,并且已经解决:https://bugs.launchpad.net/ubuntu/+source/cinder/+bug/1126378

不过由于项目无法直接更新G版本Openstack代码,所以只能另找其他解决方法。首先排除代码近期被修改的可能。此功能在上线运行的环境中运行正常,并且同事近期的部署也未见异常,联想到出问题的环境我用了 Ubuntu-12.04.2-LTS这个OS版本进行安装,而生产环境和其他同事的部署都在Ubuntu-12.04.1-LTS进行,所以感觉问题应该出现在cinder模块依赖上。

查看cinder所需的依赖列表:

root@controller:/opt# cat $opestack_home/cinder/tools/pip-requires 
amqplib==0.6.1
anyjson>=0.2.4
eventlet>=0.9.17
kombu==1.0.4
lockfile==0.8
lxml>=2.3
routes==1.12.3
WebOb==1.0.8
wsgiref==0.1.2
greenlet>=0.3.1
PasteDeploy==1.5.0
paste
stevedore>=0.8.0
suds==0.4
paramiko
Babel>=0.9.6
iso8601>=0.1.4
setuptools_git>=0.4
#python-glanceclient>=0.5.0,<2
#python-keystoneclient>=0.2.0

将列表提取出来之后,用命令查看系统安装依赖的版本号,并与运行正常的环境中的结果做比对:

# while read line; do pip search $line; done < pip-requires > pip-search-1
比对之后很快发现问题,pasteDeploy版本为1.5.2, 估计是其他模块安装的时候带入的新版本。

PasteDeploy               - Load, configure, and compose WSGI applications and servers
  INSTALLED: 1.5.2

用pip install pastedeploy==1.5.0 强制装回后,cinder创建卷,挂载卷正常,排错完毕。


总结:

1. 使用老版本的开源软件需要留意依赖包更新所引入的Bug,要么升级开源软件,要么固定依赖版本。

2. 在排除代码被改动造成的错误之后,需要注意操作系统的更新所带来的依赖不匹配。


Good Luck

转载请注明出处,谢谢 by 熊崽Kevin!

相关内容

    暂无相关文章