Lower case the response of the API should fix the problem
In linuxfc.py(within package os_brick.initiator), there is a function rescan_hosts, which leads to the map failure problem due to the fact that our REST API return WWNs in capital:
<Log snip – additional logs are added for the troubleshooting>
135 Jun 05 01:43:14 dellscfc nova-compute[2374]: DEBUG os_brick.initiator.linuxfc [None req-a5836dbd-8d83-4e32-99e2-890d887390da demo demo] *** Troubleshooting ***: Rescaning HBAs [{'host_device': u'host1', 'device_path': u'/sys/devices/pci0000:00/0000:00:02.0/0000:04:00.0/host1/fc_host/host1', 'port_name': u'2100000e1ed04968', 'node_name': u'2000000e1ed04968'}, {'host_device': u'host4', 'device_path': u'/sys/devices/pci0000:00/0000:00:02.0/0000:04:00.1/host4/fc_host/host4', 'port_name': u'2100000e1ed04969', 'node_name': u'2000000e1ed04969'}, {'host_device': u'host6', 'device_path': u'/sys/devices/pci0000:00/0000:00:03.0/0000:06:00.6/host6/fc_host/host6', 'port_name': u'2100000e1e3480e3', 'node_name': u'2000000e1e3480e3'}, {'host_device': u'host7', 'device_path': u'/sys/devices/pci0000:00/0000:00:03.0/0000:06:00.7/host7/fc_host/host7', 'port_name': u'2100000e1e3480e7', 'node_name': u'2000000e1e3480e7'}] with connection properties {u'initiator_target_map': {u'2100000E1ED04969': [u'5000D3100101D52F'], u'2100000E1ED04968': [u'5000D3100101D531']}, u'target_discovered': True, u'encrypted': False, u'qos_specs': None, u'discard': True, u'target_lun': 1, u'access_mode': u'rw', u'target_wwn': [u'5000D3100101D52F', u'5000D3100101D531']} {{(pid=2374) rescan_hosts /usr/local/lib/python2.7/dist-packages/os_brick/initiator/linuxfc.py:82}}
136 Jun 05 01:43:14 dellscfc nova-compute[2374]: DEBUG os_brick.initiator.linuxfc [None req-a5836dbd-8d83-4e32-99e2-890d887390da demo demo] *** Troubleshooting ***: target_lun 1 {{(pid=2374) rescan_hosts /usr/local/lib/python2.7/dist-packages/os_brick/initiator/linuxfc.py:89}}
137 Jun 05 01:43:14 dellscfc nova-compute[2374]: DEBUG os_brick.initiator.linuxfc [None req-a5836dbd-8d83-4e32-99e2-890d887390da demo demo] *** Troubleshooting ***: get_cts <bound method LinuxFibreChannel._get_hba_channel_scsi_target of <os_brick.initiator.linuxfc.LinuxFibreChannel object at 0x7fa13a63f690>> {{(pid=2374) rescan_hosts /usr/local/lib/python2.7/dist-packages/os_brick/initiator/linuxfc.py:90}}
138 Jun 05 01:43:14 dellscfc nova-compute[2374]: DEBUG os_brick.initiator.linuxfc [None req-a5836dbd-8d83-4e32-99e2-890d887390da demo demo] *** Troubleshooting ***: ports {u'2100000E1ED04969': [u'5000D3100101D52F'], u'2100000E1ED04968': [u'5000D3100101D531']} {{(pid=2374) rescan_hosts /usr/local/lib/python2.7/dist-packages/os_brick/initiator/linuxfc.py:91}}
139 Jun 05 01:43:14 dellscfc nova-compute[2374]: DEBUG os_brick.initiator.linuxfc [None req-a5836dbd-8d83-4e32-99e2-890d887390da demo demo] *** Troubleshooting ***: hbas [] {{(pid=2374) rescan_hosts /usr/local/lib/python2.7/dist-packages/os_brick/initiator/linuxfc.py:94}}
</Log snip>
In the function rescan_hosts, below code snip exists to filter HBAs:
<Code snip>
hbas = [hba for hba in hbas if hba['port_name'] in ports]
</Code snip>
Due to the fact that WWN in ports and hbas are with different case(lower in hbas, and capital in ports), the new list hbas will always be empty, then the following rescan operation will fail.
Fix proposed to branch: master /review. openstack. org/638178
Review: https:/