|
| 1 | +========================================== |
| 2 | +Installing and Configuring NVMe-oF Targets |
| 3 | +========================================== |
| 4 | + |
| 5 | +Traditionally, block-level access to a Ceph storage cluster has been limited to |
| 6 | +(1) QEMU and ``librbd`` (which is a key enabler for adoption within OpenStack |
| 7 | +environments), and (2) the Linux kernel client. Starting with the Ceph Reef |
| 8 | +release, block-level access has been expanded to offer standard NVMe/TCP |
| 9 | +support, allowing wider platform usage and potentially opening new use cases. |
| 10 | + |
| 11 | +Prerequisites |
| 12 | +============= |
| 13 | + |
| 14 | +- Red Hat Enterprise Linux/CentOS 8.0 (or newer); Linux kernel v4.16 (or newer) |
| 15 | + |
| 16 | +- A working Ceph Reef or later storage cluster, deployed with ``cephadm`` |
| 17 | + |
| 18 | +- NVMe-oF gateways, which can either be colocated with OSD nodes or on dedicated nodes |
| 19 | + |
| 20 | +- Separate network subnets for NVME-oF front-end traffic and Ceph back-end traffic |
| 21 | + |
| 22 | +Explanation |
| 23 | +=========== |
| 24 | + |
| 25 | +The Ceph NVMe-oF gateway is both an NVMe-oF target and a Ceph client. Think of |
| 26 | +it as a "translator" between Ceph's RBD interface and the NVME-oF protocol. The |
| 27 | +Ceph NVMe-oF gateway can run on a standalone node or be colocated with other |
| 28 | +daemons, for example on a Ceph Object Store Disk (OSD) node. When colocating |
| 29 | +the Ceph NVMe-oF gateway with other daemons, ensure that sufficient CPU and |
| 30 | +memory are available. The steps below explain how to install and configure the |
| 31 | +Ceph NVMe/TCP gateway for basic operation. |
| 32 | + |
| 33 | + |
| 34 | +Installation |
| 35 | +============ |
| 36 | + |
| 37 | +Complete the following steps to install the Ceph NVME-oF gateway: |
| 38 | + |
| 39 | +#. Create a pool in which the gateways configuration can be managed: |
| 40 | + |
| 41 | + .. prompt:: bash # |
| 42 | + |
| 43 | + ceph osd pool create NVME-OF_POOL_NAME |
| 44 | + |
| 45 | +#. Enable RBD on the NVMe-oF pool: |
| 46 | + |
| 47 | + .. prompt:: bash # |
| 48 | + |
| 49 | + rbd pool init NVME-OF_POOL_NAME |
| 50 | + |
| 51 | +#. Deploy the NVMe-oF gateway daemons on a specific set of nodes: |
| 52 | + |
| 53 | + .. prompt:: bash # |
| 54 | + |
| 55 | + ceph orch apply nvmeof NVME-OF_POOL_NAME --placment="host01, host02" |
| 56 | + |
| 57 | +Configuration |
| 58 | +============= |
| 59 | + |
| 60 | +Download the ``nvmeof-cli`` container before first use. |
| 61 | +To download it use the following command: |
| 62 | + |
| 63 | +.. prompt:: bash # |
| 64 | + |
| 65 | + podman pull quay.io/ceph/nvmeof-cli:latest |
| 66 | + |
| 67 | +#. Create an NVMe subsystem: |
| 68 | + |
| 69 | +.. prompt:: bash # |
| 70 | + |
| 71 | + podman run -it quay.io/ceph/nvmeof-cli:latest --server-address GATEWAY_IP --server-port GATEWAY_PORT 5500 subsystem add --subsystem SUSYSTEM_NQN |
| 72 | + |
| 73 | + The subsystem NQN is a user defined string, for example ``nqn.2016-06.io.spdk:cnode1``. |
| 74 | + |
| 75 | +#. Define the IP port on the gateway that will process the NVME/TCP commands and I/O: |
| 76 | + |
| 77 | + a. On the install node, get the NVME-oF Gateway name: |
| 78 | + |
| 79 | + .. prompt:: bash # |
| 80 | + |
| 81 | + ceph orch ps | grep nvme |
| 82 | + |
| 83 | + b. Define the IP port for the gateway: |
| 84 | + |
| 85 | + .. prompt:: bash # |
| 86 | + |
| 87 | + podman run -it quay.io/ceph/nvmeof-cli:latest --server-address GATEWAY_IP --server-port GATEWAY_PORT 5500 listener add --subsystem SUBSYSTEM_NQN --gateway-name GATEWAY_NAME --traddr GATEWAY_IP --trsvcid 4420 |
| 88 | + |
| 89 | +#. Get the host NQN (NVME Qualified Name) for each host: |
| 90 | + |
| 91 | + .. prompt:: bash # |
| 92 | + |
| 93 | + cat /etc/nvme/hostnqn |
| 94 | + |
| 95 | + .. prompt:: bash # |
| 96 | + |
| 97 | + esxcli nvme info get |
| 98 | + |
| 99 | +#. Allow the initiator host to connect to the newly-created NVMe subsystem: |
| 100 | + |
| 101 | + .. prompt:: bash # |
| 102 | + |
| 103 | + podman run -it quay.io/ceph/nvmeof-cli:latest --server-address GATEWAY_IP --server-port GATEWAY_PORT 5500 host add --subsystem SUBSYSTEM_NQN --host "HOST_NQN1, HOST_NQN2" |
| 104 | + |
| 105 | +#. List all subsystems configured in the gateway: |
| 106 | + |
| 107 | + .. prompt:: bash # |
| 108 | + |
| 109 | + podman run -it quay.io/ceph/nvmeof-cli:latest --server-address GATEWAY_IP --server-port GATEWAY_PORT 5500 subsystem list |
| 110 | + |
| 111 | +#. Create a new NVMe namespace: |
| 112 | + |
| 113 | + .. prompt:: bash # |
| 114 | + |
| 115 | + podman run -it quay.io/ceph/nvmeof-cli:latest --server-address GATEWAY_IP --server-port GATEWAY_PORT 5500 namespace add --subsystem SUBSYSTEM_NQN --rbd-pool POOL_NAME --rbd-image IMAGE_NAME |
| 116 | + |
| 117 | +#. List all namespaces in the subsystem: |
| 118 | + |
| 119 | + .. prompt:: bash # |
| 120 | + |
| 121 | + podman run -it quay.io/ceph/nvmeof-cli:latest --server-address GATEWAY_IP --server-port GATEWAY_PORT 5500 namespace list --subsystem SUBSYSTEM_NQN |
| 122 | + |
0 commit comments