Why do I get a Volume not attached
error when trying to expand a Block Storage for VPC volume?
Virtual Private Cloud
When you edit a Block Storage for VPC and update the spec.resources.requests.storage
section to expand your volume, you see the following error:
Volume not attached
You tried to expand the volume size of an existing Block Storage for VPC PVC that is not mounted by a pod. Only volumes mounted by app pods can be expanded.
Verify that your PVC supports volume expansion, then create an app pod that uses your PVC.
-
Describe your existing PVC. Verify that
allowVolumeExpansion
is set totrue
.kubectl describe pvc <pvc-name>
-
Create an app pod that uses your PVC and deploy it to your cluster.
-
Edit the PVC and increase the value in the
spec.resources.requests.storage
field.kubectl edit pvc <pvc-name>
-
Get the details of your PVC and make a note of the PV name.
kubectl get pvc <pvc-name>
-
Describe your PV and make a note of the volume ID
kubectl describe PV
-
Get the details of your Block Storage for VPC volume and verify the capacity.
ibmcloud is vol <volume-ID>