问题:虚拟机挂载数据卷失败,cinder的api.log报错Permission denied

1. 问题现象

虚拟机挂载数据卷失败,cinder的api.log报错Permission denied

2. 分析过程

查看/var/log/cinder/api.log,有如下报错:

2014-08-11 16:37:54.555 22326 ERROR cinder.api.middleware.fault [req-a0341926-c5c4-46b7-83ef-4e7657e75c9b admin 065e24d5f4db4733b98f40dae41fd71d] Caught error: [Errno 13] Permission denied

查看/var/log/cinder/volume.log,有如下报错:

2014-08-11 16:37:54.543 22512 ERROR cinder.openstack.common.rpc.amqp [req-a0341926-c5c4-46b7-83ef-4e7657e75c9b admin 065e24d5f4db4733b98f40dae41fd71d] Exception during message handling
2014-08-11 16:37:54.545 22512 ERROR cinder.openstack.common.rpc.common [req-a0341926-c5c4-46b7-83ef-4e7657e75c9b admin 065e24d5f4db4733b98f40dae41fd71d] Returning exception [Errno 13] Permission denied: u'/run/lock/cinder/cinder-e29d92e3-ab89-46da-9cc2-a777df6338ea' to caller
2014-08-11 16:37:54.546 22512 ERROR cinder.openstack.common.rpc.common [req-a0341926-c5c4-46b7-83ef-4e7657e75c9b admin 065e24d5f4db4733b98f40dae41fd71d] ['Traceback (most recent call last):\n', ' File "/opt/server/cinder/python2.6.6/lib/python2.6/site-packages/cinder/openstack/common/rpc/amqp.py", line 441, in _process_data\n **args)\n', ' File "/opt/server/cinder/python2.6.6/lib/python2.6/site-packages/cinder/openstack/common/rpc/dispatcher.py", line 148, in dispatch\n return getattr(proxyobj, method)(ctxt, **kwargs)\n', ' File "/opt/server/cinder/python2.6.6/lib/python2.6/site-packages/cinder/utils.py", line 808, in wrapper\n return func(self, *args, **kwargs)\n', ' File "/opt/server/cinder/python2.6.6/lib/python2.6/site-packages/cinder/volume/manager.py", line 526, in attach_volume\n return do_attach()\n', ' File "/opt/server/cinder/python2.6.6/lib/python2.6/site-packages/cinder/openstack/common/lockutils.py", line 226, in inner\n with lock:\n', ' File "/opt/server/cinder/python2.6.6/lib/python2.6/site-packages/cinder/openstack/common/lockutils.py", line 79, in __enter__\n self.lockfile = open(self.fname, \'w\')\n', "IOError: [Errno 13] Permission denied: u'/run/lock/cinder/cinder-e29d92e3-ab89-46da-9cc2-a777df6338ea'\n"]

根据volume.log的日志,怀疑是/run/lock/cinder/这个目录的权限问题,查看后得知:

drwxr-xr-x 2 root root 4096 Aug 11 16:47 cinder

很明显,的确是权限问题!

3. 解决办法

① 解决办法一(推荐):将/run/lock/cinder/的owner和owning group都改成cinder,权限不变仍然保持755:

chown cinder:cinder /run/lock/cinder

② 解决办法二(不推荐):将/run/lock/cinder/的权限改成777:

chmod 777 /run/lock/cinder

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值