# kubectl get pods
NAME READY STATUStest-pod-1 0/1 ContainerCreatingATTACHED:false
# kubectl get volumeattachment
NAME ATTACHER PV NODE ATTACHED AGEcsi-### csi.vsphere.vmware.com pvc-### test-node-1 false 21h
"The resource 'volume' is in use."
# kubectl describe volumeattachment csi-###
Attach Error: Message: rpc error: code = Internal desc = failed to attach disk: "####" with node: "###" err failed to attach cns volume: "###" to node vm: "VirtualMachine:vm-#### [VirtualCenterHost: ####, UUID: ###, Datacenter: Datacenter [Datacenter: Datacenter:datacenter-####, VirtualCenterHost: ###]]". fault: "(*types.LocalizedMethodFault)(0xc0055730c0)({\n DynamicData: (types.DynamicData) {\n },\n Fault: (*types.ResourceInUse)(0xc0018ecf80)({\n VimFault: (types.VimFault) {\n MethodFault: (types.MethodFault) {\n FaultCause: (*types.LocalizedMethodFault)(<nil>),\n FaultMessage: ([]types.LocalizableMessage) <nil>\n }\n },\n Type: (string) \"\",\n Name: (string) (len=6) \"volume\"\n }),\n LocalizedMessage: (string) (len=32) \"The resource 'volume' is in use.\"\n})\n". opId: "<opID>"
kubelet Unable to attach or mount volumes .... timed out waiting for the condition"# kubectl describe pod <pod_name> Warning FailedAttachVolume 33s (x2 over 2m35s) attachdetach-controller AttachVolume.Attach failed for volume "pvc-###" : rpc error: code = Internal desc = failed to attach disk: "###" with node: "###" err failed to attach cns volume: "###" to node vm: "VirtualMachine:vm-### [VirtualCenterHost: ###, UUID: ###, Datacenter: Datacenter [Datacenter: Datacenter:datacenter-####, VirtualCenterHost: ###]]". fault: "(*types.LocalizedMethodFault)(0xc0011f0f00)({\n DynamicData: (types.DynamicData) {\n },\n Fault: (*types.ResourceInUse)(0xc000f4cac0)({\n VimFault: (types.VimFault) {\n MethodFault: (types.MethodFault) {\n FaultCause: (*types.LocalizedMethodFault)(<nil>),\n FaultMessage: ([]types.LocalizableMessage) <nil>\n }\n },\n Type: (string) \"\",\n Name: (string) (len=6) \"volume\"\n }),\n LocalizedMessage: (string) (len=32) \"The resource 'volume' is in use.\"\n})\n". opId: "<opID>"
Warning FailedMount 21s (x3 over 4m53s) kubelet Unable to attach or mount volumes: unmounted volumes=[###], unattached volumes=[###], failed to process volumes=[]: timed out waiting for the condition
The Persistent Volume could not be mounted to the scheduled node (for example, test-node-1) because it was still attached to another worker node. Although the VolumeAttachment resource shows the PV as mounted on a node (test-node-1), in reality it remains attached elsewhere.
Before applying the Resolution in this KB, verify if the following KB is applicable : PV attachment to a pod fails with the error: 'The resource volume is in use'.
kubectl -n <namespace> delete pod <pod_name>