7.4. 在 Red Hat OpenStack Platform 上的 HA 集群中配置块存储资源
以下流程为 RHOSP 上的 HA 集群创建块存储资源。此流程使用 clouds.yaml 文件进行 RHOSP 身份验证。
先决条件
- 在 RHOSP 上运行配置的 HA 集群
- 由 RHOSP 管理员创建的块存储卷
- 使用您要用于集群配置的 RHOSP 验证方法访问 RHOSP API,如 为 RHOSP 建立一个身份验证方法 中所述
流程
从集群中的任何节点完成以下步骤。
要查看
openstack-cinder-volume资源代理的选项,请运行以下命令:# pcs resource describe openstack-cinder-volume确定您要配置为集群资源的块存储卷卷 ID。
运行以下命令以显示包括每个卷的 UUID 和名称的可用卷表。
# openstack --os-cloud=ha-example volume list | ID | Name | | 23f67c9f-b530-4d44-8ce5-ad5d056ba926| testvolume-cinder-data-disk |如果您已经知道卷名称,您可以运行以下命令,指定您要配置的卷。这将显示一个带有 ID 字段的表。
# openstack --os-cloud=ha-example volume show testvolume-cinder-data-disk创建块存储资源,为卷指定 ID。
# pcs resource create cinder-vol openstack-cinder-volume volume_id="23f67c9f-b530-4d44-8ce5-ad5d056ba926" cloud="ha-example"配置排序约束,以确保
openstack-info资源在块存储资源前启动。# pcs constraint order start openstack-info-clone then cinder-vol Adding openstack-info-clone cinder-vol (kind: Mandatory) (Options: first-action=start then-action=start配置位置约束,以确保块存储资源与
openstack-info资源在同一节点上运行。# pcs constraint colocation add cinder-vol with openstack-info-clone score=INFINITY
验证
验证资源限制配置。
# pcs constraint config Location Constraints: Ordering Constraints: start openstack-info-clone then start cinder-vol (kind:Mandatory) Colocation Constraints: cinder-vol with openstack-info-clone (score:INFINITY)检查集群状态,以验证资源是否正在运行。
# pcs status . . . Full List of Resources: * Clone Set: openstack-info-clone [openstack-info]: * Started: [ node01 node02 node03 ] * cinder-vol (ocf::heartbeat:openstack-cinder-volume): Started node03 * fenceopenstack (stonith:fence_openstack): Started node01