Comment 5 for bug 2016029

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/+/905988
Committed: https://opendev.org/openstack/os-brick/commit/5ab069ab2eebbf942ecf2577399d1da924bac782
Submitter: "Zuul (22348)"
Branch: stable/2023.1

commit 5ab069ab2eebbf942ecf2577399d1da924bac782
Author: whoami-rajat <email address hidden>
Date: Thu Aug 24 12:02:43 2023 +0000

    NVMe-oF: Create /etc/nvme/hostid

    The NVMe-oF connector currently create the `/etc/nvme/hostnqn` file if
    it doesn't exist, but it may still be missing the `/etc/nvme/hostid`
    value.

    Some distribution packages create the file on installation but others
    may not.

    It is recommended for the file to be present so that nvme doesn't
    randomly generate it.

    Randomly generating it means that the value will be different for the
    same storage array and the same volume if we connect, disconnect, and
    connect the volume again.

    This patch ensures that the file will exist and will try to use the
    system's UUID as reported by DMI or a randomly generated one.

    BACKPORT NOTE: This patch also includes another patch fixing unittests
                   Otherwise tests would fail

      Fix unit tests when hostid file exists

      After merging change I0b60f9078f23f8464d8234841645ed520e8ba655, we
      noticed an issue with existing unit tests which started failing.
      The reason is 'nvme_hostid' was an additional parameter returned
      in the response while fetching connector properties from nvme
      connector.
      This is environment specific and won't occur in environments where
      '/etc/nvme/hostid' file doesn't exist due to which these tests
      passed in gate but failed in the local run when hostid file
      was present.
      This patch mocks the get_nvme_host_id method for tests so the
      hostid is never returned irrespective of the environment.

      Closes-Bug: #2032941
      Change-Id: I8b1aaedfdb9bef6e34813e39dede9afe98371d2b
      (cherry picked from commit 71627c56ac14bd3d31e78979d430eccee9a92d91)

    Closes-Bug: #2016029
    Change-Id: I0b60f9078f23f8464d8234841645ed520e8ba655
    (cherry picked from commit 16c90d5fe97da04c7c42cbd3fe5505153ce95a91)