'FailedAttachVolume in openshift for FC storage

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


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source