3.5. 配置 control plane 以使用 Red Hat Ceph Storage 集群
将 OpenStackControlPlane CR 配置为使用 Red Hat Ceph Storage 集群。此过程包括确认网络配置、将 control plane 配置为使用 Red Hat Ceph Storage secret,以及设置镜像(glance)、块存储(cinder)和可选的共享文件系统服务(manila)服务。
本例不包括使用 Red Hat Ceph Storage 配置块存储备份服务(cinder-backup)。
流程
检查
NodeNetworkConfigurationPolicy(nncp)自定义资源中定义的存储接口,以确认它具有与 Red Hat Ceph Storage 集群public_network相同的网络配置。这需要通过 Storage 网络启用对 Red Hat CephStorage集群的访问。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。检查
OpenStackControlPlaneCR 中默认镜像服务的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-
确认块存储服务已配置为通过 MetalLB 访问存储网络。
-
可选:确认共享文件系统服务被配置为通过 ManilaShare 访问
存储网络。 -
确认 Compute 服务(nova)已配置为访问
存储网络。 -
确认 Red Hat Ceph Storage 配置文件
/etc/ceph/ceph.conf包含 Red Hat Ceph Storage 集群监控器的 IP 地址。这些 IP 地址必须在Storage网络 IP 地址范围中。 -
打开
openstack_control_plane.yaml文件,以编辑OpenStackControlPlaneCR。 添加
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-
将
<ceph-conf-files> 替换为 创建 Red Hat Ceph Storage secret 时创建的 Secret CR 的名称。
-
将
将
customServiceConfig参数添加到glance模板,将镜像服务配置为使用 Red Hat Ceph Storage 集群:apiVersion: core.openstack.org/v1beta1 kind: OpenStackControlPlane metadata: name: openstack spec: glance: template: customServiceConfig: | [DEFAULT] enabled_backends = <backend_name>:rbd [glance_store] default_backend = <backend_name> [<backend_name>] 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将
<backend_name> 替换为默认后端的名称。当您将 Red Hat Ceph Storage 用作镜像服务的后端时,默认启用
image-conversion。如需更多信息,请参阅 规划 部署中的规划 存储和共享文件系统。
将
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>-
将
<$FSID> 替换为实际的 FSID。FSID 本身不需要被视为 secret。如需更多信息,请参阅 获取 Red Hat Ceph Storage FSID。
-
将
可选:将
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以下示例通过 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将更新应用到
OpenStackControlPlaneCR:$ oc apply -f openstack_control_plane.yaml