nvmeof connector: get ready for nvme-cli 2.0

Bug #1961222 reported by Brian Rosmaita
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
os-brick
Fix Released
Medium
Gorka Eguileor

Bug Description

The nvmeof connector makes calls out to nvme-cli, for example, in create_hostnqn() in os_brick/privileged/nvmeof.py, where our code currently expects that the error_code will map to some errno.

A commit into nvme-cli that changes the exit code to always be either 0 or 1 [0] is in v2.0-rc2, so we can no longer rely on the error_code. Instead, we'll probably have to parse the error message (which, by the way, is sent to stdout; the output sent to stderr is useless).

[0] https://github.com/linux-nvme/nvme-cli/pull/1345/commits/13f74d20e1d9e571368b1d06fe9889a2fdd29849

Changed in os-brick:
status: New → Triaged
importance: Undecided → High
importance: High → Medium
Revision history for this message
Gorka Eguileor (gorka) wrote :
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.opendev.org/c/openstack/os-brick/+/895195

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

Reviewed: https://review.opendev.org/c/openstack/os-brick/+/895195
Committed: https://opendev.org/openstack/os-brick/commit/16ba8ed3967999ef8535074aa6d6cc2b09bca54d
Submitter: "Zuul (22348)"
Branch: master

commit 16ba8ed3967999ef8535074aa6d6cc2b09bca54d
Author: Gorka Eguileor <email address hidden>
Date: Thu Sep 14 14:34:07 2023 +0200

    NVMe-oF: Support nvme cli v2

    The nvme cli has changed its behavior, now they no longer differentiate
    between errors returning a different exit code.

    Exit code 1 is for errors and 0 for success.

    This patch fixes the detection of race conditions to also look for the
    message in case it's a newer CLI version.

    Together with change I318f167baa0ba7789f4ca2c7c12a8de5568195e0 we are
    ready for nvme CLI v2.

    Closes-Bug: #1961222
    Change-Id: Idf4d79527e1f03cec754ad708d069b2905b90d3f

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

Fix proposed to branch: stable/2023.2
Review: https://review.opendev.org/c/openstack/os-brick/+/905232

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/os-brick 6.6.0

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

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

Reviewed: https://review.opendev.org/c/openstack/os-brick/+/905232
Committed: https://opendev.org/openstack/os-brick/commit/2bd9cee754337a858d5ba168cda6cdafaa55a860
Submitter: "Zuul (22348)"
Branch: stable/2023.2

commit 2bd9cee754337a858d5ba168cda6cdafaa55a860
Author: Gorka Eguileor <email address hidden>
Date: Thu Sep 14 14:34:07 2023 +0200

    NVMe-oF: Support nvme cli v2

    The nvme cli has changed its behavior, now they no longer differentiate
    between errors returning a different exit code.

    Exit code 1 is for errors and 0 for success.

    This patch fixes the detection of race conditions to also look for the
    message in case it's a newer CLI version.

    Together with change I318f167baa0ba7789f4ca2c7c12a8de5568195e0 we are
    ready for nvme CLI v2.

    Closes-Bug: #1961222
    Change-Id: Idf4d79527e1f03cec754ad708d069b2905b90d3f
    (cherry picked from commit 16ba8ed3967999ef8535074aa6d6cc2b09bca54d)

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

Fix proposed to branch: stable/2023.1
Review: https://review.opendev.org/c/openstack/os-brick/+/905993

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

Reviewed: https://review.opendev.org/c/openstack/os-brick/+/905993
Committed: https://opendev.org/openstack/os-brick/commit/776864b43de8318ef3e08fd94693322ae2836434
Submitter: "Zuul (22348)"
Branch: stable/2023.1

commit 776864b43de8318ef3e08fd94693322ae2836434
Author: Gorka Eguileor <email address hidden>
Date: Thu Sep 14 14:34:07 2023 +0200

    NVMe-oF: Support nvme cli v2

    The nvme cli has changed its behavior, now they no longer differentiate
    between errors returning a different exit code.

    Exit code 1 is for errors and 0 for success.

    This patch fixes the detection of race conditions to also look for the
    message in case it's a newer CLI version.

    Together with change I318f167baa0ba7789f4ca2c7c12a8de5568195e0 we are
    ready for nvme CLI v2.

    Closes-Bug: #1961222
    Change-Id: Idf4d79527e1f03cec754ad708d069b2905b90d3f
    (cherry picked from commit 16ba8ed3967999ef8535074aa6d6cc2b09bca54d)
    (cherry picked from commit 2bd9cee754337a858d5ba168cda6cdafaa55a860)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/os-brick 6.4.1

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/os-brick 6.2.3

This issue was fixed in the openstack/os-brick 6.2.3 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.