SYNOPSIS

nvme [<global-options>] gen-hostnqn

DESCRIPTION

Generate a host NQN in the form: nqn.2014-08.org.nvmexpress:uuid:1b4e28ba-2fa1-11d2-883f-0016d3cca427 and print it to stdout.

The UUID is taken from the first of these sources that provides a usable value:

  1. The system UUID reported by DMI, from /sys/class/dmi/id/product_uuid or /sys/firmware/dmi/entries.

  2. The firmware device tree, from /proc/device-tree/ibm,partition-uuid.

  3. The local machine ID, /etc/machine-id. The machine ID itself is never published: the UUID is derived from it with HMAC-SHA256 and a fixed application identifier, as systemd’s sd_id128_get_machine_app_specific(3) does.

  4. A random UUID, if none of the above is available. This value is not stable across invocations, and a warning is printed.

The first two sources describe the hardware and survive a reinstall. The machine ID describes the installation and does not. A UUID that is all zeros or all ones is a placeholder reported by some virtual machines and firmware, and is skipped.

This command must be run as root. The DMI and device tree files are readable by root only, so an unprivileged run cannot reach the stable sources, and its output cannot be written to /etc/nvme/hostnqn either.

OPTIONS

GLOBAL OPTIONS

The following options are defined at the top-level nvme command and are available to this subcommand:

--dry-run

Print the command that would be executed, but do not actually execute it.

--no-ioctl-probing

Disable probing for 64-bit IOCTL support.

--no-retries

Disable retry logic on transient errors.

-o <fmt>
--output-format=<fmt>

Set the reporting format to normal, tabular, 'json, or binary. Only one output format may be used at a time.

--output-format-version=<version>

Select the output format version. Version 1 uses the original field naming, while version 2 (default) provides more consistent and script-friendly field names.

--timeout=<ms>

Set the timeout for the command in milliseconds.

-v
--verbose

Increase the level of detail in the output. May be specified multiple times to further increase verbosity.

These options can also be set as machine-wide defaults in nvme-cli.conf(5). A command-line flag always overrides the file.

EXAMPLES

nvme gen-hostnqn

NVME

Part of the nvme-user suite