Sc FC driver api fails due to uppercase wwns api response

Bug #1775677 reported by Rajini Karthik
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
os-brick
Fix Released
Undecided
Gorka Eguileor

Bug Description

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.

Changed in os-brick:
assignee: nobody → Rajini Karthik (rajini-karthik)
Changed in os-brick:
assignee: Rajini Karthik (rajini-karthik) → nobody
Gorka Eguileor (gorka)
Changed in os-brick:
assignee: nobody → Gorka Eguileor (gorka)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to os-brick (master)

Fix proposed to branch: master
Review: https://review.openstack.org/638178

Changed in os-brick:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to os-brick (master)

Reviewed: https://review.openstack.org/638178
Committed: https://git.openstack.org/cgit/openstack/os-brick/commit/?id=037f9fe66768a99f3792d014b67ccf7d71e744c5
Submitter: Zuul
Branch: master

commit 037f9fe66768a99f3792d014b67ccf7d71e744c5
Author: Gorka Eguileor <email address hidden>
Date: Tue Feb 19 18:00:22 2019 +0100

    Fix FC case sensitive scanning

    For FC connections there are multiple places where we check the
    initiator target map provided by the backend against the port names of
    the HBAs on the system.

    Currently this check is case sensitive, but some backends are returning
    the port names in the initiator target map upper cased, which usually
    results in attach failures.

    Some of the reasons for the attach failures is that os-brick will not
    issue scan requests.

    Example from a 3PAR backend from a specific system:

      Connector properties:
        {
         'wwpns': ['10001409dcd71ff6', '10001409dcd71ff7'],
         'wwnns': ['20001409dcd71ff6', '20001409dcd71ff7'],
         ...
        }

      Connection properties:
        {
         'initiator_target_map': {
           '10001409DCD71FF6': ['20320002AC01E166', '21420002AC01E166'],
           '10001409DCD71FF7': ['20410002AC01E166', '21410002AC01E166']
         }
         ...
        }

    This patch converts to lower case the
    initiator_target_map and the target_wwn/target_wwns.

    Closes-Bug: #1775677
    Change-Id: I12b9535d8a9969356394e406a1ed5ac4a5f1f959

Changed in os-brick:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/os-brick 2.8.0

This issue was fixed in the openstack/os-brick 2.8.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to os-brick (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.openstack.org/647761

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to os-brick (stable/rocky)

Reviewed: https://review.openstack.org/647761
Committed: https://git.openstack.org/cgit/openstack/os-brick/commit/?id=00a4d96d2506bed5c5507282a774bc75df9f790f
Submitter: Zuul
Branch: stable/rocky

commit 00a4d96d2506bed5c5507282a774bc75df9f790f
Author: Gorka Eguileor <email address hidden>
Date: Tue Feb 19 18:00:22 2019 +0100

    Fix FC case sensitive scanning

    For FC connections there are multiple places where we check the
    initiator target map provided by the backend against the port names of
    the HBAs on the system.

    Currently this check is case sensitive, but some backends are returning
    the port names in the initiator target map upper cased, which usually
    results in attach failures.

    Some of the reasons for the attach failures is that os-brick will not
    issue scan requests.

    Example from a 3PAR backend from a specific system:

      Connector properties:
        {
         'wwpns': ['10001409dcd71ff6', '10001409dcd71ff7'],
         'wwnns': ['20001409dcd71ff6', '20001409dcd71ff7'],
         ...
        }

      Connection properties:
        {
         'initiator_target_map': {
           '10001409DCD71FF6': ['20320002AC01E166', '21420002AC01E166'],
           '10001409DCD71FF7': ['20410002AC01E166', '21410002AC01E166']
         }
         ...
        }

    This patch converts to lower case the
    initiator_target_map and the target_wwn/target_wwns.

    Closes-Bug: #1775677
    Change-Id: I12b9535d8a9969356394e406a1ed5ac4a5f1f959
    (cherry picked from commit 037f9fe66768a99f3792d014b67ccf7d71e744c5)
    Conflicts:
     os_brick/initiator/connectors/fibre_channel.py

tags: added: in-stable-rocky
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/os-brick 2.5.7

This issue was fixed in the openstack/os-brick 2.5.7 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to os-brick (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.opendev.org/659281

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to os-brick (stable/queens)

Reviewed: https://review.opendev.org/659281
Committed: https://git.openstack.org/cgit/openstack/os-brick/commit/?id=bdd05d22328a61d9e284317614884d5bcb133863
Submitter: Zuul
Branch: stable/queens

commit bdd05d22328a61d9e284317614884d5bcb133863
Author: Gorka Eguileor <email address hidden>
Date: Tue Feb 19 18:00:22 2019 +0100

    Fix FC case sensitive scanning

    For FC connections there are multiple places where we check the
    initiator target map provided by the backend against the port names of
    the HBAs on the system.

    Currently this check is case sensitive, but some backends are returning
    the port names in the initiator target map upper cased, which usually
    results in attach failures.

    Some of the reasons for the attach failures is that os-brick will not
    issue scan requests.

    Example from a 3PAR backend from a specific system:

      Connector properties:
        {
         'wwpns': ['10001409dcd71ff6', '10001409dcd71ff7'],
         'wwnns': ['20001409dcd71ff6', '20001409dcd71ff7'],
         ...
        }

      Connection properties:
        {
         'initiator_target_map': {
           '10001409DCD71FF6': ['20320002AC01E166', '21420002AC01E166'],
           '10001409DCD71FF7': ['20410002AC01E166', '21410002AC01E166']
         }
         ...
        }

    This patch converts to lower case the
    initiator_target_map and the target_wwn/target_wwns.

    Closes-Bug: #1775677
    Change-Id: I12b9535d8a9969356394e406a1ed5ac4a5f1f959
    (cherry picked from commit 037f9fe66768a99f3792d014b67ccf7d71e744c5)
    Conflicts:
     os_brick/initiator/connectors/fibre_channel.py
    (cherry picked from commit 00a4d96d2506bed5c5507282a774bc75df9f790f)

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/os-brick 2.3.8

This issue was fixed in the openstack/os-brick 2.3.8 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.