Activity log for bug #1964395

Date Who What changed Old value New value Message
2022-03-09 18:33:26 Gorka Eguileor bug added bug
2022-03-09 18:34:42 Gorka Eguileor description The os-brick code skips half the subsystems when looking for the paths in the connected subsystems, and the half that doesn't skip just uses the wrong paths in the search. Offending code is: # Find nvme name among subsystems for i in range(0, int(len(subsystems) / 2)): subsystem = subsystems[i * 2] if 'NQN' in subsystem and subsystem['NQN'] == conn_nqn: for path in subsystems[i * 2 + 1]['Paths']: if (path['Transport'] == nvme_transport_type and path['Address'] == nvme_address): nvme_name = path['Name'] break This is because the code was written based on the output from an nvme client version that had a bug and returned the wrong json output, it returned each subsystem as 2 different elements on the list: { "Subsystems" : [ { "Name" : "nvme-subsys0", "NQN" : "nqn.2016-06.io.spdk:cnode1" }, { "Paths" : [ { "Name" : "nvme0", "Transport" : "rdma", "Address" : "traddr=10.0.2.15 trsvcid=4420", "Status" : "live" } ] } ] } Instead of returning the right output: { "Subsystems" : [ { "Name" : "nvme-subsys0", "NQN" : "nqn.2016-06.io.spdk:cnode1" "Paths" : [ { "Name" : "nvme0", "Transport" : "rdma", "Address" : "traddr=10.0.2.15 trsvcid=4420", "Status" : "live" } ] } ] } But this was fixed on commit 2a2d5b438cbd4c345cf6a4a79ad81e3413f9cc8f, so if the nvme version present in the system has that commit the os-brick code will not only be skipping half the entries, but it will also mix the paths from 2 different subsystems. The os-brick code skips half the subsystems when looking for the paths in the connected subsystems, and the half that doesn't skip just uses the wrong paths in the search. Offending code is: # Find nvme name among subsystems for i in range(0, int(len(subsystems) / 2)):     subsystem = subsystems[i * 2]     if 'NQN' in subsystem and subsystem['NQN'] == conn_nqn:         for path in subsystems[i * 2 + 1]['Paths']:             if (path['Transport'] == nvme_transport_type                     and path['Address'] == nvme_address):                 nvme_name = path['Name']                 break This is because the code was written based on the output from an nvme client version that had a bug and returned the wrong json output, it returned each subsystem as 2 different elements on the list on the "nvme list-subsys -o json" command run: {   "Subsystems" : [     {       "Name" : "nvme-subsys0",       "NQN" : "nqn.2016-06.io.spdk:cnode1"     },     {       "Paths" : [         {           "Name" : "nvme0",           "Transport" : "rdma",           "Address" : "traddr=10.0.2.15 trsvcid=4420",           "Status" : "live"         }       ]     }   ] } Instead of returning the right output: {   "Subsystems" : [     {       "Name" : "nvme-subsys0",       "NQN" : "nqn.2016-06.io.spdk:cnode1"       "Paths" : [         {           "Name" : "nvme0",           "Transport" : "rdma",           "Address" : "traddr=10.0.2.15 trsvcid=4420",           "Status" : "live"         }       ]     }   ] } But this was fixed on commit 2a2d5b438cbd4c345cf6a4a79ad81e3413f9cc8f, so if the nvme version present in the system has that commit the os-brick code will not only be skipping half the entries, but it will also mix the paths from 2 different subsystems.
2022-03-22 23:47:33 Sofia Enriquez os-brick: importance Undecided Medium
2022-03-23 12:13:01 Sofia Enriquez os-brick: status New Triaged
2022-03-31 17:59:27 OpenStack Infra os-brick: status Triaged In Progress
2022-07-25 17:24:25 OpenStack Infra os-brick: status In Progress Fix Released