3.4. 配置 control plane 以使用 Red Hat Ceph Storage 集群


您必须将 OpenStackControlPlane CR 配置为使用 Red Hat Ceph Storage 集群。配置包括以下任务:

  1. 确认 Red Hat Ceph Storage 集群和相关服务具有正确的网络配置。
  2. 配置 control plane 以使用 Red Hat Ceph Storage secret。
  3. 将镜像服务(glance)配置为使用 Red Hat Ceph Storage 集群。
  4. 将块存储服务(cinder)配置为使用 Red Hat Ceph Storage 集群。
  5. 可选:配置共享文件系统服务(manila),以将原生 CephFS 或 CephFS-NFS 与 Red Hat Ceph Storage 集群一起使用。
注意

本例不包括使用 Red Hat Ceph Storage 配置块存储备份服务(cinder-backup)。

流程

  1. 检查 NodeNetworkConfigurationPolicy (nncp)自定义资源中定义的存储接口,以确认它具有与 Red Hat Ceph Storage 集群 public_network 相同的网络配置。这需要通过 Storage 网络启用对 Red Hat Ceph Storage 集群的访问。Storage 网络应具有与 Red Hat Ceph Storage 集群的 public_network 相同的网络配置。

    RHOSO 不需要访问 Red Hat Ceph Storage 集群的 cluster_network

    注意

    如果不会影响工作负载性能,则存储网络可以使用路由(L3)连接从外部 Red Hat Ceph Storage 集群 public_network 不同,只要将适当的路由添加到 Storage 网络,以访问外部 Red Hat Ceph Storage 集群 public_network

  2. 检查 OpenStackControlPlane CR 中默认镜像服务的 networkAttachments,以确认默认镜像服务已配置为访问 存储网络

    glance:
        enabled: true
        template:
          databaseInstance: openstack
          storage:
            storageRequest: 10G
          glanceAPIs:
            default
              replicas: 3
              override:
                service:
                  internal:
                    metadata:
                      annotations:
                        metallb.universe.tf/address-pool: internalapi
                        metallb.universe.tf/allow-shared-ip: internalapi
                        metallb.universe.tf/loadBalancerIPs: 172.17.0.80
                    spec:
                      type: LoadBalancer
              networkAttachments:
              - storage
    Copy to Clipboard Toggle word wrap
  3. 确认块存储服务已配置为通过 MetalLB 访问存储网络。
  4. 可选:确认共享文件系统服务被配置为通过 ManilaShare 访问 存储网络
  5. 确认 Compute 服务(nova)已配置为访问 存储网络
  6. 确认 Red Hat Ceph Storage 配置文件 /etc/ceph/ceph.conf 包含 Red Hat Ceph Storage 集群监控器的 IP 地址。这些 IP 地址必须在 Storage 网络 IP 地址范围中。
  7. 打开 openstack_control_plane.yaml 文件,以编辑 OpenStackControlPlane CR。
  8. 添加 extraMounts 参数,以定义需要访问 Red Hat Ceph Storage secret 的服务。

    以下是为此目的使用 extraMounts 参数的示例。如果您使用共享文件系统服务(manila),只在传播列表中包括 ManilaShare

    apiVersion: core.openstack.org/v1beta1
    kind: OpenStackControlPlane
    spec:
      extraMounts:
        - name: v1
          region: r1
          extraVol:
            - propagation:
              - CinderVolume
              - GlanceAPI
              - ManilaShare
              extraVolType: Ceph
              volumes:
              - name: ceph
                projected:
                  sources:
                  - secret:
                      name: <ceph-conf-files>
              mounts:
              - name: ceph
                mountPath: "/etc/ceph"
                readOnly: true
    Copy to Clipboard Toggle word wrap
  9. customServiceConfig 参数添加到 glance 模板,将镜像服务配置为使用 Red Hat Ceph Storage 集群:

    apiVersion: core.openstack.org/v1beta1
    kind: OpenStackControlPlane
    metadata:
      name: openstack
    spec:
      glance:
        template:
          customServiceConfig: |
            [DEFAULT]
            enabled_backends = default_backend:rbd
            [glance_store]
            default_backend = default_backend
            [default_backend]
            rbd_store_ceph_conf = /etc/ceph/ceph.conf
            store_description = "RBD backend"
            rbd_store_pool = images
            rbd_store_user = openstack
          databaseInstance: openstack
          databaseAccount: glance
          secret: osp-secret
          storage:
            storageRequest: 10G
      extraMounts:
        - name: v1
          region: r1
          extraVol:
            - propagation:
              - GlanceAPI
              extraVolType: Ceph
              volumes:
              - name: ceph
                secret:
                  secretName: ceph-conf-files
              mounts:
              - name: ceph
                mountPath: "/etc/ceph"
                readOnly: true
    Copy to Clipboard Toggle word wrap

    当您将 Red Hat Ceph Storage 用作镜像服务的后端时,默认启用 image-conversion。如需更多信息,请参阅 规划 部署中的规划 存储和共享文件系统

  10. customServiceConfig 参数添加到 cinder 模板,将块存储服务配置为使用 Red Hat Ceph Storage 集群。有关使用块存储备份的详情 ,请参考配置块存储备份服务

    apiVersion: core.openstack.org/v1beta1
    kind: OpenStackControlPlane
    spec:
      extraMounts:
        ...
      cinder:
        template:
          cinderVolumes:
            ceph:
              customServiceConfig: |
                [DEFAULT]
                enabled_backends=ceph
                [ceph]
                volume_backend_name=ceph
                volume_driver=cinder.volume.drivers.rbd.RBDDriver
                rbd_ceph_conf=/etc/ceph/ceph.conf
                rbd_user=openstack
                rbd_pool=volumes
                rbd_flatten_volume_from_snapshot=False
                rbd_secret_uuid=$FSID 
    1
    Copy to Clipboard Toggle word wrap
    1
    使用实际的 FSID 替换。FSID 本身不需要被视为 secret。如需更多信息,请参阅 获取 Red Hat Ceph Storage FSID
  11. 可选:将 customServiceConfig 参数添加到 manila 模板,将共享文件系统服务配置为使用原生 CephFS 或 CephFS-NFS 和 Red Hat Ceph Storage 集群。如需更多信息,请参阅配置共享文件系统服务(manila)

    以下示例公开原生 CephFS:

    apiVersion: core.openstack.org/v1beta1
    kind: OpenStackControlPlane
    spec:
      extraMounts:
      ...
      manila:
        template:
          manilaAPI:
            customServiceConfig: |
              [DEFAULT]
              enabled_share_protocols=cephfs
          manilaShares:
            share1:
              customServiceConfig: |
                [DEFAULT]
                enabled_share_backends=cephfs
                [cephfs]
                driver_handles_share_servers=False
                share_backend_name=cephfs
                share_driver=manila.share.drivers.cephfs.driver.CephFSDriver
                cephfs_conf_path=/etc/ceph/ceph.conf
                cephfs_auth_id=openstack
                cephfs_cluster_name=ceph
                cephfs_volume_mode=0755
                cephfs_protocol_helper_type=CEPHFS
    Copy to Clipboard Toggle word wrap

    以下示例通过 NFS 公开 CephFS:

    apiVersion: core.openstack.org/v1beta1
    kind: OpenStackControlPlane
    spec:
      extraMounts:
      ...
      manila:
        template:
          manilaAPI:
            customServiceConfig: |
              [DEFAULT]
              enabled_share_protocols=nfs
          manilaShares:
            share1:
              customServiceConfig: |
                [DEFAULT]
                enabled_share_backends=cephfsnfs
                [cephfsnfs]
                driver_handles_share_servers=False
                share_backend_name=cephfsnfs
                share_driver=manila.share.drivers.cephfs.driver.CephFSDriver
                cephfs_conf_path=/etc/ceph/ceph.conf
                cephfs_auth_id=openstack
                cephfs_cluster_name=ceph
                cephfs_volume_mode=0755
                cephfs_protocol_helper_type=NFS
                cephfs_nfs_cluster_id=cephfs
    Copy to Clipboard Toggle word wrap
  12. 将更新应用到 OpenStackControlPlane CR:

    $ oc apply -f openstack_control_plane.yaml
    Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat