尝试扩展 Block Storage for VPC 卷时,为什么会收到 Volume not attached 错误?

排查无法挂载到 Pod 的块存储卷的问题。

虚拟私有云

编辑 Block Storage for VPC 并更新 spec.resources.requests.storage 部分以扩展卷时,会出现以下错误:

Volume not attached

您试图扩展现有 Block Storage for VPC PVC 的卷大小,但该 PVC 未被 pod 挂载。 只能展开由应用程序 pod 安装的卷。

验证 PVC 是否支持卷扩展,然后创建使用 PVC 的应用程序 pod。

  1. 说明现有的 PVC 并验证 allowVolumeExpansion 是否设置为 true

    oc describe pvc <pvc-name>
    
  2. 创建使用 PVC 的应用程序 pod 并将其部署到集群。

  3. 编辑 PVC 并增大 spec.resources.requests.storage 字段中的值。

    oc edit pvc <pvc-name>
    
  4. 获取 PVC 的详细信息,并记录 PV 名称。

    oc get pvc <pvc-name>
    
  5. 描述您的 PV 并记下卷 ID。

    oc describe PV
    
  6. 获取 Block Storage for VPC 卷的详细信息并验证容量。

    ibmcloud is vol <volume-ID>