自定义块存储后端部署指南


Red Hat OpenStack Platform 8

在 Red Hat OpenStack Platform Overcloud 中部署自定义块存储后端的指南

OpenStack Documentation Team

摘要

本文档论述了如何在 Red Hat OpenStack Platform 8 Overcloud 中为块存储服务部署自定义、非集成后端。

第 1 章 简介

Red Hat OpenStack Platform Director 是安装和管理完整的 OpenStack 环境的工具组。它主要基于 OpenStack 项目 TripleO (OpenStack-on-OpenStack)。Director 的主要目标是使用最少的手动配置全面编排企业级 OpenStack 部署的功能。它有助于解决手动配置各个 OpenStack 组件中固有的许多问题。

Director 提供的最终结果 OpenStack 部署称为 Overcloud。Overcloud 包含向最终用户提供服务的所有组件,包括块存储。本文档提供了有关如何将自定义后端部署到 Overcloud 的块存储服务的指导。

本文档旨在利用管理员在 手动配置 块存储服务方面的知识。在 OpenStack 的测试部署中(例如,通过stackstack),配置此服务涉及编辑其主机节点的 /etc/cinder/cinder.conf。该文件中的大多数块存储设置都会在其他位置进行更详细的记录;在本文档中,我们讨论如何将这些相同的设置应用到 Overcloud 以附加 自定义后端

警告

在有限的用例中,此步骤已被成功测试。请确保您首先在非生产环境中测试您的计划部署。如果您有任何问题,请联系红帽支持。

1.1. 自定义后端

在本文档中,自定义后端被定义为存储服务器/应用或配置,这些服务器已完全集成到 Red Hat OpenStack Platform Director 中。一些支持的块存储后端已经集成到 Director 中;这意味着预先配置的 Director 文件已开箱即用提供。可以通过这些文件配置集成后端并将其部署到 Overcloud。集成后端示例包括红帽 Ceph 和 Dell EqualLogic、Dell Storage Center 和 NetApp 设备的单后端配置。

此外,一些存储设备已经集成到 Director 中,仅支持单实例后端。例如,Dell EqualLogic 的预配置 Director 文件仅允许部署单一后端。如本文档所示,部署此设备的多个后端实例需要自定义配置。

虽然您可以通过直接编辑节点的 /etc/cinder/cinder.conf 来手动配置块存储服务,但以后任何设置都会被 Director 正确覆盖。因此,建议通过 Director 部署块存储后端。如果后端配置已经完全集成,您只需编辑并调用其打包的环境文件。

但是,使用自定义后端,您需要编写自己的 环境文件。本文档包含一个注解的示例,您可以编辑自己的部署,即 /home/stack/templates/custom-env.yaml。此示例文件可用于配置块存储服务以使用两个 NetApp 后端。

1.2. 要求

除了手动配置块存储和您要部署的后端外,本文档还假设:

  • 如果您使用第三方后端设备,则必须正确配置为存储库。
  • Overcloud 已通过 Director 部署,根据 Director 安装和使用中的 说明。
  • 您有具有升级权限的帐户的用户名和密码。您可以使用为部署 Overcloud 而创建的同一帐户;在创建 Director 安装用户 中,我们创建 stack 用户并用于此目的。
  • 您已映射了在 /etc/cinder/cinder.conf 中为 Block Storage 后端生成的配置。因此,其余所有的都是您计划通过 Director 进行的编排。

第 2 章 进程描述

块存储服务的设置存储在 /etc/cinder/cinder.conf 中,这些设置包括 后端定义。块存储服务可使用的大多数第三方后端(甚至支持)提供涉及编辑 /etc/cinder/cinder.conf 设置的设置指令。如 第 1 章 简介 所述,这样做将配置块存储服务;但是,这些设置将在以后的 Overcloud 更新中被覆盖。

无论如何,任何通过 /etc/cinder/cinder.conf 手动配置的文档都对 Overcloud 部署仍有用。全部 Director 后,将相同的配置应用到 /etc/cinder/cinder.conf,通过 heat 来应用。因此,规划后端配置需要:

  • 彻底规划您想要的块存储后端配置,以及
  • 为此配置映射生成的 /etc/cinder/cinder.conf 文件。

映射生成的 /etc/cinder/cinder.conf 文件后,创建用于编配后端设置的环境文件。环境文件 更详细地描述了此步骤,使用示例文件 /home/stack/templates/custom-env.yaml。使用环境文件有助于确保后端设置在未来的 Overcloud 更新中保留。

第 3 章 创建环境文件

环境文件包含您要定义的每个后端的设置。它还包含与部署自定义后端相关的其他设置。有关环境文件的更多信息,请参阅 环境文件 ( Director 安装和使用 指南中的 )。

以下环境文件定义了两个 NetApp 后端,即 netapp1netapp2

/home/stack/templates/custom-env.yaml

parameters: # 
1

  CinderEnableIscsiBackend: false
  CinderEnableRbdBackend: false
  CinderEnableNfsBackend: false
  NovaEnableRbdBackend: false
  GlanceBackend: file # 
2


parameter_defaults:
  controllerExtraConfig: # 
3

    cinder::config::cinder_config:
        netapp1/volume_driver: # 
4

            value: cinder.volume.drivers.netapp.common.NetAppDriver
        netapp1/netapp_storage_family:
            value: ontap_7mode
        netapp1/netapp_storage_protocol:
            value: iscsi
        netapp1/netapp_server_hostname:
            value: 10.35.64.11
        netapp1/netapp_server_port:
            value: 80
        netapp1/netapp_login:
            value: root
        netapp1/netapp_password:
            value: 123456
        netapp1/volume_backend_name:
            value: netapp_1
        netapp2/volume_driver: # 
5

            value: cinder.volume.drivers.netapp.common.NetAppDriver # 
6

        netapp2/netapp_storage_family:
            value: ontap_7mode
        netapp2/netapp_storage_protocol:
            value: iscsi
        netapp2/netapp_server_hostname:
            value: 10.35.64.11
        netapp2/netapp_server_port:
            value: 80
        netapp2/netapp_login:
            value: root
        netapp2/netapp_password:
            value: 123456
        netapp2/volume_backend_name:
            value: netapp_2
    cinder_user_enabled_backends: ['netapp1','netapp2'] # 
7
Copy to Clipboard

1
以下参数被设置为 false,因此禁用我们不需要的其他后端类型:
  • CinderEnableIscsiBackend :其他 iSCSI 后端。
  • CinderEnableRbdBackend: Red Hat Ceph.
  • CinderEnableNfsBackend: NFS。
  • NovaEnableRbdBackend: 临时 Red Hat Ceph Storage。
2
GlanceBackend 参数设置镜像服务应该用来存储镜像的内容。支持以下值:
  • file :将镜像存储在每个 Controller 节点上的 /var/lib/glance/images 中。
  • swift :将对象存储服务用于镜像存储。
  • cinder :使用块存储服务进行镜像存储。
3
ControllerExtraConfig 定义将应用到所有 Controller 节点的自定义设置。cinder::config::cinder_config 类意味着设置应当应用到块存储(cinder)服务。反过来,这意味着后端设置最终都会在每个 Controller 节点的 /etc/cinder/cinder.conf 文件中终止。
4
netapp1/volume_drivernetapp2/volume_driver 设置遵循 部分/设置 语法。使用块存储服务时,每个后端都在 /etc/cinder/cinder.conf 中的其自己的部分中定义。使用 netapp1 前缀的每个设置将在新的 [netapp1] 后端部分定义。
5
同样,netapp2 设置在单独的 [netapp2] 部分中定义。
6
value 前缀定义上述设置的值。
7
cinder_user_enabled_backends 类集并启用自定义后端。如名称所示,此类应仅用于启用了用户的后端;特别是,在 cinder::config::cinder_config 类中定义的后端。

不要使用 cinder_user_enabled_backends 列出后端,您可以通过 Director 启用原生启用。这包括支持的 NetApp 或 Dell 设备的 Red Hat Ceph、NFS 和单一后端。例如,如果您还启用了 Red Hat Ceph 后端,请不要在 cinder_user_enabled_backends 中列出它;相反,使用 CinderEnableRbdBackend: true 启用它。

注意

有关为 OpenStack Block Storage 定义 Red Hat Ceph 后端的更多信息,请参阅适用于 Overcloud 的 Red Hat Ceph Storage

] 描述了如何使用环境文件 xref:envfile[/home/stack/templates/custom-env.yaml 来编配自定义后端部署。要查看 /home/stack/templates/custom-env.yaml 中生成的 /etc/cinder/cinder.conf 设置,请参阅 第 A.2 节 “从示例环境文件生成的配置”

第 4 章 部署 Configured 后端

在 /home/stack/templates/ 中创建 custom-env.yaml 文件后,以 stack 用户身份登录。然后,运行以下命令来部署自定义后端配置:

$ openstack overcloud deploy --templates -e /home/stack/templates/custom-env.yaml
Copy to Clipboard
重要

如果您在创建 Overcloud 时传递任何额外的环境文件,请使用 -e 选项再次传递这些文件,以避免对 Overcloud 进行不必要的更改。

有关更多信息,请参阅 扩展 Overcloud更新 Overcloud

Director 完成编排后,测试后端。具体步骤请查看 第 5 章 测试 Configured 后端

第 5 章 测试 Configured 后端

将后端部署到 Overcloud 后,测试您是否可以在其中成功创建卷。这样做需要首先载入必要的环境变量。默认情况下,这些变量在 /home/stack/overcloudrc 中定义。

要载入这些变量,以 stack 用户身份运行以下命令:

$ source /home/stack/overcloudrc
Copy to Clipboard
注意

有关更多信息,请参阅 访问基本 Overcloud

接下来,为每个后端创建一个 卷类型。以 stack 用户身份登录 Overcloud 的 Controller 节点,再运行以下命令:

$ cinder type-create backend1
$ cinder type-create backend2
Copy to Clipboard

这些命令将创建卷类型 backend1 和 backend2,每个通过 xref:envfile 的 cinder::config::cinder_config 类定义的后端。

最后,将每种卷类型映射到通过 xref:envfile 的 cinder_user_enabled_backends 类启用的后端的 volume_backend_name。以下命令将卷类型 backend1 映射到 netapp1,将 backend2 映射到 netapp2 :

$ cinder type-key backend1 set volume_backend_name=netapp1
$ cinder type-key backend2 set volume_backend_name=netapp2
Copy to Clipboard

此时,您应该已准备好测试每个后端。要做到这一点,通过调用 backend1 卷类型,在 netapp1 后端上创建一个名为 netapp_volume_1 的 1GB 卷:

$ cinder create --volume-type backend1 --display_name netappvolume_1 1
Copy to Clipboard

同样,通过调用 backend2 卷类型,在 netapp2 后端上创建类似的卷:

$ cinder create --volume-type backend2 --display_name netappvolume_2 1
Copy to Clipboard

附录 A. 附录

A.1. stack 用户

创建 Director 安装用户 部分指示读者创建名为 stack 的用户,后者将用于部署 Overcloud。您可以使用 stack 帐户运行需要升级特权的命令,如部署后端(])或加载用于访问 Overcloud 所需的环境变量(xref:test[)。

可以说,如果您遵循 Director 安装和使用中的 说明,则 stack 用户将已存在。因此,根据需要使用它非常方便。

A.2. 从示例环境文件生成的配置

xref:envfile 中的环境文件会将块存储服务配置为使用两个 NetApp 后端。以下片段显示相关的设置:

enabled_backends = netapp1,netapp2

[netapp1]
volume_backend_name=netapp_1
volume_driver=cinder.volume.drivers.netapp.common.NetAppDriver
netapp_login=root
netapp_storage_protocol=iscsi
netapp_password=123456
netapp_storage_family=ontap_7mode
netapp_server_port=80
netapp_server_hostname=10.35.64.11

[netapp2]
volume_backend_name=netapp_2
volume_driver=cinder.volume.drivers.netapp.common.NetAppDriver
netapp_login=root
netapp_storage_protocol=iscsi
netapp_password=123456
netapp_storage_family=ontap_7mode
netapp_server_port=80
netapp_server_hostname=10.35.64.11
Copy to Clipboard

法律通告

Copyright © 2025 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat