将 Overcloud 与现有 Red Hat Ceph Storage 集群集成


Red Hat OpenStack Platform 16.2

配置 overcloud 以使用独立 Red Hat Ceph Storage

OpenStack Documentation Team

摘要

您可以使用 Red Hat OpenStack Platform (RHOSP) director 将 overcloud 与现有的独立 Red Hat Ceph Storage 集群集成。

使开源包含更多

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。我们从这四个术语开始:master、slave、黑名单和白名单。由于此项工作十分艰巨,这些更改将在即将推出的几个发行版本中逐步实施。详情请查看 CTO Chris Wright 的信息

对红帽文档提供反馈

我们感谢您对文档提供反馈信息。与我们分享您的成功秘诀。

在 JIRA 中提供文档反馈

使用 Create Issue 表单对文档提供反馈。JIRA 问题将在 Red Hat OpenStack Platform Jira 项目中创建,您可以在其中跟踪您的反馈进度。

  1. 确保您已登录到 JIRA。如果您没有 JIRA 帐户,请创建一个帐户来提交反馈。
  2. 点击以下链接打开 Create Issue 页面: Create Issue
  3. 完成 SummaryDescription 字段。在 Description 字段中,包含文档 URL、章节或章节号以及问题的详细描述。不要修改表单中的任何其他字段。
  4. Create

第 1 章 将 overcloud 与 Ceph Storage 集成

Red Hat OpenStack Platform director 创建一个名为 overcloud 的云环境。您可以使用 director 为 overcloud 配置额外的功能,如与 Red Hat Ceph Storage 集成。您可以将 overcloud 与通过 director 或现有 Ceph Storage 集群创建的 Ceph 存储集群集成。

有关 Red Hat Ceph Storage 的更多信息,请参阅 Red Hat Ceph Storage 架构指南

1.1. 使用外部 CephFS 部署共享文件系统服务

您可以使用 Red Hat OpenStack Platform (RHOSP) director 使用 CephFS 部署共享文件系统服务(manila)。您可以将共享文件系统服务与 NFS 协议或原生 CephFS 协议搭配使用。

重要

您不能将共享文件系统服务与 CephFS 原生驱动程序一起使用,以通过 Manila CSI 向 Red Hat OpenShift Container Platform 提供共享。红帽不支持这种部署。如需更多信息,请联系红帽支持团队。

通过 NFS 使用 CephFS 的共享文件系统服务完全支持通过 Manila CSI 向 Red Hat OpenShift Container Platform 提供共享。这个解决方案不适用于大规模部署。有关 CSI 工作负载建议的详情请参考 https://access.redhat.com/articles/6667651

若要使用原生 CephFS 共享文件系统,客户端需要访问 Ceph 公共网络。将 overcloud 与现有 Ceph Storage 集群集成时,director 不会创建隔离的存储网络来指定为 Ceph 公共网络。此网络假定已存在。不要提供对 Ceph 公共网络的直接访问,而允许租户创建路由器以连接到 Ceph 公共网络。

NFS-Ganesha 网关

当您通过 NFS 协议使用 CephFS 时,director 在由 Pacemaker (PCS)管理的 Controller 节点上部署 NFS-Ganesha 网关。PCS 通过一个主动 - 被动(active-passive)配置来管理集群可用性。

Red Hat Ceph Storage 4.x (Ceph 软件包 14.x)和 Red Hat Ceph Storage 5.x (Ceph 软件包 16.x)支持 NFS-Ganesha 网关。有关如何确定系统上安装的 Ceph Storage 版本的信息,请参阅 Red Hat Ceph Storage 发行版本和对应的 Ceph 软件包版本

您必须在 undercloud 上安装 ceph-ansible 软件包的最新版本,如安装 ceph-ansible 软件包 中所述。

先决条件

在使用外部 Ceph Storage 集群配置共享文件系统服务前,请完成以下先决条件:

  • 验证您的外部 Ceph 存储集群是否具有活跃的元数据服务器(MDS):

    $ ceph -s
  • 外部 Ceph 存储集群必须具有 CephFS 数据和元数据池支持的 CephFS 文件系统。

    • 验证 CephFS 文件系统中的池:

      $ ceph fs ls
    • 记录这些池的名称,以配置 director 参数,ManilaCephFSDataPoolNameManilaCephFSMetadataPoolName。有关此配置的更多信息,请参阅创建自定义环境文件
  • 外部 Ceph 存储集群必须具有共享文件系统服务的 cephx 客户端名称和密钥。

    • 验证密钥环:

      $ ceph auth get client.<client name>
      • 将 <client name> 替换为您的 cephx 客户端名称。

1.2. 配置 Ceph 对象存储以使用外部 Ceph 对象网关

Red Hat OpenStack Platform (RHOSP) Director 支持将外部 Ceph 对象网关(RGW)配置为对象存储服务。要使用外部 RGW 服务进行身份验证,您必须配置 RGW,以验证用户及其在 Identity 服务(keystone)中的角色。

有关如何配置外部 Ceph 对象网关的更多信息,请参阅 Using Keystone with the Ceph Object Gateway Guide 中的 Configuring the Ceph Object Gateway to use Keystone authentication

第 2 章 准备 overcloud 节点

用于显示如何与 Red Hat Ceph Storage 集群集成的 overcloud 部署由 Controller 节点组成,并具有高可用性和 Compute 节点来托管工作负载。Red Hat Ceph Storage 集群具有自己的节点,您可以使用 Ceph 管理工具而不是通过 director 来独立于 overcloud 管理。有关 Red Hat Ceph Storage 的更多信息,请参阅 Red Hat Ceph Storage

2.1. 验证可用的 Red Hat Ceph Storage 软件包

为了帮助避免 overcloud 部署失败,请验证服务器上是否存在所需的软件包。

2.1.1. 验证 ceph-ansible 软件包版本

undercloud 包含基于 Ansible 的验证,您可以在部署 overcloud 前确定潜在的问题。这些验证可帮助您避免在发生之前识别常见问题来避免 overcloud 部署失败。

流程

  • 验证您要安装的 ceph-ansible 软件包版本:

    $ ansible-playbook -i /usr/bin/tripleo-ansible-inventory /usr/share/ansible/validation-playbooks/ceph-ansible-installed.yaml

2.1.2. 验证预置备节点的软件包

Red Hat Ceph Storage (RHCS)只能服务具有特定软件包集的 overcloud 节点。使用预置备节点时,您可以验证这些软件包是否存在。

有关预置备节点的更多信息,请参阅 使用预置备节点配置基本 overcloud

流程

  • 验证预置备节点是否包含所需的软件包:

    ansible-playbook -i /usr/bin/tripleo-ansible-inventory /usr/share/ansible/validation-playbooks/ceph-dependencies-installed.yaml

2.2. 配置现有的 Red Hat Ceph Storage 集群

要配置 Red Hat Ceph Storage 集群,您可以创建对象存储守护进程(OSD)池,定义功能,并在 Ceph Storage 集群上直接创建密钥和 ID。您可以从任何可访问 Ceph 存储集群的计算机执行命令,并安装了 Ceph 命令行客户端。

流程

  1. 在 Ceph Storage 集群中创建以下池,与您的环境相关:

    • OpenStack Block Storage (cinder)的存储:

      [root@ceph ~]# ceph osd pool create volumes <pgnum>
    • OpenStack Image Storage (glance)的存储:

      [root@ceph ~]# ceph osd pool create images <pgnum>
    • 实例存储:

      [root@ceph ~]# ceph osd pool create vms <pgnum>
    • OpenStack Block Storage 备份(cinder-backup)的存储:

      [root@ceph ~]# ceph osd pool create backups <pgnum>
    • 可选:OpenStack Telemetry Metrics (gnocchi)的存储:

      [root@ceph ~]# ceph osd pool create metrics <pgnum>

      仅在通过 OpenStack 启用指标时才使用此存储选项。如果您的 overcloud 使用 CephFS 部署 OpenStack Telemetry 指标,请创建 CephFS 数据和元数据池。

  2. 如果您的 overcloud 使用 Red Hat Ceph 4 (Ceph 软件包 14 或更早版本)部署共享文件系统服务(manila),请创建 CephFS 数据和元数据池:

    [root@ceph ~]# ceph osd pool create manila_data <pgnum>
    [root@ceph ~]# ceph osd pool create manila_metadata <pgnum>

    <pgnum> 替换为放置组数量。红帽建议集群中每个 OSD 大约 100 个放置组,以副本数划分(osd pool default size)。例如,如果存在 10 个 OSD,并且集群将 osd 池默认大小设置为 3,则使用 333 放置组。您还可以使用 每个池的 Ceph Placement Groups (PG)计算器 来确定合适的值。

  3. 如果您的 overcloud 使用 Red Hat Ceph 5 (Ceph 软件包 16)或更高版本部署共享文件系统服务(manila),则不需要为 CephFS 创建数据和元数据池。您可以创建文件系统卷。有关更多信息,请参阅 Red Hat Ceph Storage 操作指南中的使用 Ceph Orchestrator 管理 MDS 服务
  4. 使用以下功能在 Ceph 集群中创建 client.openstack 用户:

    • cap_mgr: allow114
    • cap_mon: profile rbd
    • cap_osd: profile rbd pool=volumes, profile rbd pool=vms, profile rbd pool=images, profile rbd pool=backups,

      [root@ceph ~]# ceph auth add client.openstack mgr allow * mon profile rbd osd profile rbd pool=volumes, profile rbd pool=vms, profile rbd pool=images, profile rbd pool=backups
  5. 请注意为 client.openstack 用户创建的 Ceph 客户端密钥:

    [root@ceph ~]# ceph auth list
    ...
    [client.openstack]
    	key = <AQC+vYNXgDAgAhAAc8UoYt+OTz5uhV7ItLdwUw==>
    	caps mgr = allow *
    	caps mon = profile rbd
    	caps osd = profile rbd pool=volumes, profile rbd pool=vms, profile rbd pool=images, profile rbd pool=backups
    ...

    示例中的 键值 AQC+vYNXgDAgAhAAc8UoYt+OTz5uhV7ItLdwUw== 是 Ceph 客户端密钥。

  6. 如果您的 overcloud 使用 CephFS 部署共享文件系统服务,请使用以下功能在 Ceph Storage 集群中创建 client.manila 用户:

    • cap_mds: allow114
    • cap_mgr: allow114
    • cap_mon: allow r, allow command "auth del", allow command "auth caps", allow command "auth get", allow command "auth get-or-create"'
    • cap_osd: allow rw

      [root@ceph ~]# ceph auth add client.manila mon allow r, allow command "auth del", allow command "auth caps", allow command "auth get", allow command "auth get-or-create"' osd 'allow rw' mds 'allow *' mgr 'allow *'
  7. 注意在 overcloud 部署模板中使用的 manila 客户端名称和键值:

    [root@ceph ~]# ceph auth get-key client.manila
         <AQDQ991cAAAAABAA0aXFrTnjH9aO39P0iVvYyg==>
  8. 请注意 Ceph Storage 集群的文件系统 ID。这个值在 fsid 字段中指定,在集群的配置文件的 [global] 部分下指定:

    [global]
    fsid = <4b5c8c0a-ff60-454b-a1b4-9747aa737d19>
    ...
注意

在创建自定义环境文件时,请使用 Ceph 客户端密钥和文件系统 ID,以及共享文件系统服务客户端 ID 和密钥。

第 3 章 与现有的 Ceph Storage 集群集成

要将 Red Hat OpenStack Platform (RHOSP)与现有 Red Hat Ceph Storage 集群集成,您必须安装 ceph-ansible 软件包。之后,您可以创建自定义环境文件来覆盖 OpenStack 组件中的配置选项值。

3.1. 安装 ceph-ansible 软件包

Red Hat OpenStack Platform director 使用 ceph-ansible 与现有 Ceph Storage 集群集成,但 undercloud 上不默认安装 ceph-ansible

流程

  • 输入以下命令在 undercloud 上安装 ceph-ansible 软件包:

    $ sudo dnf install -y ceph-ansible

3.2. 创建自定义环境文件

director 为 ceph-ansible 提供参数,以通过环境文件与外部 Red Hat Ceph Storage 集群集成:

/usr/share/openstack-tripleo-heat-templates/environments/ceph-ansible/ceph-ansible-external.yaml

如果您使用外部 CephFS 部署共享文件系统服务(manila),则单独的环境文件会提供额外的参数:

  • 对于原生 CephFS,环境文件为 /usr/share/openstack-tripleo-heat-templates/environments/manila-cephfsnative-config.yaml
  • 对于 CephFS through NFS,环境文件为 /usr/share/openstack-tripleo-heat-templates/environments/manila-cephfsganesha-config.yaml

要配置现有 Ceph Storage 集群与 overcloud 的集成,您必须使用自定义环境文件将 Ceph 存储集群的详细信息提供给 director。director 在部署期间调用这些环境文件。

流程

  1. 创建自定义环境文件:

    /home/stack/templates/ceph-config.yaml

  2. 在文件中添加 parameter_defaults: 部分:

    parameter_defaults:
  3. 使用 parameter_defaults 设置要在 /usr/share/openstack-tripleo-heat-templates/environments/ceph-ansible/ceph-ansible-external.yaml 中覆盖的所有参数。您必须至少设置以下参数:

    • CephClientKey :Ceph Storage 集群中 client.openstack 用户的 Ceph 客户端密钥。这是您在 配置现有 Ceph Storage 集群 中检索的键值。例如,AQ DLOh1VgEp6FRAAFzT7Zw+Y9V6JJExASPsRnRQ==
    • CephClusterFSID : Ceph 存储集群的文件系统 ID。这是 Ceph Storage 集群配置文件中的 fsid 值,您在配置 现有 Ceph Storage 集群 中检索。例如: 4b5c8c0a-ff60-454b-a1b4-9747aa737d19
    • CephExternalMonHost :以逗号分隔的 Ceph Storage 集群中所有 MON 主机的 IP 列表,如 172.16.1.7, 172.16.1.8

      例如:

      parameter_defaults:
        CephClientKey: <AQDLOh1VgEp6FRAAFzT7Zw+Y9V6JJExQAsRnRQ==>
        CephClusterFSID: <4b5c8c0a-ff60-454b-a1b4-9747aa737d19>
        CephExternalMonHost: <172.16.1.7, 172.16.1.8>
  4. 可选:您可以覆盖 Red Hat OpenStack Platform (RHOSP)客户端用户名和以下默认池名称以匹配 Ceph 存储集群:

    • CephClientUserName: <openstack>
    • NovaRbdPoolName: <vms>
    • CinderRbdPoolName: <volumes>
    • GlanceRbdPoolName: <images>
    • CinderBackupRbdPoolName: <backups>
    • GnocchiRbdPoolName: <metrics>
  5. 可选: 如果要使用 CephFS 部署共享文件系统服务,您可以覆盖默认数据和元数据池名称:

      ManilaCephFSDataPoolName: <manila_data>
      ManilaCephFSMetadataPoolName: <manila_metadata>
    注意

    确保这些名称与您创建的池名称匹配。

  6. 设置您为共享文件系统服务创建的客户端密钥。您可以覆盖该密钥的默认 Ceph 客户端用户名:

      ManilaCephFSCephFSAuthId: <manila>
      CephManilaClientKey: <AQDQ991cAAAAABAA0aXFrTnjH9aO39P0iVvYyg==>
    注意

    默认客户端用户名 ManilaCephFSCephFSAuthIdmanila,除非您覆盖它。CephManilaClientKey 始终是必需的。

创建自定义环境文件后,必须在部署 overcloud 时包括该文件。

其他资源

3.3. Ceph 容器用于带有 Ceph Storage 的 Red Hat OpenStack Platform

要将 Red Hat OpenStack Platform (RHOSP)配置为使用带有 NFS Ganesha 的 Red Hat Ceph Storage,您必须有一个 Ceph 容器。

要与 Red Hat Enterprise Linux 8 兼容,RHOSP 16 需要 Red Hat Ceph Storage 4 或 5 (Ceph 软件包 14.x 或 Ceph 软件包 16.x)。Ceph Storage 4 和 5 容器托管在 registry.redhat.io 中,这是需要身份验证的 registry。如需更多信息,请参阅 容器镜像准备参数

3.4. 部署 overcloud

使用您创建的环境文件部署 overcloud。

流程

  • 创建 overcloud 需要 openstack overcloud deploy 命令的额外参数:

    $ openstack overcloud deploy --templates \
      -e /usr/share/openstack-tripleo-heat-templates/environments/ceph-ansible/ceph-ansible-external.yaml \
      -e /home/stack/templates/ceph-config.yaml \
      -e --ntp-server pool.ntp.org \
      ...

    这个示例命令使用以下选项:

  • --templates - 从默认的 heat 模板集合 /usr/share/openstack-tripleo-heat-templates/ 创建 overcloud。
  • -e /usr/share/openstack-tripleo-heat-templates/environments/ceph-ansible/ceph-ansible-external.yaml - 设置 director 将现有 Ceph 集群集成到 overcloud。
  • -e /home/stack/templates/ceph-config.yaml - 添加自定义环境文件来覆盖 -e /usr/share/openstack-tripleo-heat-templates/environments/ceph-ansible/ceph-ansible-external.yaml 设置的默认值。在本例中,这是您在安装 ceph-ansible 软件包 中创建的自定义环境文件。
  • --ntp-server pool.ntp.org - 设置 NTP 服务器。

3.4.1. 使用 CephFS 为共享文件系统服务添加环境文件

如果部署使用 CephFS 的共享文件系统服务(manila)的 overcloud,您必须添加额外的环境文件。

流程

  1. 创建并添加额外的环境文件:

    • 如果您部署了使用原生 CephFS 后端驱动程序的 overcloud,请添加 /usr/share/openstack-tripleo-heat-templates/environments/manila-cephfsnative-config.yaml
    • 如果您部署通过 NFS 使用 CephFS 的 overcloud,请添加 /usr/share/openstack-tripleo-heat-templates/environments/manila-cephfsganesha-config.yaml

      红帽建议您使用导出共享的隔离 StorageNFS 网络部署 Ceph-through-NFS 驱动程序。您必须将隔离网络部署到 overcloud 控制器节点。要启用此部署,director 包括以下文件和角色:

      • 包含 StorageNFS 网络(/usr/share/openstack-tripleo-heat-templates/network_data_ganesha.yaml)的自定义网络配置文件示例。根据需要检查和自定义此文件。
      • ControllerStorageNFS 角色。
  2. 根据您使用的 CephFS 后端,修改 openstack overcloud deploy 命令。

    • 对于原生 CephFS:

       $ openstack overcloud deploy --templates \
         -e /usr/share/openstack-tripleo-heat-templates/environments/ceph-ansible/ceph-ansible-external.yaml \
         -e /usr/share/openstack-tripleo-heat-templates/environments/manila-cephfsnative-config.yaml \
         -e /home/stack/templates/ceph-config.yaml \
         -e --ntp-server pool.ntp.org
         ...
    • 对于 CephFS through NFS:

        $ openstack overcloud deploy --templates \
            -n /usr/share/openstack-tripleo-heat-templates/network_data_ganesha.yaml \
            -r /home/stack/custom_roles.yaml \
            -e /usr/share/openstack-tripleo-heat-templates/environments/ceph-ansible/ceph-ansible-external.yaml \
            -e /usr/share/openstack-tripleo-heat-templates/environments/manila-cephfsganesha-config.yaml \
            -e /home/stack/templates/ceph-config.yaml \
            -e --ntp-server pool.ntp.org
            ...
      注意

      自定义 ceph-config.yaml 环境文件会覆盖 ceph-ansible-external.yaml 文件中的参数,以及 manila-cephfsnative-config.yaml 文件或 manila-cephfsganesha-config.yaml 文件。因此,在 ceph-ansible-external.yamlmanila-cephfsnative-config.yamlmanila-cephfsganesha-config.yaml 后,在部署命令中包含自定义 ceph-config.yaml 环境文件。

      环境文件示例

      parameter_defaults:
          CinderEnableIscsiBackend: false
          CinderEnableRbdBackend: true
          CinderEnableNfsBackend: false
          NovaEnableRbdBackend: true
          GlanceBackend: rbd
          CinderRbdPoolName: "volumes"
          NovaRbdPoolName: "vms"
          GlanceRbdPoolName: "images"
          CinderBackupRbdPoolName: "backups"
          GnocchiRbdPoolName: "metrics"
          CephClusterFSID: <cluster_ID>
          CephExternalMonHost: <IP_address>,<IP_address>,<IP_address>
          CephClientKey: "<client_key>"
          CephClientUserName: "openstack"
          ManilaCephFSDataPoolName: manila_data
          ManilaCephFSMetadataPoolName: manila_metadata
          ManilaCephFSCephFSAuthId: 'manila'
          CephManilaClientKey: '<client_key>'
          ExtraConfig:
              ceph::profile::params::rbd_default_features: '1'

      • 根据您的具体环境,替换 <cluster_ID>, <IP_address>, 和 <client_key> 的值。

其他资源

3.4.2. 为对象存储添加外部 Ceph 对象网关(RGW)的额外环境文件

如果部署了使用已存在的 RGW 服务的 overcloud 进行对象存储,您必须添加额外的环境文件。

流程

  1. 将以下 parameter_defaults 添加到自定义环境文件,如 swift-external-params.yaml,并调整值以符合您的部署:

    parameter_defaults:
       ExternalSwiftPublicUrl: 'http://<Public RGW endpoint or loadbalancer>:8080/swift/v1/AUTH_%(project_id)s'
       ExternalSwiftInternalUrl: 'http://<Internal RGW endpoint>:8080/swift/v1/AUTH_%(project_id)s'
       ExternalSwiftAdminUrl: 'http://<Admin RGW endpoint>:8080/swift/v1/AUTH_%(project_id)s'
       ExternalSwiftUserTenant: 'service'
       SwiftPassword: 'choose_a_random_password'
    注意

    示例代码片段包含与您在环境中使用的值不同的参数值:

    • 远程 RGW 实例侦听 8080 的默认端口。端口可能根据配置外部 RGW 的不同而有所不同。
    • overcloud 中创建的 swift 用户使用 SwiftPassword 参数定义的密码。您必须将外部 RGW 实例配置为使用同一密码通过 rgw_keystone_admin_password 与 Identity 服务进行身份验证。
  2. 将以下代码添加到 Ceph 配置文件,将 RGW 配置为使用 Identity 服务。替换变量值以适合您的环境:

        rgw_keystone_api_version = 3
        rgw_keystone_url = http://<public Keystone endpoint>:5000/
        rgw_keystone_accepted_roles = member, Member, admin
        rgw_keystone_accepted_admin_roles = ResellerAdmin, swiftoperator
        rgw_keystone_admin_domain = default
        rgw_keystone_admin_project = service
        rgw_keystone_admin_user = swift
        rgw_keystone_admin_password = <password_as_defined_in_the_environment_parameters>
        rgw_keystone_implicit_tenants = true
        rgw_keystone_revocation_interval = 0
        rgw_s3_auth_use_keystone = true
        rgw_swift_versioning_enabled = true
        rgw_swift_account_in_url = true
    注意

    director 默认在 Identity 服务中创建以下角色和用户:

    • rgw_keystone_accepted_admin_roles: ResellerAdmin, swiftoperator
    • rgw_keystone_admin_domain: default
    • rgw_keystone_admin_project: service
    • rgw_keystone_admin_user: swift
  3. 使用与部署相关的任何其他环境文件,使用额外的环境文件部署 overcloud:

    openstack overcloud deploy --templates \
    -e <your_environment_files>
    -e /usr/share/openstack-tripleo-heat-templates/environments/swift-external.yaml
    -e swift-external-params.yaml

第 4 章 验证外部 Red Hat Ceph Storage 集群集成

部署 overcloud 后,确认 Red Hat OpenStack Platform (RHOSP)服务可以写入 Red Hat Ceph Storage 集群。

警告

RHOSP 不支持使用 Ceph 克隆格式 v2 或更高版本。从启用了 Ceph 克隆格式的 Ceph Storage 集群中删除镜像或卷可能会导致无法预计的行为和潜在的数据丢失。因此,不要使用以下任一方法来启用 Ceph 克隆格式 v2:

  • 设置 rbd 默认克隆格式 = 2
  • 运行 ceph osd set-require-min-compat-client 模拟

4.1. 收集 ID

要验证您集成了 Red Hat Ceph Storage 集群,您必须首先创建镜像、计算实例、块存储卷以及文件共享并收集其相应的 ID。

流程

  1. 使用镜像服务(glance)创建镜像。有关如何创建镜像的更多信息,请参阅创建和管理镜像指南中的导入镜像
  2. 记录镜像 ID 以供以后使用。
  3. 创建计算(nova)实例。有关如何创建实例的更多信息,请参阅创建和管理实例指南中的创建实例
  4. 记录实例 ID 以供以后使用。
  5. 创建 Block Storage (cinder)卷。有关如何创建块存储卷的更多信息,请参阅存储指南中的创建卷
  6. 记录卷 ID 以供以后使用。
  7. 使用共享文件系统服务(manila)创建文件共享。有关如何创建文件共享的更多信息,请参阅存储指南中的创建共享
  8. 列出共享的导出路径,并在后缀中记录 UUID,以便稍后使用。有关如何列出共享的导出路径的更多信息,请参阅存储指南中的 列出共享和导出信息

4.2. 验证 Red Hat Ceph Storage 集群

当您配置外部 Red Hat Ceph Storage 集群时,您可以创建池和一个 client.openstack 用户来访问这些池。部署 overcloud 后,您可以使用包含 client.openstack 用户凭证的文件来列出 Red Hat OpenStack Platform (RHOSP)池的内容。

列出池的内容,并确认 Ceph Storage 集群上存在镜像服务(glance)镜像的 ID、计算(nova)实例、块存储(cinder)卷和共享文件系统服务(manila)文件共享。

流程

  1. stack 用户身份登录 undercloud,再提供 stackrc 凭证文件:

    $ source ~/stackrc
  2. 列出可用的服务器以检索系统中节点的 IP 地址:

    $ openstack server list
    
    +---------------+----------------+---------------+
    | ID | Name | Status | Networks | Image | Flavor |
    +---------------+----------------+---------------+
    | d5a621bd-d109-41ae-a381-a42414397802 | compute-0 | ACTIVE | ctlplane=192.168.24.31 | overcloud-full | compute |
    | 496ab196-d6cb-447d-a118-5bafc5166cf2 | controller-0 | ACTIVE | ctlplane=192.168.24.37 | overcloud-full | controller |
    | c01e730d-62f2-426a-a964-b31448f250b3 | controller-2 | ACTIVE | ctlplane=192.168.24.55 | overcloud-full | controller |
    | 36df59b3-66f3-452e-9aec-b7e7f7c54b86 | controller-1 | ACTIVE | ctlplane=192.168.24.39 | overcloud-full | controller |
    | f8f00497-246d-4e40-8a6a-b5a60fa66483 | compute-1 | ACTIVE | ctlplane=192.168.24.10 | overcloud-full | compute |
  3. 使用 SSH 登录到任何 Compute 节点:

    $ ssh heat-admin@192.168.24.31
  4. 切换到 root 用户:

    [heat-admin@compute-0 ~]$ sudo su -
  5. 确认文件 /etc/ceph/ceph.conf/etc/ceph/ceph.client.openstack.keyring 存在:

    [root@compute-0 ~]# ls -l /etc/ceph/ceph.conf
    
    -rw-r--r--. 1 root root 1170 Sep 29 23:25 /etc/ceph/ceph.conf
    [root@compute-0 ~]# ls -l /etc/ceph/ceph.client.openstack.keyring
    
    -rw-------. 1 ceph ceph 253 Sep 29 23:25 /etc/ceph/ceph.client.openstack.keyring
  6. 输入以下命令强制 nova_compute 容器使用 rbd 命令列出适当池的内容。

    # podman exec nova_compute /usr/bin/rbd --conf /etc/ceph/ceph.conf --keyring /etc/ceph/ceph.client.openstack.keyring --cluster ceph --id openstack ls vms

    池名称必须与配置 Ceph Storage 集群时创建的镜像、虚拟机、卷和共享的池名称匹配。镜像、计算实例、卷和共享的 ID 必须与您在 Gathering ID 中记录的 ID 匹配。

    注意

    示例命令前缀为 podman exec nova_compute,因为 /usr/bin/rbd (由 ceph-common 软件包提供 )默认不安装在 overcloud 节点上。但是,它位于 nova_compute 容器中。命令列出块设备镜像。有关列出块设备镜像的更多信息,请参阅 Ceph Storage 块设备指南中的列出块设备镜像

    以下示例演示了如何使用 Gathering ID 中的 ID 来确认各个池的 ID 是否存在。

    # podman exec nova_compute /usr/bin/rbd --conf /etc/ceph/ceph.conf --keyring /etc/ceph/ceph.client.openstack.keyring --cluster ceph --id openstack ls images | grep 4485d4c0-24c3-42ec-a158-4d3950fa020b
    
    # podman exec nova_compute /usr/bin/rbd --conf /etc/ceph/ceph.conf --keyring /etc/ceph/ceph.client.openstack.keyring --cluster ceph --id openstack ls vms | grep 64bcb731-e7a4-4dd5-a807-ee26c669482f
    
    # podman exec nova_compute /usr/bin/rbd --conf /etc/ceph/ceph.conf --keyring /etc/ceph/ceph.client.openstack.keyring --cluster ceph --id openstack ls volumes | grep aeac15e8-b67f-454f-9486-46b3d75daff4
  7. 要验证共享文件系统服务共享是否存在,您必须登录到 Controller 节点:

    # podman exec openstack-manila-share-podman-0 ceph -n client.manila fs subvolume ls cephfs | grep ec99db3c-0077-40b7-b09e-8a110e3f73c1

4.3. 验证失败的故障排除

如果验证过程失败,请验证 openstack.client 用户和 Red Hat Ceph Storage 监控 IP 或主机名的 Ceph 密钥是否可以一起使用,从您为 Red Hat OpenStack Platform (RHOSP)创建的 Ceph 存储池中读取、写入和删除。

流程

  1. 要缩短输入的数量,请登录到 Compute 节点并为 rbd 命令创建别名:

    $ alias rbd="podman exec nova_compute /usr/bin/rbd --conf /etc/ceph/ceph.conf --keyring /etc/ceph/ceph.client.openstack.keyring --cluster ceph --id openstack"
  2. 确认您可以将测试数据写入池作为新对象:

    $ rbd create --size 1024 vms/foo
  3. 确认您可以看到测试数据:

    $ rbd ls vms | grep foo
  4. 删除测试数据:

    $ rbd rm vms/foo
注意

如果此步骤失败,请联系您的 Ceph 存储管理员寻求帮助。如果此步骤成功,但您无法创建计算(nova)实例、镜像服务(glance)镜像、块存储(cinder)卷或共享文件系统服务(manila)共享,请联系红帽支持。

法律通告

Copyright © 2024 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 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

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

© 2024 Red Hat, Inc.