doc/rbd/nvmeof-initiator-linux.rst
Install the nvme-cli:
.. prompt:: bash #
yum install nvme-cli
Load the NVMe-oF module:
.. prompt:: bash #
modprobe nvme-fabrics
Verify the NVMe/TCP target is reachable:
.. prompt:: bash #
nvme discover -t tcp -a GATEWAY_IP -s 8009
Connect to the NVMe/TCP target. For High-availability use the connect-all command:
.. prompt:: bash #
nvme connect-all --traddr GATEWAY_IP --transport tcp -l 1800 -s 8009
'-l 1800' is recommended to allow the initiator to continue trying to connect to GWs for 1800 seconds. This is helpful in cases that the GW is temporarily unavailable for any reason.
'-s 8009' is the port address of the Discovery controller. The connect-all command will connect to the DC first, and then will use the information it retrns to connect to the GWs.
Verify that the initiator is set up correctly:
Verify that the initiator is connected to all NVMe-oF gateways and subsystems in the gateway group
.. prompt:: bash #
nvme list-subsys
example output:
nvme-subsys<X> - NQN=<NQN>
+- nvmeX tcp traddr=<GW IP>,trsvcid=4420 live
+- nvmeY tcp traddr=<GW IP>,trsvcid=4420 live
+- nvmeZ tcp traddr=<GW IP>,trsvcid=4420 live
+- nvmeW tcp traddr=<GW IP>,trsvcid=4420 live
List the NVMe block devices.
.. prompt:: bash #
nvme list
Create a filesystem on the desired device:
.. prompt:: bash #
mkfs.ext4 NVME_NODE_PATH
Mount the filesystem:
.. prompt:: bash #
mkdir /mnt/nvmeof
.. prompt:: bash #
mount NVME_NODE_PATH /mnt/nvmeof
List the NVME-oF files:
.. prompt:: bash #
ls /mnt/nvmeof
Create a text file in the /mnt/nvmeof directory:
.. prompt:: bash #
echo "Hello NVME-oF" > /mnt/nvmeof/hello.text
Verify that the file can be accessed:
.. prompt:: bash #
cat /mnt/nvmeof/hello.text