为什么我的 OpenShift 数据基础存储集群的状态一直停留在“Failed to reconcile”?
虚拟私有云 传统基础设施
在创建 OpenShift Data Foundation存储集群并运行 oc describe storagecluster <storage-cluster-name> 时,会出现一条错误提示,指出PVC名称超过了 Kubernetes 的字符限制。
设备集是一组 OSD( Object Storage 守护进程),OpenShift Data Foundation 利用这些设备集在您的集群中分发数据。 创建存储集群时,OpenShift Data Foundation 会自动为这些设备集创建 PVC。
执行 describe 命令时,你会看到类似以下示例的错误信息。
ceph-cluster-controller: failed to reconcile. failed to reconcile cluster "ocs-storagecluster-cephcluster": failed to configure local ceph cluster: failed to create cluster: failed to start ceph osds: 3 failures encountered while running osds in namespace openshift-storage: failed to create "provision" job for node "ocs-deviceset-ibmc-vpc-block-metro-retain-10iops-tier-0-datnv6k". Job.batch "rook-ceph-osd-prepare-aaa000aaa111a1a0e10ba1a11aa1a119" is invalid: [spec.template.spec.volumes[8].name: Invalid value: "ocs-deviceset-ibmc-vpc-block-metro-retain-10iops-tier-0-aaaaa1b-bridge": must be no more than 63 characters
Kubernetes PVC名称的长度必须少于63个字符。 如果您拥有一个多区域 VPC 集群,并且使用类似 ibmc-vpc-block-metro-retain-10iops-tier 的“retain”存储类来创建 OpenShift Data Foundation 存储集群,则相应的设备集 PVC 被分配的名称将超过 63 个字符的限制。
创建一个名称更短的自定义存储类,以确保生成的 PVC 名称不超过 Kubernetes 设定的字符限制。
-
获取要在 ODF 存储集群中使用的存储类的 YAML 配置,并将其保存在本地机器上的文件中。
oc get sc ibmc-vpc-block-metro-retain-10iops-tier -o yaml -
编辑存储类的名称。 请确保存储类的名称长度不超过 30 个字符,以便 OpenShift Data Foundation 存储集群设备集 ID 的长度能控制在 63 个字符以内,符合 Kubernetes 的限制要求。 在集群中创建存储类。
oc create -f <custom-storage-class.yaml> -
创建一个 OpenShift 数据基础部署,该部署使用您创建的存储类。