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-volumesapiVersion: 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_driver或target_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-
如果使用标签来限制运行块存储服务的节点,则必须使用
MachineConfigPool将MachineConfig的影响限制为服务可能运行的节点。如需更多信息,请参阅关于节点选择器。 -
如果您使用单一节点部署来测试流程,请在
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-
如果使用标签来限制运行块存储服务的节点,请使用
MachineConfigPool将MachineConfig的影响限制为服务运行的节点。如需更多信息,请参阅关于节点选择器。 -
如果使用单一节点部署来测试流程,请在
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-
如果使用标签来限制运行块存储服务的节点,您需要使用
MachineConfigPool将MachineConfig的影响限制为服务运行的节点。如需更多信息,请参阅关于节点选择器。 -
如果您使用单一节点部署来测试流程,请在
MachineConfig中将worker替换为master。 - Cinder 卷和备份默认配置为使用多路径。
-
如果您使用