OpenShift - Resolve "Multi-Attach error for volume"

by
Jeremy Canfield |
Updated: October 27 2022
| OpenShift articles
Let's say the following is being returned when attempting to start a pod.
FailedAttachVolume pod/my-pod-4n89p Multi-Attach error for volume "pvc-2db07c57-e282-48e7-bfb1-4cbd7245c25e" Volume is already used by pod(s) my-pod-k8vr2
The oc describe persistentvolume command can be used to determine the Access Mode of the Persistent Volume (RWO in this example)
~]$ oc describe persistentvolume pvc-2db07c57-e282-48e7-bfb1-4cbd7245c25e
Name: pvc-2db07c57-e282-48e7-bfb1-4cbd7245c25e
Labels: <none>
Annotations: pv.kubernetes.io/provisioned-by: csi.trident.netapp.io
Finalizers: [kubernetes.io/pv-protection external-attacher/csi-trident-netapp-io]
StorageClass: file-storage
Status: Bound
Claim: my-namespace/my-persistent-volume-claim
Reclaim Policy: Delete
Access Modes: RWO
VolumeMode: Filesystem
Capacity: 1Gi
Node Affinity: <none>
Or, the oc get persistentvolume command can be used.
~]$ oc get persistentvolume pvc-2db07c57-e282-48e7-bfb1-4cbd7245c25e --output jsonpath={.spec.accessModes[*]}
ReadWriteOnce
Notice in this example that the Persistent Volume Access Mode is ReadWriteOnce (RWO).
- ReadWriteOnce (RWO) - The volume may only be mounted on a single node
- ReadWriteOncePod (RWOP) - The volume may only be mounted on a single pod
- ReadOnlyMany (ROX) - The volume may be mounted on different nodes
- ReadWriteMany (RWX) - The volume can be mounted on different nodes
The oc get pods command with the --output wide option can be used to see that the pod that already has the Persistent Volume mounted (my-pod-k8vr2) is running on node worker-hsjrp, and the Persistent Volume could not be attached to my-pod-4n89p because the pod is running on a different node (worker-v8r9r).
~]# oc get pods -o wide --namespace project001
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED MODE
my-pod-k8vr2 1/1 Running 0 8d 10.142.118.51 worker-hsjrp <none>
my-pod-4n89p 0/1 ContainerCreating 0 12m <none> worker-v8r9r <none>
Did you find this article helpful?
If so, consider buying me a coffee over at