Este conteúdo não está disponível no idioma selecionado.
Chapter 10. Configuring NVMe over fabrics using NVMe/RDMA
In a Non-volatile Memory Express™ (NVMe™) over RDMA (NVMe™/RDMA) setup, you configure an NVMe controller and an NVMe initiator.
10.1. Setting up an NVMe/RDMA controller using configfs Copiar o linkLink copiado para a área de transferência!
You can configure a Non-volatile Memory Express™ (NVMe™) over RDMA (NVMe™/RDMA) controller by using configfs.
Prerequisites
-
Verify that you have a block device to assign to the
nvmetsubsystem.
Procedure
Create the
nvmet-rdmasubsystem:modprobe nvmet-rdma mkdir /sys/kernel/config/nvmet/subsystems/testnqn cd /sys/kernel/config/nvmet/subsystems/testnqn
# modprobe nvmet-rdma # mkdir /sys/kernel/config/nvmet/subsystems/testnqn # cd /sys/kernel/config/nvmet/subsystems/testnqnCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace testnqn with the subsystem name.
Allow any host to connect to this controller:
echo 1 > attr_allow_any_host
# echo 1 > attr_allow_any_hostCopy to Clipboard Copied! Toggle word wrap Toggle overflow Configure a namespace:
mkdir namespaces/10 cd namespaces/10
# mkdir namespaces/10 # cd namespaces/10Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace 10 with the namespace number
Set a path to the NVMe device:
echo -n /dev/nvme0n1 > device_path
# echo -n /dev/nvme0n1 > device_pathCopy to Clipboard Copied! Toggle word wrap Toggle overflow Enable the namespace:
echo 1 > enable
# echo 1 > enableCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a directory with an NVMe port:
mkdir /sys/kernel/config/nvmet/ports/1 cd /sys/kernel/config/nvmet/ports/1
# mkdir /sys/kernel/config/nvmet/ports/1 # cd /sys/kernel/config/nvmet/ports/1Copy to Clipboard Copied! Toggle word wrap Toggle overflow Display the IP address of mlx5_ib0:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the transport address for the controller:
echo -n 172.31.0.202 > addr_traddr
# echo -n 172.31.0.202 > addr_traddrCopy to Clipboard Copied! Toggle word wrap Toggle overflow Set RDMA as the transport type:
echo rdma > addr_trtype echo 4420 > addr_trsvcid
# echo rdma > addr_trtype # echo 4420 > addr_trsvcidCopy to Clipboard Copied! Toggle word wrap Toggle overflow Set the address family for the port:
echo ipv4 > addr_adrfam
# echo ipv4 > addr_adrfamCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a soft link:
ln -s /sys/kernel/config/nvmet/subsystems/testnqn /sys/kernel/config/nvmet/ports/1/subsystems/testnqn
# ln -s /sys/kernel/config/nvmet/subsystems/testnqn /sys/kernel/config/nvmet/ports/1/subsystems/testnqnCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Verify that the NVMe controller is listening on the given port and ready for connection requests:
dmesg | grep "enabling port"
# dmesg | grep "enabling port" [ 1091.413648] nvmet_rdma: enabling port 1 (172.31.0.202:4420)Copy to Clipboard Copied! Toggle word wrap Toggle overflow
10.2. Setting up the NVMe/RDMA controller using nvmetcli Copiar o linkLink copiado para a área de transferência!
You can configure the Non-volatile Memory Express™ (NVMe™) over RDMA (NVMe™/RDMA) controller by using the nvmetcli utility. The nvmetcli utility provides a command line and an interactive shell option.
Prerequisites
-
Verify that you have a block device to assign to the
nvmetsubsystem. -
Execute the following
nvmetclioperations as a root user.
Procedure
Install the
nvmetclipackage:dnf install nvmetcli
# dnf install nvmetcliCopy to Clipboard Copied! Toggle word wrap Toggle overflow Download the
rdma.jsonfile:wget http://git.infradead.org/users/hch/nvmetcli.git/blob_plain/0a6b088db2dc2e5de11e6f23f1e890e4b54fee64:/rdma.json
# wget http://git.infradead.org/users/hch/nvmetcli.git/blob_plain/0a6b088db2dc2e5de11e6f23f1e890e4b54fee64:/rdma.jsonCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Edit the
rdma.jsonfile and change thetraddrvalue to172.31.0.202. Setup the controller by loading the NVMe controller configuration file:
nvmetcli restore rdma.json
# nvmetcli restore rdma.jsonCopy to Clipboard Copied! Toggle word wrap Toggle overflow
If the NVMe controller configuration file name is not specified, the nvmetcli uses the /etc/nvmet/config.json file.
Verification
Verify that the NVMe controller is listening on the given port and ready for connection requests:
dmesg | tail -1
# dmesg | tail -1 [ 4797.132647] nvmet_rdma: enabling port 2 (172.31.0.202:4420)Copy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: Clear the current NVMe controller:
nvmetcli clear
# nvmetcli clearCopy to Clipboard Copied! Toggle word wrap Toggle overflow
10.3. Configuring an NVMe/RDMA host Copiar o linkLink copiado para a área de transferência!
You can configure a Non-volatile Memory Express™ (NVMe™) over RDMA (NVMe™/RDMA) host by using the NVMe management command-line interface (nvme-cli) tool.
Procedure
Install the
nvme-clitool:dnf install nvme-cli
# dnf install nvme-cliCopy to Clipboard Copied! Toggle word wrap Toggle overflow Load the
nvme-rdmamodule if it is not loaded:modprobe nvme-rdma
# modprobe nvme-rdmaCopy to Clipboard Copied! Toggle word wrap Toggle overflow Discover available subsystems on the NVMe controller:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Connect to the discovered subsystems:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace testnqn with the NVMe subsystem name.
Replace 172.31.0.202 with the controller IP address.
Replace 4420 with the port number.
Verification
List the NVMe devices that are currently connected:
nvme list
# nvme listCopy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: Disconnect from the controller:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow