Resolved: FailedAttachVolume in openshift for FC storage

Question:

I have created following yaml files
  • fc-pod.yaml
  • fc-pvc.yaml

when i create fc pod it always goes to ContainerCreating state and give me the following error when i describe the pod.

Warning FailedAttachVolume 83s attachdetach-controller AttachVolume.Attach failed for volume "csiunity-d93a52838d" : rpc error: code = InvalidArgument desc = runid=95 Cannot publish volume as protocol in the Storage class is ‘FC’ but the node has no valid FC initiators Warning FailedMount 29s kubelet Unable to attach or mount volumes: unmounted volumes=[dy-fc-unity], unattached volumes=[dy-fc-unity kube-api-access-psrcp]: timed out waiting for the condition Warning FailedAttachVolume 19s attachdetach-controller AttachVolume.Attach failed for volume "csiunity-d93a52838d" : rpc error: code = InvalidArgument desc = runid=96 Cannot publish volume as protocol in the Storage class is ‘FC’ but the node has no valid FC initiators


I have created pvc, storage classes and secrets etc. I have already created nfs and iscsi pods with the same method and they are created.
please check my fc-pod.yaml file below
apiVersion: v1
kind: Pod
metadata:
  name: dynamic-fc-pod
  namespace: unity
spec:
  containers:
  - name: container
    image: nginx
    ports:
      - containerPort: 80
        name: "http-server"
    volumeMounts:
      - mountPath: "/usr/share/nginx/html"
        name: dy-fc-unity
  volumes:
    - name: dy-fc-unity
      persistentVolumeClaim:
        claimName: dynamic-fc-pvc

Answer:

I found that I have fc connectivity issue on the backend. thats why FC pods were not creating.
If you faced similar problem, solve it with
  1. Change nginx image tag.
  2. Check fc connectivity
  3. Check protocol in storage class
  4. Delete the pvc and pod
  5. When creating again change container name

If you have better answer, please add a comment about this, thank you!

Source: Stackoverflow.com

If you like this answer, you can give me a coffee by click here (view Ads)