Fibre channel not scanning all targets
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
os-brick |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
When we try to discover a fibre channel device, we follow the following steps:
1. Find device in path "/dev/disk/
We require the following info to create the path: platform, pci_num, target_wwn, lun.
2. After the first scan, we either find the device (2.1) or not (2.2)
2.1 If the path exists and we are able to read from the device, it is a valid device for use and we exit the loop.
2.2 If the path doesn't show up, we follow the following steps:
2.2.1 Rescan HBAs
2.2.2 Based on the initiator target map, remove the initiator HBAs that don't have access to target
2.2.3 Find the CTL values by grep'ing into /sys/class/
grep -Gil <Target_WWN> /sys/class/
2.2.4 Perform a scan based on the HCTL values
echo "C T L" > /sys/class/
2.2.4 Repeat 1. until the the retries are exhausted (Default=3)
The problem with this approach is in the 2.2.3 step where we try to grep the CTLs from /sys/class/
Example: If we have 2 controllers on the backend side with 4 targets each
For the first LUN mapping from controller1, we will do a wildcard scan and find the 4 targets from controller1 which will get populated in the /fc_transport path.
If we try to do a LUN attachment from controller2, we try to find targets in the fc_transport path but it only contains targets from controller1 so we will not be able to discover the LUN.
Doing a manual wildcard scan will discover the targets from controller2.
So the /sys/class/
Fix proposed to branch: master /review. opendev. org/c/openstack /os-brick/ +/906743
Review: https:/