nvme-gen-hostnqn(1)
===================

NAME
----
nvme-gen-hostnqn - Generate a host NVMe Qualified Name

SYNOPSIS
--------
[verse]
'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
-------

include::global-options.txt[]

EXAMPLES
--------
nvme gen-hostnqn

NVME
----
Part of the nvme-user suite
