1.8.4. RHOCP 准备块存储服务采用


在 Red Hat OpenShift Container Platform (RHOCP)节点中部署 Red Hat OpenStack Platform (RHOSP)之前,请确保网络已就绪,您决定要限制哪些 RHOCP 节点,并对 RHOCP 节点进行任何更改。

节点选择

您可能需要限制运行块存储服务卷和备份服务的 RHOCP 节点。

您需要限制特定块存储服务的节点的示例是使用 LVM 驱动程序部署块存储服务时。在这种情况下,卷仅存储在特定主机中的 LVM 数据,因此您需要将块存储卷服务固定到特定的 RHOCP 节点。在任何其他 RHOCP 节点上运行该服务不起作用。您不能使用 RHOCP 主机节点名称来限制 LVM 后端。您需要使用唯一标签、现有标签或新标签来识别 LVM 后端:

$ oc label nodes worker0 lvm=cinder-volumes
apiVersion: core.openstack.org/v1beta1
kind: OpenStackControlPlane
metadata:
  name: openstack
spec:
  secret: osp-secret
  storageClass: local-storage
  cinder:
    enabled: true
    template:
      cinderVolumes:
        lvm-iscsi:
          nodeSelector:
            lvm: cinder-volumes
< . . . >

有关节点选择的更多信息,请参阅关于节点选择器

注意

如果您的节点没有足够的本地磁盘空间用于临时镜像,您可以通过设置额外卷功能 extraMount 来使用远程 NFS 位置。

传输协议

RHOCP 可能需要对存储传输协议进行一些更改:

  • 如果您使用 MachineConfig 更改 RHOCP 节点,节点将重新引导。
  • 检查 cinder.conf 文件中的 enabled_backends 配置选项中列出的后端部分,以确定启用的存储后端部分。
  • 根据后端,您可以通过查看 volume_drivertarget_protocol 配置选项来查找传输协议。
  • iscsid 服务、multipathd 服务和 NVMe-TCP 内核模块在 data plane 节点上自动启动。

    NFS
    • RHOCP 在不进行其他更改的情况下连接到 NFS 后端。
    RADOS 块设备和 Red Hat Ceph Storage
    • RHOCP 无需额外更改即可连接到红帽 Ceph 存储后端。您必须为服务提供凭证和配置文件。
    iSCSI
    • 要连接到 iSCSI 卷,iSCSI 启动器必须在运行卷和备份服务的 RHOCP 主机上运行。Linux Open iSCSI 启动器不支持网络命名空间,因此您必须只针对正常的 RHOCP 使用运行一个服务实例,以及 RHOCP CSI 插件和 RHOSP 服务。
    • 如果您还没有在 RHOCP 节点上运行 iscsid,则必须应用 MachineConfig。例如:

      apiVersion: machineconfiguration.openshift.io/v1
      kind: MachineConfig
      metadata:
        labels:
          machineconfiguration.openshift.io/role: worker
          service: cinder
        name: 99-master-cinder-enable-iscsid
      spec:
        config:
          ignition:
            version: 3.2.0
          systemd:
            units:
            - enabled: true
              name: iscsid.service
    • 如果使用标签来限制运行块存储服务的节点,则必须使用 MachineConfigPoolMachineConfig 的影响限制为服务可能运行的节点。如需更多信息,请参阅关于节点选择器
    • 如果您使用单一节点部署来测试流程,请在 MachineConfig 中将 worker 替换为 master
    • 对于使用 iSCSI 卷的生产环境部署,请配置多路径以获得更好的 I/O。
    FC
    • 块存储服务卷和块存储服务备份服务必须在具有主机总线适配器(HBA)的 RHOCP 主机中运行。如果某些节点没有 HBA,则使用标签来限制这些服务的运行位置。如需更多信息,请参阅关于节点选择器
    • 如果您有使用 FC 的虚拟化 RHOCP 集群,则需要在虚拟机中公开主机 HBA。
    • 对于使用 FC 卷的生产环境部署,请配置多路径以获得更好的 I/O。
    NVMe-TCP
    • 要连接到 NVMe-TCP 卷,请在 RHOCP 主机上加载 NVMe-TCP 内核模块。
    • 如果您还没有在运行卷和备份服务的 RHOCP 节点上加载 nvme-fabrics 模块,则必须应用 MachineConfig。例如:

      apiVersion: machineconfiguration.openshift.io/v1
      kind: MachineConfig
      metadata:
        labels:
          machineconfiguration.openshift.io/role: worker
          service: cinder
        name: 99-master-cinder-load-nvme-fabrics
      spec:
        config:
          ignition:
            version: 3.2.0
          storage:
            files:
              - path: /etc/modules-load.d/nvme_fabrics.conf
                overwrite: false
                # Mode must be decimal, this is 0644
                mode: 420
                user:
                  name: root
                group:
                  name: root
                contents:
                  # Source can be a http, https, tftp, s3, gs, or data as defined in rfc2397.
                  # This is the rfc2397 text/plain string format
                  source: data:,nvme-fabrics
    • 如果使用标签来限制运行块存储服务的节点,请使用 MachineConfigPoolMachineConfig 的影响限制为服务运行的节点。如需更多信息,请参阅关于节点选择器
    • 如果使用单一节点部署来测试流程,请在 MachineConfig 中将 worker 替换为 master
    • 仅加载 nvme-fabrics 模块,因为它根据需要加载特定于传输的模块,如 TCP、RDMA 或 FC。
    • 对于使用 NVMe-TCP 卷的生产环境部署,使用多路径来获得更好的 I/O。对于 NVMe-TCP 卷,RHOCP 使用原生多路径,称为 ANA。
    • 在 RHOCP 节点重新引导并加载 nvme-fabrics 模块后,您可以通过检查主机来确认操作系统是否已配置,并支持 ANA:

      $ cat /sys/module/nvme_core/parameters/multipath
      重要

      ANA 不使用 Linux 多路径设备映射器,但 RHOCP 需要 multipathd 在 Compute 节点上运行,以便计算服务(nova)能够使用多路径。当多路径被置备时,会在 data plane 节点上自动配置多路径。

    多路径(Multipathing)
    • 对 iSCSI 和 FC 协议使用多路径。要在这些协议中配置多路径,您可以执行以下任务:

      • 准备 RHOCP 主机
      • 配置块存储服务
      • 准备 Compute 服务节点
      • 配置 Compute 服务
    • 要准备 RHOCP 主机,请使用 MachineConfig 确保在 RHOCP 主机上配置并运行 Linux 多路径设备映射器。例如:

      # Includes the /etc/multipathd.conf contents and the systemd unit changes
      apiVersion: machineconfiguration.openshift.io/v1
      kind: MachineConfig
      metadata:
        labels:
          machineconfiguration.openshift.io/role: worker
          service: cinder
        name: 99-master-cinder-enable-multipathd
      spec:
        config:
          ignition:
            version: 3.2.0
          storage:
            files:
              - path: /etc/multipath.conf
                overwrite: false
                # Mode must be decimal, this is 0600
                mode: 384
                user:
                  name: root
                group:
                  name: root
                contents:
                  # Source can be a http, https, tftp, s3, gs, or data as defined in rfc2397.
                  # This is the rfc2397 text/plain string format
                  source: data:,defaults%20%7B%0A%20%20user_friendly_names%20no%0A%20%20recheck_wwid%20yes%0A%20%20skip_kpartx%20yes%0A%20%20find_multipaths%20yes%0A%7D%0A%0Ablacklist%20%7B%0A%7D
          systemd:
            units:
            - enabled: true
              name: multipathd.service
    • 如果使用标签来限制运行块存储服务的节点,您需要使用 MachineConfigPoolMachineConfig 的影响限制为服务运行的节点。如需更多信息,请参阅关于节点选择器
    • 如果您使用单一节点部署来测试流程,请在 MachineConfig 中将 worker 替换为 master
    • Cinder 卷和备份默认配置为使用多路径。
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

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

让开源更具包容性

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

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部