1. 问题现象
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