Openstack Cinder使用NetApp NFS作为后端存储

公司使用NetApp FS8020 R6作为测试环境NFS存储使用。正好有机会测一下OpenStack的Cinder跟NetApp存储集成。

说明:

1.OpenStack使用NetApp存储直接挂载NFS文件没任何问题,生产中已使用比较稳定测试IOPS在160-220M/s。

2.使用OpenStack的Cinder无法像挂载如Linux主机共享NFS文件那样直接使用,需要调用NetAPP的API才能实现功能,如果设置为标准驱动现象为cinder-volume在开始的时候是正常的,但是一般十来分钟后State状态为down.(暂无截图)

配置文件如下:

[DEFAULT]
enabled_backends = nfs

[nfs]

volume_backend_name = nfs               //标黄的三处命名应统一,命名内容与使用协议无关如下文命名netapp_nfs
volume_driver = cinder.volume.drivers.nfs.NfsDriver    //定义使用的驱动类型,通用的NFS使用该选项,第三方厂商调用的驱动配置各不相同
nfs_sparsed_volumes = True
nfs_shares_config = /etc/cinder/nfs_shares
nfs_mount_point_base = $state_path/mnt
nfs_mount_options = v3

[[email protected] cinder]# vim nfs_shares

172.16.5.242:/vol/sqmgtvm02/nfs      //NetApp存储IP:/共享的文件目录  正确的内容应为172.16.5.242:/vol/sqmgtvm02提供volume不是文件夹nfs但是为了隔离生产中其他的文件增加nfs(导致下文报错2)

检查/var/log/cinder/volume.log中报错日志如下:

2017-09-07 22:07:58.983 16612 ERROR oslo_service.service [req-37e3e47a-e1cb-47b8-a950-73374fd8713b - - - - -] Error starting thread.
2017-09-07 22:07:58.983 16612 ERROR oslo_service.service Traceback (most recent call last):
2017-09-07 22:07:58.983 16612 ERROR oslo_service.service File "/usr/lib/python2.7/site-packages/oslo_service/service.py", line 708, in run_service
2017-09-07 22:07:58.983 16612 ERROR oslo_service.service service.start()
2017-09-07 22:07:58.983 16612 ERROR oslo_service.service File "/usr/lib/python2.7/site-packages/cinder/service.py", line 234, in start
2017-09-07 22:07:58.983 16612 ERROR oslo_service.service self.manager.init_host(added_to_cluster=self.added_to_cluster)
2017-09-07 22:07:58.983 16612 ERROR oslo_service.service File "/usr/lib/python2.7/site-packages/cinder/volume/manager.py", line 425, in init_host
2017-09-07 22:07:58.983 16612 ERROR oslo_service.service self.driver.init_capabilities()
2017-09-07 22:07:58.983 16612 ERROR oslo_service.service File "/usr/lib/python2.7/site-packages/cinder/volume/driver.py", line 704, in init_capabilities
2017-09-07 22:07:58.983 16612 ERROR oslo_service.service stats = self.get_volume_stats(True)
2017-09-07 22:07:58.983 16612 ERROR oslo_service.service File "/usr/lib/python2.7/site-packages/cinder/volume/drivers/remotefs.py", line 512, in get_volume_stats
2017-09-07 22:07:58.983 16612 ERROR oslo_service.service self._update_volume_stats()
2017-09-07 22:07:58.983 16612 ERROR oslo_service.service File "/usr/lib/python2.7/site-packages/cinder/volume/drivers/nfs.py", line 448, in _update_volume_stats
2017-09-07 22:07:58.983 16612 ERROR oslo_service.service provisioned_capacity = self._get_provisioned_capacity()
2017-09-07 22:07:58.983 16612 ERROR oslo_service.service File "/usr/lib/python2.7/site-packages/cinder/volume/drivers/remotefs.py", line 212, in _get_provisioned_capacity
2017-09-07 22:07:58.983 16612 ERROR oslo_service.service run_as_root=True)
2017-09-07 22:07:58.983 16612 ERROR oslo_service.service File "/usr/lib/python2.7/site-packages/cinder/utils.py", line 123, in execute
2017-09-07 22:07:58.983 16612 ERROR oslo_service.service return processutils.execute(*cmd, **kwargs)
2017-09-07 22:07:58.983 16612 ERROR oslo_service.service File "/usr/lib/python2.7/site-packages/oslo_concurrency/processutils.py", line 389, in execute
2017-09-07 22:07:58.983 16612 ERROR oslo_service.service cmd=sanitized_cmd)
2017-09-07 22:07:58.983 16612 ERROR oslo_service.service ProcessExecutionError: Unexpected error while running command.
2017-09-07 22:07:58.983 16612 ERROR oslo_service.service Command: sudo cinder-rootwrap /etc/cinder/rootwrap.conf du --bytes /var/lib/cinder/mnt/3d59744e62f876bf5171140e3a723d34
2017-09-07 22:07:58.983 16612 ERROR oslo_service.service Exit code: 1
2017-09-07 22:07:58.983 16612 ERROR oslo_service.service Stdout: u‘4096\t/var/lib/cinder/mnt/3d59744e62f876bf5171140e3a723d34/.snapshot\n8268\t/var/lib/cinder/mnt/3d59744e62f876bf5171140e3a723d34\n‘
2017-09-07 22:07:58.983 16612 ERROR oslo_service.service Stderr: ‘/bin/du: WARNING: Circular directory structure.\nThis almost certainly means that you have a corrupted file system.\nNOTIFY YOUR SYSTEM MANAGER.\nThe following directory is part of the cycle:\n \xe2\x80\x98/var/lib/cinder/mnt/3d59744e62f876bf5171140e3a723d34/.snapshot/sv_nightly.0\xe2\x80\x99\n\n‘

2017-09-09 21:33:28.066 154678 WARNING oslo_reports.guru_meditation_report [-] Guru meditation now registers SIGUSR1 and SIGUSR2 by default for backward compatibility. SIGUSR1 will no longer be registered in a future release, so please use SIGUSR2 to generate reports.
2017-09-09 21:33:28.500 154678 WARNING cinder.keymgr.conf_key_mgr [req-ba7d370f-a96c-4b3f-95fa-c6234277766e - - - - -] This key manager is insecure and is not recommended for production deployments
2017-09-09 21:33:28.513 154678 ERROR cinder.cmd.volume [req-ba7d370f-a96c-4b3f-95fa-c6234277766e - - - - -] Volume service [email protected] failed to start.
2017-09-09 21:33:28.513 154678 ERROR cinder.cmd.volume Traceback (most recent call last):
2017-09-09 21:33:28.513 154678 ERROR cinder.cmd.volume File "/usr/lib/python2.7/site-packages/cinder/cmd/volume.py", line 99, in main
2017-09-09 21:33:28.513 154678 ERROR cinder.cmd.volume cluster=cluster)
2017-09-09 21:33:28.513 154678 ERROR cinder.cmd.volume File "/usr/lib/python2.7/site-packages/cinder/service.py", line 382, in create
2017-09-09 21:33:28.513 154678 ERROR cinder.cmd.volume cluster=cluster)
2017-09-09 21:33:28.513 154678 ERROR cinder.cmd.volume File "/usr/lib/python2.7/site-packages/cinder/service.py", line 202, in __init__
2017-09-09 21:33:28.513 154678 ERROR cinder.cmd.volume *args, **kwargs)
2017-09-09 21:33:28.513 154678 ERROR cinder.cmd.volume File "/usr/lib/python2.7/site-packages/cinder/volume/manager.py", line 242, in __init__
2017-09-09 21:33:28.513 154678 ERROR cinder.cmd.volume active_backend_id=curr_active_backend_id)
2017-09-09 21:33:28.513 154678 ERROR cinder.cmd.volume File "/usr/lib/python2.7/site-packages/oslo_utils/importutils.py", line 44, in import_object
2017-09-09 21:33:28.513 154678 ERROR cinder.cmd.volume return import_class(import_str)(*args, **kwargs)
2017-09-09 21:33:28.513 154678 ERROR cinder.cmd.volume File "/usr/lib/python2.7/site-packages/cinder/volume/drivers/netapp/common.py", line 75, in __new__
2017-09-09 21:33:28.513 154678 ERROR cinder.cmd.volume na_utils.check_flags(NetAppDriver.REQUIRED_FLAGS, config)
2017-09-09 21:33:28.513 154678 ERROR cinder.cmd.volume File "/usr/lib/python2.7/site-packages/cinder/volume/drivers/netapp/utils.py", line 79, in check_flags
2017-09-09 21:33:28.513 154678 ERROR cinder.cmd.volume raise exception.InvalidInput(reason=msg)
2017-09-09 21:33:28.513 154678 ERROR cinder.cmd.volume InvalidInput: Invalid input received: Configuration value netapp_storage_protocol is not set.
2017-09-09 21:33:28.513 154678 ERROR cinder.cmd.volume
2017-09-09 21:33:28.517 154678 ERROR cinder.cmd.volume [req-ba7d370f-a96c-4b3f-95fa-c6234277766e - - - - -] No volume service(s) started successfully, terminating.
2017-09-09 21:33:30.401 154691 WARNING oslo_reports.guru_meditation_report [-] Guru meditation now registers SIGUSR1 and SIGUSR2 by default for backward compatibility. SIGUSR1 will no longer be registered in a future release, so please use SIGUSR2 to generate reports.
2017-09-09 21:33:33.308 154691 WARNING cinder.keymgr.conf_key_mgr [req-44d8acf3-246c-4efb-aaaf-00d092a68f40 - - - - -] This key manager is insecure and is not recommended for production deployments

正确配置文件:

[netapp_nfs]
volume_backend_name = netpp_nfs
volume_driver = cinder.volume.drivers.netapp.common.NetAppDriver
netapp_storage_family = ontap_7mode          //NetApp目前产品线分为两种模式
netapp_storage_protocol = nfs                        //使用协议
netapp_server_hostname = sqmgtvm02         //改名称建议修改/etc/hosts来定义主机和IP (原使用共享目录的172.16.X.X的IP地址提示认证错误更改为NetApp的管理地址正常)
netapp_server_port = 80                             
netapp_transport_type = http                          //认证协议选择支持https和http,标准中我使用http模式。(https配置较复杂详见下文参考链接)
netapp_login = root                                         //登录用户名,应该为管理员权限,就是登陆onecommand的那个账号和密码
netapp_password = netappxxx                       //登录密码
#netapp_vserver = svm_name                       //具体未知 按照官方文档推测应该就是sqmgtvm02
nfs_shares_config = /etc/cinder/nfs_shares   //配置NetApp NFS存储共享内容,可以使用showmount -e 172.16.5.xxx 来显示存储共享的目录
nfs_mount_point_base = $state_path/mnt     //挂载到本地的挂载点,改命令直接挂载至/var/lib/cinder/mnt/6ff41da189e9ce5bfc54af3394adbcd8
#max_over_subscription_ratio = 1.0              //推测为磁盘超配比
#reserved_percentage = 5                             //卷预留空间占比防止卷彻底挂掉,Ceph中也有类似选项避免空间爆掉可以通过释放改空间来执行紧急删除或迁移操作

时间: 2024-10-16 20:40:20

Openstack Cinder使用NetApp NFS作为后端存储的相关文章

Openstack cinder 使用nfs 作为后端存储

实验环境 network 存储节点controller nfs 客户端 1.在network节点上添加一个新的硬盘例如/dev/sdbmkfs.xfs /dev/sdbyum -y install rpbind nfs-utils 2.创建一个一个硬盘挂挂载点 mkdir -p /storage 3.vim /etc/fstab /dev/sdb /storage xfs. default. 0. 0 4.vim /etc/exports/storage *(rw,sync,no_root_sq

cinder 使用NFS 为后端存储

更多的OpenStack 对接课程请访问 http://edu.51cto.com/course/14150.html?source=so**实验环境 network 存储节点controller nfs 客户端1.在network节点上添加一个新的硬盘例如/dev/sdbmkfs.xfs /dev/sdbyum -y install rpbind nfs-utils 2.创建一个一个硬盘挂挂载点 mkdir -p /storage 3.vim /etc/fstab /dev/sdb /stor

OpenStack Cinder 与各种后端存储技术的集成叙述与实践

先说下下loop设备 loop设备及losetup命令介绍 1. loop设备介绍 在类 UNIX 系统里,loop 设备是一种伪设备(pseudo-device),或者也可以说是仿真设备.它能使我们像块设备一样访问一个文件.在使用之前,一个 loop 设备必须要和一个文件进行连接.这种结合方式给用户提供了一个替代块特殊文件的接口.因此,如果这个文件包含有一个完整的文件系统,那么这个文件就可以像一个磁盘设备一样被 mount 起来.    上面说的文件格式,我们经常见到的是 CD 或 DVD 的

配置NFS网络存储作为cinder的后端存储

安装cinder和nfs yum install -y openstack-cinder yum install cifs-utils 在controller节点配置nfs [[email protected] ~]# mkdir -p /data/nfs #创建一个共享挂载资源的目录 [[email protected] ~]# cat /etc/exports /data/nfs *(rw,sync,root_squash) #NFS服务程序的配置文件为/etc/exports sync 同

Openstack存储总结之:详解如何使用NFS作为Cinder的后端存储

NFS服务简单描述 NFS是Network File System的缩写,即网络文件系统.一种使用于分散式文件系统的协定,由Sun公司开发,于1984年向外公布.功能是通过网络让不同的机器.不同的操 作系统能够彼此分享个别的数据,让应用程序在客户端通过网络访问位于服务器磁盘中的数据,是在类Unix系统间实现磁盘文件共享的一种方法. NFS的基本原则是"容许不同的客户端及服务端通过一组RPC分享相同的文件系统",它是独立于操作系统,容许不同硬件及操作系统的系统共同进行文件的分享. NFS

openstack中nfs最为nova的后端存储

运行一个可用的nfs服务: [[email protected] ~]# showmount -e 192.168.100.10Export list for controller:/nfs *查看openstack当前nova的后端存储位置:我修改了默认云主机存储路径 [[email protected] ~]# cat /etc/nova/nova.conf | grep instances_path | grep -v "#"instances_path=/data/nova/i

OpenStack Cinder 块存储服务管理(七)

作者:李晓辉 联系方式: [email protected] 环境介绍 类型 控制节点和计算节点等在一起,形成all-in-one 内存 8G 硬盘 200G 网卡 2块 块存储服务概览 块存储服务(cinder)为实例提供块存储.存储的分配和消耗是由块存储驱动器,或者多后端配置的驱动器决定的.还有很多驱动程序可用:NAS/SAN,NFS,ISCSI,Ceph等. 典型情况下,块服务API和调度器服务运行在控制节点上.取决于使用的驱动,卷服务器可以运行在控制节点.计算节点或单独的存储节点. Op

使用Ceph作为OpenStack的后端存储

概述 libvirt配置了librbd的QEMU接口,通过它可以在OpenStack中使用Ceph块存储.Ceph块存储是集群对象,这意味着它比独立的服务器有更好的性能. 在OpenStack中使用Ceph块设备,必须首先安装QEMU,libvirt和OpenStack,下图描述了 OpenStack和Ceph技术层次结构: http://my.oschina.net/JerryBaby/blog/376580 我翻译的官方文档,仅供参考 ^ ^. 系统规划 OpenStack集群: 控制节点:

openstack——cinder服务篇

一.cinder 介绍: 理解 Block Storage 操作系统获得存储空间的方式一般有两种: 通过某种协议(SAS,SCSI,SAN,iSCSI 等)挂接裸硬盘,然后分区.格式化.创建文件系统:或者直接使用裸硬盘存储数据(数据库) 通过 NFS.CIFS 等 协议,mount 远程的文件系统 第一种裸硬盘的方式叫做 Block Storage(块存储),每个裸硬盘通常也称作 Volume(卷) 第二种叫做文件系统存储.NAS 和 NFS 服务器,以及各种分布式文件系统提供的都是这种存储.