cinder 创建磁盘提示Permission denied

1.报错信息

Stdout: u"Formatting '/var/lib/cinder/mnt/6ee3397902b681df883306df8b4f29e0/volume-82db7b50-c1a2-45f8-9c2e-ca8f15a4037d', fmt=qcow2 size=1073741824 cluster_size=65536 preallocation=metadata lazy_refcounts=off refcount_bits=16\n"
Stderr: u'qemu-img: /var/lib/cinder/mnt/6ee3397902b681df883306df8b4f29e0/volume-82db7b50-c1a2-45f8-9c2e-ca8f15a4037d: Could not create file: Permission denied\n'

 

2.debug 调试显示

在/usr/lib/python2.7/site-packages/cinder/volume/drivers/remotefs.py中加入debug调试信息
 

def _create_qcow2_file(self, path, size_gb):
        """Creates a QCOW2 file of a given size in GiB."""

        LOG.debug("run_as_root: %s", self._execute_as_root)
        self._execute('qemu-img', 'create', '-f', 'qcow2',
                      '-o', 'preallocation=metadata',
                      path, str(size_gb * units.Gi),
                      run_as_root=self._execute_as_root)

 

0fb671e33fc04231bee58fea69f6944c - default default] run_as_root: False _create_qcow2_file /usr/lib/python2.7/site-packages/cinder/volume/drivers/remotefs.py:399

未使用root权限运行导致

原因:

查看/usr/lib/python2.7/site-packages/cinder/volume/drivers/nfs.py中代码

  if self.configuration.nas_secure_file_operations == 'true':
            self._execute_as_root = False


当nas_secure_file_operations 设置为true时会将_execute_as_root 设置为False

所以更高配置文件nfs backend的配置nas_secure_file_operations 为False后解决

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值