【问题描述】

cinder后端设置为NFS,磁盘创建快照失败。

日志里面发现了这个错误:

VolumeDriverException: Volume driver reported an error: NFS driver snapshot support is disabled in cinder.conf.

【修改方法】

cinder.conf修改或者添加以下参数:

[nfs]

……

nfs_snapshot_support = True

nas_secure_file_operations = False

重启cinder-volume服务

【原因】

Google了一下,发现cinder后端设置为NFS,默认是不支持快照功能的。

以下为官方解释

from https://docs.openstack.org/ocata/config-reference/block-storage/drivers/nfs-volume-driver.html

Configuration option = Default value

Description

[DEFAULT]

nfs_mount_attempts = 3

(Integer) The number of attempts to mount NFS shares before raising an error. At least one attempt will be made to mount an NFS share, regardless of the value specified.

nfs_mount_options = None

(String) Mount options passed to the NFS client. See section of the NFS man page for details.

nfs_mount_point_base = $state_path/mnt

(String) Base dir containing mount points for NFS shares.

nfs_qcow2_volumes = False

(Boolean) Create volumes as QCOW2 files rather than raw files.

nfs_shares_config = /etc/cinder/nfs_shares

(String) File with the list of available NFS shares.

nfs_snapshot_support = False

(Boolean) Enable support for snapshots on the NFS driver. Platforms using libvirt <1.2.7 will encounter issues with this feature.

nfs_sparsed_volumes = True

(Boolean) Create volumes as sparsed files which take no space. If set to False volume is created as regular file. In such case volume creation takes a lot of time.

修改nfs_snapshot_support = True之后,又发现了新的错误:

VolumeDriverException: Volume driver reported an error: Snapshots are not supported with nas_secure_file_operations enabled ('true' or 'auto'). Please set it to 'false' if you intend to have it enabled.

以下为官方解释

from https://docs.openstack.org/security-guide/block-storage/checklist.html

Check-Block-07: Is NAS operating in a secure environment?

Cinder supports an NFS driver which works differently than a traditional block storage driver. The NFS driver does not actually allow an instance to access a storage device at the block level. Instead, files are created on an NFS share and mapped to instances, which emulates a block device. Cinder supports secure configuration for such files by controlling the file permissions when cinder volumes are created. Cinder configuration can also control whether file operations are run as the root user or the current OpenStack process user.

Pass: If value of parameter nas_secure_file_permissions under [DEFAULT] section in /etc/cinder/cinder.conf is set to auto. When set to auto, a check is done during cinder startup to determine if there are existing cinder volumes, no volumes will set the option to True, and use secure file permissions. The detection of existing volumes will set the option to False, and use the current insecure method of handling file permissions. If value of parameter nas_secure_file_operations under [DEFAULT] section in /etc/cinder/cinder.conf is set to auto. When set to "auto", a check is done during cinder startup to determine if there are existing cinder volumes, no volumes will set the option to True, be secure and do NOT run as the root user. The detection of existing volumes will set the option to False, and use the current method of running operations as the root user. For new installations, a "marker file" is written so that subsequent restarts of cinder will know what the original determination had been.

Fail: If value of parameter nas_secure_file_permissions under [DEFAULT] section in /etc/cinder/cinder.conf is set to False and if value of parameter nas_secure_file_operations under [DEFAULT] section in /etc/cinder/cinder.conf is set to False.

原因是因为NFS有些操作不兼容NAS的某些安全特性。

所以需要在配置文件里面修改nas_secure_file_operations = False

【代码位置】

 def _check_snapshot_support(self, setup_checking=False):
"""Ensure snapshot support is enabled in config.""" if (not self.configuration.nfs_snapshot_support and
not setup_checking):
msg = _("NFS driver snapshot support is disabled in cinder.conf.")
raise exception.VolumeDriverException(message=msg) if (self.configuration.nas_secure_file_operations == 'true' and
self.configuration.nfs_snapshot_support):
msg = _("Snapshots are not supported with "
"nas_secure_file_operations enabled ('true' or 'auto'). "
"Please set it to 'false' if you intend to have "
"it enabled.")
LOG.error(msg)
raise exception.VolumeDriverException(message=msg)

【隐患】

这样修改可能会导致NAS的安全特性不可用。

from http://fanyi.baidu.com/transpage?query=https%3A%2F%2Fbugs.launchpad.net%2Fkolla-ansible%2F%2Bbug%2F1726836&from=en&to=zh&source=url&render=1

The NFS backend driver for Cinder implements enhanced NAS security features that default to being enabled.

NFS后端驱动程序实现了增强的NAS安全特性,默认为启用。

However, the features require non-standard configuration changes in Nova's libvirt, and without those changes some cinder volume operations fail.

然而,这些特性要求nova的libvirt一些非标准配置的变动,如果不去手动修改这些配置,某些cinder volume的操作将会失败。

Fix: Add TripleO settings to control the NFS driver's NAS secure features, and disable the features by default.

修复:添加TripleO 配置来控制NFS驱动程序的NAS安全特性,并默认禁止这些功能。

Also these features enabled actually disable possibility to use snapshots.

此外,这些特性实际上禁用了使用快照的可能性。

建议一:

as of Queens cinder volume refuses to work with both snapshots/backups and secure nas feature:

截至Q版本,cinder服务拒绝与安全NAS特性共存:

VolumeDriverException: Volume driver reported an error: Snapshots are not supported with nas_secure_file_operations enabled ('true' or 'auto'). Please set it to 'false' if you intend to have it enabled.

选择前者(true/auto),直到NAS安全特性可在所有的openstack环境中工作

Choosing the former until secure nas feature works in all environments

建议二:

Cinder fails to run because snapshots are not compatible with secure NAS。

cinder无法运行,因为快照与NAS安全特性不兼容。

Cinder cannot run with both snapshots or backups of volumes and secure NAS feature. Choosing the former as the latter does not function well everywhere.

cinder不能同时使用快照和备份,和安全的NAS特性。

选择前者,后者将不起作用。

cinder支持nfs快照的更多相关文章

  1. 配置cinder使用NFS后端

    首先先使用“cinder delete”命令删除所有实例,释放磁盘空间. 停止cinder服务:service openstack-cinder-api stopservice openstack-c ...

  2. NUC972配置为支持NFS

    系统平台:virtualbox3.2.10+ubuntu10.10 安装nfs: #sudo apt-get install nfs-kernel-server ubuntu10.10中的已经是最新版 ...

  3. linux内核支持nfs挂载配置

    1.配置网络部分,主要是使能CONFIG_IP_PNP以在2中能够看到Root file system on NFS选项Networking support Networking options TC ...

  4. OpenStack 存储服务 Cinder存储节点部署NFS(十七)

    Cinder存储节点部署 1.安装软件包 yum install -y nfs-utils rpcbind 提示:早期版本安装portmap nfs-utils :包括基本的NFS命令与监控程序 rp ...

  5. Flink使用Pod Template将状态快照(Checkpoint、Savepoint)存储在NFS

    背景 Flink 版本 1.13.3,使用 native k8s 部署模式,原采用 HDFS 作为状态快照(Checkpoint.Savepoint)的存储地址,但是由于仅使用了其 HDFS 作为状态 ...

  6. STAR-H1208M集线器不支持同时挂载多个nfs

    今天在两个触摸屏上都加入了开机加载nfs的操作. 没想到会出现以下错误: pmap_getmaps.c: rpc problem: RPC: Unable to receive; errno = Co ...

  7. 9 云计算系列之Cinder的安装与NFS作为cinder后端存储

    preface 在前面我们知道了如何搭建Openstack的keystone,glance,nova,neutron,horizon这几个服务,然而在这几个服务中唯独缺少存储服务,那么下面我们就学习块 ...

  8. Openstack入门篇(十八)之Cinder服务-->使用NFS作为后端存储

    1.安装cinder-volume组件以及nfs [root@linux-node2 ~]# yum install -y openstack-cinder python-keystone [root ...

  9. Cinder 架构分析、高可用部署与核心功能解析

    目录 文章目录 目录 Cinder Cinder 的软件架构 cinder-api cinder-scheduler cinder-volume Driver 框架 Plugin 框架 cinder- ...

随机推荐

  1. java 获取客户端的ip地址

    import javax.servlet.http.HttpServletRequest; import java.net.InetAddress; import java.net.UnknownHo ...

  2. Vue技术点整理-Vue CLI

    Vue CLI 是一个基于 Vue.js 进行项目快速开发的脚手架 注:具体安装步骤可参考Vue CLI,默认安装的脚手架,是没有service.util等工具类的,以下主要描述如何在脚手架的基础上进 ...

  3. 干货分享:ASP.NET CORE(C#)与Spring Boot MVC(JAVA)异曲同工的编程方式总结

    目录 C# VS JAVA 基础语法类比篇: 一.匿名类 二.类型初始化 三.委托(方法引用) 四.Lambda表达式 五.泛型 六.自动释放 七.重写(override) ASP.NET CORE ...

  4. 数字IC前后端设计中的时序收敛(三)--Hold违反的修复方法

    本文转自:自己的微信公众号<数字集成电路设计及EDA教程>(二维码见博文底部) 里面主要讲解数字IC前端.后端.DFT.低功耗设计以及验证等相关知识,并且讲解了其中用到的各种EDA工具的教 ...

  5. 19.linux文件属性

    1.linux文件属性 ls -lih i查看文件inode,h查看文件大小 文件总共10个属性 inode索引节点编号(唯一的) 文件类型和权限,第一个字符为类型,后面字符为权限 硬链接的数量 文件 ...

  6. idea下maven命令打包不同配置

    1. 场景描述 不知道大家有没有遇到过?Idea集成的maven,在切换不同环境配置的时候,有时候反应很慢,还存在切换后打包还是原配置的情况. 2. 问题解决 通过在idea下执行maven命令进行切 ...

  7. Spark第一周

    Why Scala 在数据集不是很大的时候,开发人员可以使用python.R.MATLAB等语言在单机上处理数据集.但是在大数据时代,数据集少说都是TB.PB级别,此时便需要分布式地处理.相较于上述语 ...

  8. kali linux 常用文件与指令路径

    重启网络 : /etc/init.d/networking restart 语言设置文件 : /etc/default/locale apt 安装deb保存目录 : /var/cache/apt/ar ...

  9. vector是序列式容器而set是关联式容器。set包含0个或多个不重复不排序的元素。

    1.vector是序列式容器而set是关联式容器.set包含0个或多个不重复不排序的元素.也就是说set能够保证它里面所有的元素都是不重复的.另外对set容器进行插入时可以指定插入位置或者不指定插入位 ...

  10. 万字长文:ELK(V7)部署与架构分析

    ELK(7版本)部署与架构分析 1.ELK的背景介绍与应用场景 在项目应用运行的过程中,往往会产生大量的日志,我们往往需要根据日志来定位分析我们的服务器项目运行情况与BUG产生位置.一般情况下直接在日 ...