hostnqn fails to automatically generate after installing nvme-cli

Bug #1867366 reported by Jennifer Duong
22
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nvme-cli (Debian)
Fix Released
Unknown
nvme-cli (Ubuntu)
Fix Released
Low
Dan Streetman
Bionic
Fix Released
Low
Dan Streetman
Focal
Fix Released
Low
Dan Streetman
Groovy
Fix Released
Low
Dan Streetman

Bug Description

[impact]

"nvme gen-hostnqn" does not work, leading to no content in /etc/nvme/hostnqn

also, /etc/nvme/hostid is generated at build time instead of install time, leading to a hardcoded value for all systems, while the file is supposed to contain a unique value (uuid) for the system

[test case]

hostnqn tests:

$ cat /etc/nvme/hostnqn

$ nvme gen-hostnqn
"gen-hostnqn" not supported. Install lib uuid and rebuild.

hostid test for unique value:

$ cat /etc/nvme/hostid
9ce77162-5a3e-439b-a73f-cdf2449521b6

(that specific uuid is hardcoded into the nvme-cli 1.9-1 package)

[regression potential]

any regression would likely involve a failure of nvme to interact with nvmeof devices, or for other systems connecting to this nvme fabric target to encounter errors

also, the upload for Focal includes a postinst check for the hardcoded hostid value (from the 1.9-1 package), and if it's found *and* the hostnqn is not set (meaning the system has not been setup yet), it regenerates it (so the host has a unique generated value). Any regression in this area would likely involve the same issues as above with NVMEoF problems, either in connecting or operating the system as a target.

see comments 11-17 for more analysis of the issue and regression potential.

[scope]

xenial does not include the gen-hostnqn command, so this is needed only for bionic and later.

in bionic, the 'gen-hostnqn' command exists, but the /etc/nvme/hostnqn file is not (yet) provided by the package, however per recommendation in comment 17, the postinst script is being added to the bionic upload, so the hostid and hostnqn files will be generated at package installation.

[other info]

to fix this in debian:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=969183
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=969340

[original description]

hostnqn fails to automatically generate after installing nvme-cli

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: nvme-cli 1.9-1
ProcVersionSignature: Ubuntu 5.4.0-9.12-generic 5.4.3
Uname: Linux 5.4.0-9-generic x86_64
ApportVersion: 2.20.11-0ubuntu18
Architecture: amd64
Date: Fri Mar 6 14:09:20 2020
Dependencies:
 gcc-9-base 9.2.1-21ubuntu1
 libc6 2.30-0ubuntu3
 libgcc1 1:9.2.1-21ubuntu1
 libidn2-0 2.2.0-2
 libunistring2 0.9.10-2
InstallationDate: Installed on 2020-03-05 (0 days ago)
InstallationMedia: Ubuntu-Server 20.04 LTS "Focal Fossa" - Alpha amd64 (20200124)
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: nvme-cli
UpgradeStatus: No upgrade log present (probably fresh install)
modified.conffile..etc.nvme.hostnqn: [modified]
mtime.conffile..etc.nvme.hostnqn: 2020-03-06T11:27:08.674276

Revision history for this message
Jennifer Duong (jduong) wrote :
Revision history for this message
Jennifer Duong (jduong) wrote :

Has anyone had a chance to look at this?

Changed in nvme-cli (Ubuntu):
status: New → Confirmed
Revision history for this message
Jennifer Duong (jduong) wrote :

Any update on this?

Revision history for this message
Jennifer Duong (jduong) wrote :

I am still seeing this with Ubuntu 20.04 LTS

Dan Streetman (ddstreet)
Changed in nvme-cli (Ubuntu Focal):
assignee: nobody → Dan Streetman (ddstreet)
Changed in nvme-cli (Ubuntu Groovy):
assignee: nobody → Dan Streetman (ddstreet)
Changed in nvme-cli (Ubuntu Bionic):
assignee: nobody → Dan Streetman (ddstreet)
Changed in nvme-cli (Ubuntu Groovy):
status: Confirmed → In Progress
Changed in nvme-cli (Ubuntu Focal):
importance: Undecided → Low
status: New → In Progress
Changed in nvme-cli (Ubuntu Bionic):
importance: Undecided → Low
status: New → In Progress
Dan Streetman (ddstreet)
Changed in nvme-cli (Ubuntu Groovy):
importance: Undecided → Low
Dan Streetman (ddstreet)
description: updated
Dan Streetman (ddstreet)
description: updated
Dan Streetman (ddstreet)
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nvme-cli - 1.12-1ubuntu1

---------------
nvme-cli (1.12-1ubuntu1) groovy; urgency=medium

  * d/compat, d/control:
    - bump debhelper-compat to 13
  * d/control:
    - add uuid-dev dep so 'gen-hostnqn' command works
    - remove unneeded build deps
    - add uuid-runtime as postinst may call uuidgen
  * d/rules, d/nvme-cli.postinst:
    - generate /etc/nvme/host* files at install not build (LP: #1867366)

 -- Dan Streetman <email address hidden> Mon, 31 Aug 2020 14:38:34 -0400

Changed in nvme-cli (Ubuntu Groovy):
status: In Progress → Fix Released
Dan Streetman (ddstreet)
description: updated
Revision history for this message
Dan Streetman (ddstreet) wrote :

@rafaeldtinoco if you have a minute could you review the upload for this for focal? specifically, because the 1.9-1 package version included hardcoded (generated at build time) uuid in /etc/nvme/hostid, i added code in the postinst to replace that value with a install-time generated uuid (so it's unique per host system).
http://launchpadlibrarian.net/495790426/nvme-cli_1.9-1_1.9-1ubuntu0.1.diff.gz

My concern is what the impact might be for anyone actually using the hardcoded hostid uuid, and if it's better to just leave the old (non-unique) hostid instead of forcibly replacing it with a unique id.

I will note that in groovy, i didn't add any code to replace existing hardcoded hostid; any groovy system that started with the 1.12-1 package version will keep the non-unique hostid. However since groovy isn't released yet, any groovy system installed after GA would get the fixed package (and a unique hostid uuid).

In bionic, the package doesn't create /etc/nvme/* files so it's not an issue there; in fact, the /etc/nvme/* files don't appear to have been created for any version earlier than focal, so the 1.9-1 and 1.12-1 versions appear to be the only ones containing non-unique /etc/nvme/hostid values (and no version contained anything in the /etc/nvme/hostnqn file, since the 'gen-hostnqn' command has always been broken until fixed in 1.12-1ubuntu1)

Revision history for this message
Brian Murray (brian-murray) wrote :

Setting to Incomplete while we wait for feedback from Rafael.

Changed in nvme-cli (Ubuntu Focal):
status: In Progress → Incomplete
Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

Lemme review this...

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

Okay, I'm taking Groovy as an example first.. after installing.. I had:

/etc/nvme/hostid and /etc/nvme/hostnqn correctly generated. After removing nvme package, I had:

dpkg: warning: while removing nvme-cli, directory '/usr/lib/systemd/system' not empty so not removed
dpkg: warning: while removing nvme-cli, directory '/etc/nvme' not empty so not removed

which is a good sign, it kept my local uuid and nqn:

[rafaeldtinoco@groovy ~]$ cat /etc/nvme/host*
5e430ded-0dae-4dd1-8dc5-b3f490658e3a
nqn.2014-08.org.nvmexpress:uuid:a1e6adf3-9213-4929-833a-ce44226e74e4

Installing package again and contents are the same... remove it and wipe those files.. I got new files:

[rafaeldtinoco@groovy ~]$ cat /etc/nvme/host*
d76c6ba9-5a5d-4dc9-9dde-698c166af622
nqn.2014-08.org.nvmexpress:uuid:5d6e5dc5-1799-4cc5-b116-c710dca399c7

So I believe this is the correct behavior and it is fine not to worry about existing hostid uuids in Groovy as it is our -devel release.

Going to Focal now...

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

Okay, checking focal source code..

config::hostid seems to used at:

build_options() <- generic function setting variables
connect_ctrl() <- function connecting to NVMEoF controller
connect() <- function to to connect to NVMEoF
discover() <- same thing
nvmf_hostid_file() <- function reading config file and setting variable

So, for connect() we do have:

  {"hostnqn", 'q', "LIST", CFG_STRING, &cfg.hostnqn, required_argument, "user-defined hostnqn" },
  {"hostid", 'I', "LIST", CFG_STRING, &cfg.hostid, required_argument, "user-defined hostid (if default not used)"},

and for discovery we have:

  {"hostnqn", 'q', "LIST", CFG_STRING, &cfg.hostnqn, required_argument, "user-defined hostnqn (if default not used)" },
  {"hostid", 'I', "LIST", CFG_STRING, &cfg.hostid, required_argument, "user-defined hostid (if default not used)"},

Both are REQUIRED and would always be the same for all nodes (hostid would always be the same and hostnqn would always be nothing). This, per se, is already broken as a hostnqn is REQUIRED.

So, for Focal, I would say... re-creating both files IF hostnqn is empty would ALWAYS be a safe thing to be done. It means that there was no manual intervention to the config files... and without a hostnqn there would be no discovery or connection (so end user is not using NVME over Fabrics anyway).

Now, if user has changed hostnqn, we could display a warning saying the UUID should be checked for duplicates.

Let me see what you're doing now...

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

Let's say someone created a hostnqn by hand and kept the same hard-coded uuid. This upgrade would brake this scenario.

+ if [ "$2" = "1.9-1" ]; then
+ # the hostid was hardcoded into the binary package, so if the
+ # local file matches the 1.9-1 version hardcoded value,
+ # remove the file so it is properly generated below
+ if [ -s /etc/nvme/hostid ] && [ "$(cat /etc/nvme/hostid)" = "9ce77162-5a3e-439b-a73f-cdf2449521b6" ]; then
+ echo "REMOVING non-unique /etc/nvme/hostid value"
+ rm -f /etc/nvme/hostid
+ fi
+
+ # bug in 1.9-1 build caused hostnqn to contain only a newline,
+ # which fails the "! -s" check below, so just remove the almost-empty
+ # file, so it is properly generated below
+ if [ -s /etc/nvme/hostnqn ] && [ -z "$(cat /etc/nvme/hostnqn)" ]; then
+ rm -f /etc/nvme/hostnqn
+ fi
+ fi

Perhaps we could change it with what I said in last comment: If no hostnqn is given, then there is no way a fabric was configured, and you're safe to delete both files. If there is a hostnqn file, you issue a warning saying for the user the UUID should be changed (if default) and the fabric should be reviewed.

How does that sound ?

What about Bionic ?

Revision history for this message
Matt Schulte (gimpyestrada) wrote :

Rafael, would it be wrong to simply take any existing files and save them with an .bak extension? That way if the user really wanted their old ID they could go get it back?

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

As long as all policies from:

https://www.debian.org/doc/debian-policy/ch-files.html#configuration-files

and other packaging guidelines are kept, there should be no issues.

But, the intent here is something else in my understanding: to avoid breakage so the SRU is accepted by the SRU team. Let's say an user has the environment configured and working and suddenly we decide to move correctly configured files to .bak just because the binaries were updated and we "thought" it could be better.

That would break an environment for no reason.

Like open-iscsi iqn generation, we want also to make sure that generated uuids/iqns/nqns are NOT wiped in the package purging (thus the test in my first comment for Groovy). We have to make sure the Focal version also behaves like that... just like open-iscsi does:

[rafaeldtinoco@work iscsi]$ ls
initiatorname.iscsi iscsid.conf

[rafaeldtinoco@work iscsi]$ apt-file list open-iscsi | grep etc
open-iscsi: /etc/default/open-iscsi
open-iscsi: /etc/init.d/iscsid
open-iscsi: /etc/init.d/open-iscsi
open-iscsi: /etc/iscsi/iscsid.conf

where /etc/iscsi/initiatorname.iscsi is not wiped (cause it contains the iqn).

Makes sense to you both ?

Revision history for this message
Matt Schulte (gimpyestrada) wrote :

Yeah, makes sense. I would say to try to follow the iscsi iqn behavior, good idea!

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

Oops there is something else.. hostnqn *could* come from kernel (from nvme-connect Documentation):

--hostnqn=<hostnqn>::
    Overrides the default Host NQN that identifies the NVMe Host.
    If this option is not specified, the default is read from
    /etc/nvme/hostnqn first. If that does not exist, the autogenerated
    NQN value from the NVMe Host kernel module is used next.
    The Host NQN uniquely identifies the NVMe Host.

the documentation for nvme-discover.txt does not contain the kernel part.

But I could not find any code reading hostnqn from sysfs or ioctls or anything like it .. (weird). There is a function to automatically generate a hostnqn with libuuid ... but nothing else as it seems.. so the documentation seems wrong.

So I think that for both, Bionic and Focal, we should concentrate in hard coded:

#define PATH_NVME_FABRICS "/dev/nvme-fabrics"
#define PATH_NVMF_DISC "/etc/nvme/discovery.conf"
#define PATH_NVMF_HOSTNQN "/etc/nvme/hostnqn"
#define PATH_NVMF_HOSTID "/etc/nvme/hostid"

(from fabric.c)

Assumption:
- If no hostnqn is given, then there is no way a fabric was configured, and you're safe to delete both files.

Logic:
- check if hostnqn is set in /etc/nvme/hostnqn, if yes warn user hostid can be duplicated
  - if not, check if hostid was changed.. if yes, keep it... if no change it to correct one, create hostnqn

Make Sure:
- both files /etc/nvme/hostnqn and /etc/nvme/hostid are kept on purge (just because they are related to host identification, user can delete later if really wanted).

Changed in nvme-cli (Ubuntu Focal):
status: Incomplete → Confirmed
Changed in nvme-cli (Ubuntu Bionic):
status: In Progress → Confirmed
Revision history for this message
Dan Streetman (ddstreet) wrote :

Thanks for the review and analysis!

> > Assumption:
> - If no hostnqn is given, then there is no way a fabric was configured, and you're
> safe to delete both files.
>
> Logic:
> - check if hostnqn is set in /etc/nvme/hostnqn, if yes warn user hostid can be
> duplicated
> - if not, check if hostid was changed.. if yes, keep it... if no change it to
> correct one, create hostnqn

Sounds good, I'll update the postinst and reupload for Focal, thanks!

For Bionic, since the files were not created, I assume just adding the postinst to create the files if empty is all that's needed?

> Make Sure:
> - both files /etc/nvme/hostnqn and /etc/nvme/hostid are kept on purge (just because
> they are related to host identification, user can delete later if really wanted).

yep; since they're generated by the postinst, the package doesn't consider that it owns them, so removing or purging the package shouldn't remove the files - although it will remove the discovery.conf file on purge, since the package does consider that a conf file, but I think that's correct behavior, since it's only conf, not host-specific ids (right?)

Dan Streetman (ddstreet)
description: updated
Changed in nvme-cli (Ubuntu Focal):
status: Confirmed → In Progress
Changed in nvme-cli (Ubuntu Bionic):
status: Confirmed → In Progress
Dan Streetman (ddstreet)
description: updated
description: updated
Revision history for this message
Dan Streetman (ddstreet) wrote :

ok, new uploads in the b/f queues

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

Sorry for the delay here @ddstreet. +1 on your comments ^ =). Cheers o/

Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Jennifer, or anyone else affected,

Accepted nvme-cli into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/nvme-cli/1.9-1ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in nvme-cli (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-focal
Revision history for this message
Dan Streetman (ddstreet) wrote :

focal, fresh install:

root@lp1867366-f:~# dpkg -l nvme-cli
dpkg-query: no packages found matching nvme-cli
root@lp1867366-f:~# grep . /etc/nvme/*
grep: /etc/nvme/*: No such file or directory
root@lp1867366-f:~# apt install nvme-cli
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  nvme-cli
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 283 kB of archives.
After this operation, 687 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu focal-proposed/universe amd64 nvme-cli amd64 1.9-1ubuntu0.1 [283 kB]
Fetched 283 kB in 1s (419 kB/s)
Selecting previously unselected package nvme-cli.
(Reading database ... 47175 files and directories currently installed.)
Preparing to unpack .../nvme-cli_1.9-1ubuntu0.1_amd64.deb ...
Unpacking nvme-cli (1.9-1ubuntu0.1) ...
Setting up nvme-cli (1.9-1ubuntu0.1) ...
Processing triggers for man-db (2.9.1-1) ...
root@lp1867366-f:~# dpkg -l |grep nvme-cli
ii nvme-cli 1.9-1ubuntu0.1 amd64 userspace tooling to control NVMe drives
root@lp1867366-f:~# grep . /etc/nvme/host*
/etc/nvme/hostid:af9719f8-34c3-4652-9afd-28eccbbd10f5
/etc/nvme/hostnqn:nqn.2014-08.org.nvmexpress:uuid:25d4c6e2-ec73-4fd6-9e20-d55292ec7510

Revision history for this message
Dan Streetman (ddstreet) wrote :

focal, upgrade without modified /etc/nvme/host*:

root@lp1867366-f:~# dpkg -l | grep nvme-cli
ii nvme-cli 1.9-1 amd64 userspace tooling to control NVMe drives
root@lp1867366-f:~# grep . /etc/nvme/host*
/etc/nvme/hostid:9ce77162-5a3e-439b-a73f-cdf2449521b6
root@lp1867366-f:~# apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  nvme-cli
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 283 kB of archives.
After this operation, 3072 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu focal-proposed/universe amd64 nvme-cli amd64 1.9-1ubuntu0.1 [283 kB]
Fetched 283 kB in 1s (427 kB/s)
(Reading database ... 47296 files and directories currently installed.)
Preparing to unpack .../nvme-cli_1.9-1ubuntu0.1_amd64.deb ...
Unpacking nvme-cli (1.9-1ubuntu0.1) over (1.9-1) ...
Setting up nvme-cli (1.9-1ubuntu0.1) ...
Removing obsolete conffile /etc/nvme/hostid ...
Removing obsolete conffile /etc/nvme/hostnqn ...
Processing triggers for man-db (2.9.1-1) ...
root@lp1867366-f:~# dpkg -l | grep nvme-cli
ii nvme-cli 1.9-1ubuntu0.1 amd64 userspace tooling to control NVMe drives
root@lp1867366-f:~# grep . /etc/nvme/host*
/etc/nvme/hostid:1c950dc5-75b7-41bf-8285-abb505c0b79a
/etc/nvme/hostnqn:nqn.2014-08.org.nvmexpress:uuid:76e5ec24-0f6a-442c-b0aa-8734eeabc0d0

Revision history for this message
Dan Streetman (ddstreet) wrote :

focal, with modified /etc/nvme/hostid but not modified hostnqn:

root@lp1867366-f:~# dpkg -l | grep nvme-cli
ii nvme-cli 1.9-1 amd64 userspace tooling to control NVMe drives
root@lp1867366-f:~# grep . /etc/nvme/host*
/etc/nvme/hostid:I'm a modified hostid file!
root@lp1867366-f:~# apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  nvme-cli
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 283 kB of archives.
After this operation, 3072 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu focal-proposed/universe amd64 nvme-cli amd64 1.9-1ubuntu0.1 [283 kB]
Fetched 283 kB in 1s (433 kB/s)
(Reading database ... 47296 files and directories currently installed.)
Preparing to unpack .../nvme-cli_1.9-1ubuntu0.1_amd64.deb ...
Unpacking nvme-cli (1.9-1ubuntu0.1) over (1.9-1) ...
Setting up nvme-cli (1.9-1ubuntu0.1) ...
Removing obsolete conffile /etc/nvme/hostnqn ...
Processing triggers for man-db (2.9.1-1) ...
root@lp1867366-f:~# dpkg -l | grep nvme-cli
ii nvme-cli 1.9-1ubuntu0.1 amd64 userspace tooling to control NVMe drives
root@lp1867366-f:~# grep . /etc/nvme/host*
/etc/nvme/hostid:I'm a modified hostid file!
/etc/nvme/hostnqn:nqn.2014-08.org.nvmexpress:uuid:b663ca05-ccff-47dc-93c3-e3c101085bbb

note: expected behavior is correct, the unmodified (empty) hostnqn file is updated with a unique id, while the modified hostid file is left unchanged

Revision history for this message
Dan Streetman (ddstreet) wrote :

focal, with modified /etc/nvme/hostnqn but not modified hostid:

root@lp1867366-f:~# dpkg -l | grep nvme-cli
ii nvme-cli 1.9-1 amd64 userspace tooling to control NVMe drives
root@lp1867366-f:~# grep . /etc/nvme/host*
/etc/nvme/hostid:9ce77162-5a3e-439b-a73f-cdf2449521b6
/etc/nvme/hostnqn:I'm a modified hostnqn file!
root@lp1867366-f:~# apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  nvme-cli
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 283 kB of archives.
After this operation, 3072 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu focal-proposed/universe amd64 nvme-cli amd64 1.9-1ubuntu0.1 [283 kB]
Fetched 283 kB in 1s (406 kB/s)
(Reading database ... 47296 files and directories currently installed.)
Preparing to unpack .../nvme-cli_1.9-1ubuntu0.1_amd64.deb ...
Unpacking nvme-cli (1.9-1ubuntu0.1) over (1.9-1) ...
Setting up nvme-cli (1.9-1ubuntu0.1) ...
WARNING: /etc/nvme/hostid is not unique, you should regenerate it (LP:#1867366)
Processing triggers for man-db (2.9.1-1) ...
root@lp1867366-f:~# dpkg -l | grep nvme-cli
ii nvme-cli 1.9-1ubuntu0.1 amd64 userspace tooling to control NVMe drives
root@lp1867366-f:~# grep . /etc/nvme/host*
/etc/nvme/hostid:9ce77162-5a3e-439b-a73f-cdf2449521b6
/etc/nvme/hostnqn:I'm a modified hostnqn file!

note: as outlined in comment 17, since the hostnqn has been modified, it's possible the system is in use as a nvmeof target, so the hostid and hostnqn files are left as-is without modification, but a warning is printed about the hostid not being a unique value.

Revision history for this message
Dan Streetman (ddstreet) wrote :

focal, with both hostid and hostnqn modified:

root@lp1867366-f:~# dpkg -l | grep nvme-cli
ii nvme-cli 1.9-1 amd64 userspace tooling to control NVMe drives
root@lp1867366-f:~# grep . /etc/nvme/host*
/etc/nvme/hostid:I'm a modified hostid file!
/etc/nvme/hostnqn:I'm a modified hostnqn file!
root@lp1867366-f:~# apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  nvme-cli
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 283 kB of archives.
After this operation, 3072 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu focal-proposed/universe amd64 nvme-cli amd64 1.9-1ubuntu0.1 [283 kB]
Fetched 283 kB in 1s (363 kB/s)
(Reading database ... 47296 files and directories currently installed.)
Preparing to unpack .../nvme-cli_1.9-1ubuntu0.1_amd64.deb ...
Unpacking nvme-cli (1.9-1ubuntu0.1) over (1.9-1) ...
Setting up nvme-cli (1.9-1ubuntu0.1) ...
Processing triggers for man-db (2.9.1-1) ...
root@lp1867366-f:~# dpkg -l | grep nvme-cli
ii nvme-cli 1.9-1ubuntu0.1 amd64 userspace tooling to control NVMe drives
root@lp1867366-f:~# grep . /etc/nvme/host*
/etc/nvme/hostid:I'm a modified hostid file!
/etc/nvme/hostnqn:I'm a modified hostnqn file!

note: since both files are modified, they are not modified by the package update, and no warning is printed, since the hostid isn't the non-unique value anymore.

Revision history for this message
Dan Streetman (ddstreet) wrote :

focal, verification for 'gen-hostnqn':

root@lp1867366-f:~# dpkg -l | grep nvme-cli
ii nvme-cli 1.9-1 amd64 userspace tooling to control NVMe drives
root@lp1867366-f:~# nvme gen-hostnqn
"gen-hostnqn" not supported. Install lib uuid and rebuild.

root@lp1867366-f:~# dpkg -l | grep nvme-cli
ii nvme-cli 1.9-1ubuntu0.1 amd64 userspace tooling to control NVMe drives
root@lp1867366-f:~# nvme gen-hostnqn
nqn.2014-08.org.nvmexpress:uuid:6a1c5d09-b2ea-430e-aaf9-6627251f4d55

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nvme-cli - 1.9-1ubuntu0.1

---------------
nvme-cli (1.9-1ubuntu0.1) focal; urgency=medium

  * d/control, d/rules, d/nvme-cli.postinst, d/nvme-cli.maintscript:
    - wrap-and-sort -ast
    - add uuid-dev build dep so 'gen-hostnqn' command works
    - add uuid-runtime as postinst may call uuidgen
    - generate /etc/nvme/host* files at install not build (LP: #1867366)

 -- Dan Streetman <email address hidden> Sun, 06 Sep 2020 22:11:24 -0400

Changed in nvme-cli (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for nvme-cli has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Jennifer, or anyone else affected,

Accepted nvme-cli into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/nvme-cli/1.5-1ubuntu1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in nvme-cli (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-bionic
removed: verification-done
Revision history for this message
Dan Streetman (ddstreet) wrote :

root@lp1867366-b:~# dpkg -l|grep nvme-cli
ii nvme-cli 1.5-1ubuntu1 amd64 userspace tooling to control NVMe drives
root@lp1867366-b:~# cat /etc/nvme/hostnqn
cat: /etc/nvme/hostnqn: No such file or directory
root@lp1867366-b:~# nvme gen-hostnqn
"gen-hostnqn" not supported. Install lib uuid and rebuild.
root@lp1867366-b:~# cat /etc/nvme/hostid
cat: /etc/nvme/hostid: No such file or directory

root@lp1867366-b:~# dpkg -l|grep nvme-cli
ii nvme-cli 1.5-1ubuntu1.1 amd64 userspace tooling to control NVMe drives
root@lp1867366-b:~# cat /etc/nvme/hostnqn
nqn.2014-08.org.nvmexpress:uuid:e87565e4-474e-4c3f-824a-2d706da92ab0
root@lp1867366-b:~# nvme gen-hostnqn
nqn.2014-08.org.nvmexpress:uuid:62877ef4-3914-479a-8703-2250e49e101e
root@lp1867366-b:~# cat /etc/nvme/hostid
5376e2f0-7304-4117-80c2-a93fa78a001e

Dan Streetman (ddstreet)
tags: added: verification-done verification-done-bionic
removed: verification-needed verification-needed-bionic
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nvme-cli - 1.5-1ubuntu1.1

---------------
nvme-cli (1.5-1ubuntu1.1) bionic; urgency=medium

  * d/control, d/nvme-cli.postinst:
    - add uuid-dev build dep so 'gen-hostnqn' command works
    - add uuid-runtime dep as postinst calls uuidgen
    - generate /etc/nvme/hostid and hostnqn files during install
      (LP: #1867366)

 -- Dan Streetman <email address hidden> Mon, 31 Aug 2020 17:54:07 -0400

Changed in nvme-cli (Ubuntu Bionic):
status: Fix Committed → Fix Released
Changed in nvme-cli (Debian):
status: Unknown → Fix Released
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.