Nova无法Attach Cinder Volume, Caught error: 'volume'

tokimekiyxp 2013-02-25 05:20:44
在原来的基础上将nova-volume换成了cinder,一切安装好以后,服务均工作正常。通过Dashboard创建Volume能够成功,之后将Volume attach到instance时出现错误,查看日志发现在/var/log/nova/api.log下有如下错误日志:

2013-02-25 15:30:08 INFO nova.api.openstack.wsgi [req-09239b09-97d1-4f5d-a9c3-15f60f33d877 c881ba5369ff40dbad6586b935c5515c 646a1ca8dcfa4ea5b0c7dc2d2d729f66] POST http://10.10.1.162:8774/v1.1/646a1ca8dcfa4ea5b0c7dc2d2d729f66/servers/c4381af1-49e2-43d8-be41-a2ee9c948c05/os-volume_attachments
2013-02-25 15:30:08 AUDIT nova.api.openstack.compute.contrib.volumes [req-09239b09-97d1-4f5d-a9c3-15f60f33d877 c881ba5369ff40dbad6586b935c5515c 646a1ca8dcfa4ea5b0c7dc2d2d729f66] Attach volume 266054db-5d25-4338-9f02-b4702486258d to instance c4381af1-49e2-43d8-be41-a2ee9c948c05 at /dev/vdc
2013-02-25 15:30:08 3704 DEBUG nova.openstack.common.rpc.amqp [-] Making asynchronous call on compute.saturn-11 ... multicall /usr/lib/python2.6/site-packages/nova/openstack/common/rpc/amqp.py:352
2013-02-25 15:30:08 3704 DEBUG nova.openstack.common.rpc.amqp [-] MSG_ID is a9cf3129385a43f5b5f84caac92336ec multicall /usr/lib/python2.6/site-packages/nova/openstack/common/rpc/amqp.py:355
2013-02-25 15:30:08 DEBUG nova.volume.cinder [req-09239b09-97d1-4f5d-a9c3-15f60f33d877 c881ba5369ff40dbad6586b935c5515c 646a1ca8dcfa4ea5b0c7dc2d2d729f66] Cinderclient connection created using URL: http://10.10.1.162:8776/v1646a1ca8dcfa4ea5b0c7dc2d2d729f66 cinderclient /usr/lib/python2.6/site-packages/nova/volume/cinder.py:68
2013-02-25 15:30:08 ERROR nova.api.openstack [req-09239b09-97d1-4f5d-a9c3-15f60f33d877 c881ba5369ff40dbad6586b935c5515c 646a1ca8dcfa4ea5b0c7dc2d2d729f66] Caught error: 'volume'
2013-02-25 15:30:08 3704 TRACE nova.api.openstack Traceback (most recent call last):
2013-02-25 15:30:08 3704 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/nova/api/openstack/__init__.py", line 78, in __call__
2013-02-25 15:30:08 3704 TRACE nova.api.openstack return req.get_response(self.application)
2013-02-25 15:30:08 3704 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg/webob/request.py", line 1053, in get_response
2013-02-25 15:30:08 3704 TRACE nova.api.openstack application, catch_exc_info=False)
2013-02-25 15:30:08 3704 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg/webob/request.py", line 1022, in call_application
2013-02-25 15:30:08 3704 TRACE nova.api.openstack app_iter = application(self.environ, start_response)
2013-02-25 15:30:08 3704 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg/webob/dec.py", line 159, in __call__
2013-02-25 15:30:08 3704 TRACE nova.api.openstack return resp(environ, start_response)
2013-02-25 15:30:08 3704 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/keystone/middleware/auth_token.py", line 278, in __call__
2013-02-25 15:30:08 3704 TRACE nova.api.openstack return self.app(env, start_response)
2013-02-25 15:30:08 3704 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg/webob/dec.py", line 159, in __call__
2013-02-25 15:30:08 3704 TRACE nova.api.openstack return resp(environ, start_response)
2013-02-25 15:30:08 3704 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg/webob/dec.py", line 159, in __call__
2013-02-25 15:30:08 3704 TRACE nova.api.openstack return resp(environ, start_response)
2013-02-25 15:30:08 3704 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg/webob/dec.py", line 159, in __call__
2013-02-25 15:30:08 3704 TRACE nova.api.openstack return resp(environ, start_response)
2013-02-25 15:30:08 3704 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/Routes-1.12.3-py2.6.egg/routes/middleware.py", line 131, in __call__
2013-02-25 15:30:08 3704 TRACE nova.api.openstack response = self.app(environ, start_response)
2013-02-25 15:30:08 3704 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg/webob/dec.py", line 159, in __call__
2013-02-25 15:30:08 3704 TRACE nova.api.openstack return resp(environ, start_response)
2013-02-25 15:30:08 3704 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg/webob/dec.py", line 147, in __call__
2013-02-25 15:30:08 3704 TRACE nova.api.openstack resp = self.call_func(req, *args, **self.kwargs)
2013-02-25 15:30:08 3704 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg/webob/dec.py", line 208, in call_func
2013-02-25 15:30:08 3704 TRACE nova.api.openstack return self.func(req, *args, **kwargs)
2013-02-25 15:30:08 3704 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/nova/api/openstack/wsgi.py", line 894, in __call__
2013-02-25 15:30:08 3704 TRACE nova.api.openstack content_type, body, accept)
2013-02-25 15:30:08 3704 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/nova/api/openstack/wsgi.py", line 942, in _process_stack
2013-02-25 15:30:08 3704 TRACE nova.api.openstack action_result = self.dispatch(meth, request, action_args)
2013-02-25 15:30:08 3704 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/nova/api/openstack/wsgi.py", line 1030, in dispatch
2013-02-25 15:30:08 3704 TRACE nova.api.openstack return method(req=request, **action_args)
2013-02-25 15:30:08 3704 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/nova/api/openstack/compute/contrib/volumes.py", line 397, in create
2013-02-25 15:30:08 3704 TRACE nova.api.openstack volume_id, device)
2013-02-25 15:30:08 3704 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/nova/compute/api.py", line 115, in wrapped
2013-02-25 15:30:08 3704 TRACE nova.api.openstack return func(self, context, target, *args, **kwargs)
2013-02-25 15:30:08 3704 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/nova/compute/api.py", line 105, in inner
2013-02-25 15:30:08 3704 TRACE nova.api.openstack return function(self, context, instance, *args, **kwargs)
2013-02-25 15:30:08 3704 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/nova/compute/api.py", line 1907, in attach_volume
2013-02-25 15:30:08 3704 TRACE nova.api.openstack context, instance['uuid'], device)
2013-02-25 15:30:08 3704 TRACE nova.api.openstack File "/usr/lib64/python2.6/contextlib.py", line 23, in __exit__
2013-02-25 15:30:08 3704 TRACE nova.api.openstack self.gen.next()
2013-02-25 15:30:08 3704 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/nova/compute/api.py", line 1899, in attach_volume
2013-02-25 15:30:08 3704 TRACE nova.api.openstack volume = self.volume_api.get(context, volume_id)
2013-02-25 15:30:08 3704 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/nova/volume/cinder.py", line 144, in get
2013-02-25 15:30:08 3704 TRACE nova.api.openstack item = cinderclient(context).volumes.get(volume_id)
2013-02-25 15:30:08 3704 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/cinderclient/v1/volumes.py", line 147, in get
2013-02-25 15:30:08 3704 TRACE nova.api.openstack return self._get("/volumes/%s" % volume_id, "volume")
2013-02-25 15:30:08 3704 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/cinderclient/base.py", line 143, in _get
2013-02-25 15:30:08 3704 TRACE nova.api.openstack return self.resource_class(self, body[response_key], loaded=True)
2013-02-25 15:30:08 3704 TRACE nova.api.openstack KeyError: 'volume'
2013-02-25 15:30:08 3704 TRACE nova.api.openstack
2013-02-25 15:30:08 INFO nova.api.openstack [req-09239b09-97d1-4f5d-a9c3-15f60f33d877 c881ba5369ff40dbad6586b935c5515c 646a1ca8dcfa4ea5b0c7dc2d2d729f66] http://10.10.1.162:8774/v1.1/646a1ca8dcfa4ea5b0c7dc2d2d729f66/servers/c4381af1-49e2-43d8-be41-a2ee9c948c05/os-volume_attachments returned with HTTP 500
2013-02-25 15:30:08 INFO nova.osapi_compute.wsgi.server [req-09239b09-97d1-4f5d-a9c3-15f60f33d877 c881ba5369ff40dbad6586b935c5515c 646a1ca8dcfa4ea5b0c7dc2d2d729f66] 10.10.1.162 - - [25/Feb/2013 15:30:08] "POST /v1.1/646a1ca8dcfa4ea5b0c7dc2d2d729f66/servers/c4381af1-49e2-43d8-be41-a2ee9c948c05/os-volume_attachments HTTP/1.1" 500 335 0.227375


查了很久,不知道这是什么原因引起的,请问有谁遇到过没有?
我的cinder配置如下:
cinder.conf
[DEFAULT]
logdir = /var/log/cinder
state_path = /var/lib/cinder
lock_path = /var/lib/cinder/tmp
volumes_dir = /etc/cinder/volumes
iscsi_helper = tgtadm
sql_connection = mysql://root:openstack@10.10.1.162/cinder
#rpc_backend = cinder.openstack.common.rpc.impl_qpid
rpc_backend = cinder.openstack.common.rpc.impl_kombu
rootwrap_config = /etc/cinder/rootwrap.conf

# RABBITMQ
rabbit_host=10.10.1.162
rabbit_port=5672
rabbit_userid=guest
rabbit_password=openstack

auth_strategy = keystone
volume_group = cinder-volumes

[keystone_authtoken]
admin_tenant_name = service
admin_user = cinder
admin_password = openstack
auth_host = 10.10.1.162
auth_port = 35357
auth_protocol = http
signing_dirname = /tmp/keystone-signing-cinder


nova的配置就暂时不贴了。如果有朋友遇到过问题,需要知道配置,请回帖!
热切盼望有人能帮忙解答!!!
...全文
1241 7 打赏 收藏 举报
写回复
7 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
xichaofan1 2015-04-28
楼主我也是这个问题哦,请问你最后解决了吗?
  • 打赏
  • 举报
回复
tokimekiyxp 2013-03-05
引用 5 楼 KitSdk 的回复:
0、首先用fdisk -l 看看你创建的lv 是否真的存在 1、检查tgt服务是否正常 2、在/etc/tgt/tgrgets.conf 中有类似:include /etc/nova/volumes/*或者 include /etc/cinder/volumes/* 的配置条目。 3、在 /etc/nova/volumes/ 或者 /etc/cinder/volu……
你说的东西都是正确配置好了的。我已经检查过了。 我也怀疑是不是nova的问题,但是现在苦于找不到原因。
  • 打赏
  • 举报
回复
KitSdk 2013-03-04
0、首先用fdisk -l 看看你创建的lv 是否真的存在 1、检查tgt服务是否正常 2、在/etc/tgt/tgrgets.conf 中有类似:include /etc/nova/volumes/*或者 include /etc/cinder/volumes/* 的配置条目。 3、在 /etc/nova/volumes/ 或者 /etc/cinder/volumes/ 是否生成了你所创建lv的相关target配置文件 5、如果以上都正常,可以在windows系统安装iSCSI Initiator 来挂接测试你的tgt服务你创建的lv。具体操作步骤不在详述。 如果以上都正常。。。。那么就要看是否nova的问题了。。。。。。!!!
  • 打赏
  • 举报
回复
tokimekiyxp 2013-03-04
引用 2 楼 KitSdk 的回复:
还要主要NOVA的配置文件与cinder相关配置如下: #volume_driver = nova.volume.driver.ISCSIDriver #启用cinder volume_api_class = nova.volume.cinder.API enabled_apis=ec2,osapi_compute,metadata……
这个都是有的。
  • 打赏
  • 举报
回复
linuxca 2013-03-02
谢谢分享
  • 打赏
  • 举报
回复
KitSdk 2013-03-01
还要主要NOVA的配置文件与cinder相关配置如下: #volume_driver = nova.volume.driver.ISCSIDriver #启用cinder volume_api_class = nova.volume.cinder.API enabled_apis=ec2,osapi_compute,metadata #volumes_dir = /etc/nova/volumes #volume_group = vg_linux #volume_name_template = volume-%s #iscsi_helper = tgtadm
  • 打赏
  • 举报
回复
tokimekiyxp 2013-02-25
cinder/api-paste.ini
#############
# Openstack #
#############

[composite:osapi_volume]
use = call:cinder.api.openstack.urlmap:urlmap_factory
/: osvolumeversions
/v1: openstack_volume_api_v1

[composite:openstack_volume_api_v1]
use = call:cinder.api.auth:pipeline_factory
noauth = faultwrap sizelimit noauth osapi_volume_app_v1
keystone = faultwrap sizelimit authtoken keystonecontext osapi_volume_app_v1
keystone_nolimit = faultwrap sizelimit authtoken keystonecontext osapi_volume_app_v1

[filter:faultwrap]
paste.filter_factory = cinder.api.openstack:FaultWrapper.factory

[filter:noauth]
paste.filter_factory = cinder.api.openstack.auth:NoAuthMiddleware.factory

[filter:sizelimit]
paste.filter_factory = cinder.api.sizelimit:RequestBodySizeLimiter.factory

[app:osapi_volume_app_v1]
paste.app_factory = cinder.api.openstack.volume:APIRouter.factory

[pipeline:osvolumeversions]
pipeline = faultwrap osvolumeversionapp

[app:osvolumeversionapp]
paste.app_factory = cinder.api.openstack.volume.versions:Versions.factory

##########
# Shared #
##########

[filter:keystonecontext]
paste.filter_factory = cinder.api.auth:CinderKeystoneContext.factory

[filter:authtoken]
paste.filter_factory = keystone.middleware.auth_token:filter_factory
service_protocol = http
service_host = 10.10.1.162
service_port = 5000
auth_host = 10.10.1.162
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = cinder
admin_password = openstack
  • 打赏
  • 举报
回复
发帖
OpenStack

963

社区成员

OpenStack
社区管理员
  • OpenStack社区
加入社区
帖子事件
创建了帖子
2013-02-25 05:20
社区公告
暂无公告