dell / csm

Dell Container Storage Modules (CSM)
Apache License 2.0
71 stars 16 forks source link

[BUG]: PowerStore CSI Driver report iSCSI target error while using FC only #64

Closed LeoHu1985 closed 3 years ago

LeoHu1985 commented 3 years ago

Describe the bug A clear and concise description of what the bug is.

PowerStore CSI driver is configured for FC connectivity, however its reporting "“AttachVolume.Attach failed for volume "csi-pstore-167d09d5dd" : rpc error: code = Internal desc = could not get iscsiTargets: can't get iscsi target address”" when using CSI to provision PVC from PowerStore.

Issue only resolved by config CSI with a fake iSCSI targets, then FC connectivity would work.

Looking at the code of "addTargetsInfoToPublishContext()", it seems the code would always check iSCSI target first then FC, if there is no ISCSI target configured, the provision would exit with error, it would not proceed with FC target check. This is not ideal, the code should skip ISCSI target check and proceed with FC targets check, if no ISCSI targets configured.

func (s *SCSIPublisher) addTargetsInfoToPublishContext( publishContext map[string]string, client gopowerstore.Client) error { iscsiTargetsInfo, err := common.GetISCSITargetsInfoFromStorage(client) if err != nil { return err } for i, t := range iscsiTargetsInfo { publishContext[fmt.Sprintf("%s%d", common.PublishContextISCSIPortalsPrefix, i)] = t.Portal publishContext[fmt.Sprintf("%s%d", common.PublishContextISCSITargetsPrefix, i)] = t.Target } fcTargetsInfo, err := common.GetFCTargetsInfoFromStorage(client) if err != nil { return err } for i, t := range fcTargetsInfo { publishContext[fmt.Sprintf("%s%d", common.PublishContextFCWWPNPrefix, i)] = t.WWPN } return nil }

To Reproduce Steps to reproduce the behavior:

  1. Step 1 configure CSI with FC connectivity without configuring iSCSI targets
  2. Step 2 try provision FC based PVC from Powerstore to pod n See error "“AttachVolume.Attach failed for volume "csi-pstore-167d09d5dd" : rpc error: code = Internal desc = could not get iscsiTargets: can't get iscsi target address”"

Expected behavior User should be able to provision FC based PVC from Powerstore without configuring iSCSI targets. The code of "addTargetsInfoToPublishContext()" should skip ISCSI target check and proceed with FC targets check if no ISCSI targets configured.

Screenshots If applicable, add screenshots to help explain your problem.

Logs If applicable, submit logs or stack traces from the affected services

System Information (please complete the following information):

Additional context Add any other context about the problem here.

harishp8889 commented 3 years ago

@LeoHu1985 Can you please share both controller and node logs.

prablr79 commented 3 years ago

@LeoHu1985 we understand you are seeing this issue, your logs will sure help us quickly address this issue in our release. appreciate your response.

LeoHu1985 commented 3 years ago

Its customer's environment, logs are not available anymore, will try to reproduce in DELL lab and get you the logs.

prablr79 commented 3 years ago

@LeoHu1985 Thank for the update!

gallacher commented 3 years ago

@LeoHu1985, closing the issue. Please feel free to reopen the issue when the necessary information is provided.