12.3. Configuring NVMe host authentication
To establish an authenticated connection with an NVMe over Fabrics (NVMe-oF) controller, you can configure authentication on a Non-volatile Memory Express (NVMe) host. NVMe authentication uses a shared secret or a pair of secrets, with a challenge-response protocol, for example, NVMe DH-HMAC-CHAP.
NVMe authentication is supported only for the NVMe/TCP transport type. This feature is not available for other transports, such as NVMe over Remote Direct Memory Access (NVMe/RDMA) or NVMe over Fibre Channel (NVMe/FC).
Prerequisites
-
The
nvme-clipackage is installed. -
You know the Host NVMe Qualified Name (Host NQN) and the Subsystem NVMe Qualified Name (Subsystem NQN), if using bi-directional authentication. To see the default Host NQN for your system, run
nvme show-hostnqnq.
Procedure
Generate an authentication secret:
For the host:
# hostkey=$(nvme gen-dhchap-key -n ${HOSTNQN})For the subsystem:
# ctrlkey=$(nvme gen-dhchap-key -n ${SUBSYSTEM})
Configure the host for authentication:
# nvme connect -t tcp -n ${SUBSYSTEM} -a ${TRADDR} -s 4420 --dhchap-secret=${hostkey} --dhchap-ctrl-secret=${ctrlkey}This provides the authentication secrets to the
nvme-connectutility so that it can authenticate and establish a connection to the target.-
Optional: To enable automated logins, set up persistent NVMe fabrics configuration. To do so, add the
--dhchap-secretand--dhchap-ctrl-secretparameters to/etc/nvme/discovery.confor/etc/nvme/config.json.
-
Optional: To enable automated logins, set up persistent NVMe fabrics configuration. To do so, add the
Verification
Verify that the NVMe storage is attached:
# nvme listThis displays the list of NVMe devices currently attached to the host. Verify that the expected storage is listed, indicating the connection to the storage server is successful.