Skip to content

Commit 4ddad1f

Browse files
authored
Merge pull request #1052 from gbregman/devel
Adjust demo make target for multi-gateway environment
2 parents ccbf3c6 + 4e09492 commit 4ddad1f

File tree

2 files changed

+28
-22
lines changed

2 files changed

+28
-22
lines changed

README.md

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,24 @@ The following command executes all the steps required to set up the NVMe-oF envi
9898

9999
```bash
100100
$ make demo
101-
docker compose exec ceph bash -c "rbd -p rbd info demo_image || rbd -p rbd create demo_image --size 10M"
102-
rbd: error opening image demo_image: (2) No such file or directory
103-
docker compose run --rm nvmeof-cli --server-address 192.168.13.3 --server-port 5500 subsystem add --subsystem "nqn.2016-06.io.spdk:cnode1"
101+
Attempt (1): Fetching URL for arch=x86_64, branch=main, sha=latest...
102+
Success: Retrieved URL for arch=x86_64, branch=main, sha=latest: https://4.chacra.ceph.com/r/ceph/main/97c8c56a3d2cc7a294b0d2931f856324b5330b7c/centos/9/flavors/default/
103+
/usr/bin/docker compose run --rm nvmeof-cli --server-address 192.168.13.3 --server-port 5500 subsystem add --subsystem "nqn.2016-06.io.spdk:cnode1" --no-group-append
104104
Adding subsystem nqn.2016-06.io.spdk:cnode1: Successful
105-
docker compose run --rm nvmeof-cli --server-address 192.168.13.3 --server-port 5500 namespace add --subsystem "nqn.2016-06.io.spdk:cnode1" --rbd-pool rbd --rbd-image demo_image
105+
/usr/bin/docker compose run --rm nvmeof-cli --server-address 192.168.13.3 --server-port 5500 namespace add --subsystem "nqn.2016-06.io.spdk:cnode1" --rbd-pool rbd --rbd-image demo_image --size 10MB --rbd-create-image
106106
Adding namespace 1 to nqn.2016-06.io.spdk:cnode1: Successful
107-
docker compose run --rm nvmeof-cli --server-address 192.168.13.3 --server-port 5500 listener add --subsystem "nqn.2016-06.io.spdk:cnode1" --host-name fbca1a3d3ed8 --traddr 192.168.13.3 --trsvcid 4420
108-
Adding listener 192.168.13.3:4420 to nqn.2016-06.io.spdk:cnode1: Successful
109-
docker compose run --rm nvmeof-cli --server-address 2001:db8::3 --server-port 5500 listener add --subsystem "nqn.2016-06.io.spdk:cnode1" --host-name fbca1a3d3ed8 --traddr 2001:db8::3 --trsvcid 4420 --adrfam IPV6
110-
Adding listener [2001:db8::3]:4420 to nqn.2016-06.io.spdk:cnode1: Successful
111-
docker compose run --rm nvmeof-cli --server-address 192.168.13.3 --server-port 5500 host add --subsystem "nqn.2016-06.io.spdk:cnode1" --host-nqn "*"
112-
Allowing any host for nqn.2016-06.io.spdk:cnode1: Successful
107+
/usr/bin/docker compose run --rm nvmeof-cli --server-address 192.168.13.3 --server-port 5500 namespace add --subsystem "nqn.2016-06.io.spdk:cnode1" --rbd-pool rbd --rbd-image demo_image2 --size 10MB --rbd-create-image --no-auto-visible
108+
Adding namespace 2 to nqn.2016-06.io.spdk:cnode1: Successful
109+
/usr/bin/docker compose run --rm nvmeof-cli --server-address 192.168.13.3 --server-port 5500 listener add --subsystem "nqn.2016-06.io.spdk:cnode1" --host-name ` /usr/bin/docker compose run --rm nvmeof-cli --server-address 192.168.13.3 --server-port 5500 --output stdio gw info | grep "Gateway's host name:" | cut -d: -f2 | sed 's/ //g'` --traddr 192.168.13.3 --trsvcid 4420 --verify-host-name
110+
Adding nqn.2016-06.io.spdk:cnode1 listener at 192.168.13.3:4420: Successful
111+
/usr/bin/docker compose run --rm nvmeof-cli --server-address 192.168.13.3 --server-port 5500 listener add --subsystem "nqn.2016-06.io.spdk:cnode1" --host-name ` /usr/bin/docker compose run --rm nvmeof-cli --server-address 192.168.13.3 --server-port 5500 --output stdio gw info | grep "Gateway's host name:" | cut -d: -f2 | sed 's/ //g'` --traddr 0.0.0.0 --trsvcid `expr 4420 + 1` --verify-host-name
112+
Adding nqn.2016-06.io.spdk:cnode1 listener at 0.0.0.0:4421: Successful
113+
/usr/bin/docker compose run --rm nvmeof-cli --server-address 2001:db8::3 --server-port 5500 listener add --subsystem "nqn.2016-06.io.spdk:cnode1" --host-name ` /usr/bin/docker compose run --rm nvmeof-cli --server-address 192.168.13.3 --server-port 5500 --output stdio gw info | grep "Gateway's host name:" | cut -d: -f2 | sed 's/ //g'` --traddr 2001:db8::3 --trsvcid 4420 --adrfam IPV6 --verify-host-name
114+
Adding nqn.2016-06.io.spdk:cnode1 listener at [2001:db8::3]:4420: Successful
115+
/usr/bin/docker compose run --rm nvmeof-cli --server-address 192.168.13.3 --server-port 5500 host add --subsystem "nqn.2016-06.io.spdk:cnode1" --host-nqn "*"
116+
Allowing open host access to nqn.2016-06.io.spdk:cnode1: Successful
117+
/usr/bin/docker compose run --rm nvmeof-cli --server-address 192.168.13.3 --server-port 5500 namespace add_host --subsystem "nqn.2016-06.io.spdk:cnode1" --nsid 2 --host-nqn `cat /etc/nvme/hostnqn`
118+
Adding host nqn.2014-08.org.nvmexpress:uuid:893a6752-fe9b-ca48-aa93-e4565f32881c to namespace 2 on nqn.2016-06.io.spdk:cnode1: Successful
113119
```
114120

115121
#### Manual Steps
@@ -122,28 +128,28 @@ The same configuration can also be manually run:
122128
eval $(make alias)
123129
```
124130
125-
1. In order to start working with the NVMe-oF gateway, we need to create an RBD image first (`demo_image` in the `rbd` pool):
131+
1. Create a subsystem:
126132
127133
```bash
128-
make rbd
134+
cephnvmf subsystem add --subsystem nqn.2016-06.io.spdk:cnode1 --no-group-append
129135
```
130136
131-
1. Create a subsystem:
137+
1. Add a namespace:
132138
133139
```bash
134-
cephnvmf subsystem add --subsystem nqn.2016-06.io.spdk:cnode1
140+
cephnvmf namespace add --subsystem nqn.2016-06.io.spdk:cnode1 --rbd-pool rbd --rbd-image demo_image --size 10MB --rbd-create-image
135141
```
136142
137-
1. Add a namespace:
143+
1. Find the gateway's host name:
138144

139145
```bash
140-
cephnvmf namespace add --subsystem nqn.2016-06.io.spdk:cnode1 --rbd-pool rbd --rbd-image demo_image
146+
cephnvmf --output stdio gw info | grep "Gateway's host name:"
141147
```
142148

143149
1. Create a listener so that NVMe initiators can connect to:
144150

145151
```bash
146-
cephnvmf listener add ---subsystem nqn.2016-06.io.spdk:cnode1 --host-name host_name -a gateway_addr -s 4420
152+
cephnvmf listener add ---subsystem nqn.2016-06.io.spdk:cnode1 --host-name host_name_found_above -a gateway_addr -s 4420 --verify-host-name
147153
```
148154

149155
1. Define which hosts can connect:
@@ -181,7 +187,7 @@ Once the NVMe-oF target is
181187
1. Ensure that the listener is reachable from the NVMe-oF initiator:
182188
183189
```bash
184-
$ sudo nvme discover -t tcp -a 192.168.13.3 -s 4420
190+
$ sudo nvme discover -t tcp -a gateway_addr -s 8009
185191
186192
Discovery Log Number of Records 1, Generation counter 2
187193
=====Discovery Log Entry 0======
@@ -200,7 +206,7 @@ Once the NVMe-oF target is
200206
1. Connect to desired subsystem:
201207
202208
```bash
203-
sudo nvme connect -t tcp --traddr 192.168.13.3 -s 4420 -n nqn.2016-06.io.spdk:cnode1
209+
sudo nvme connect -t tcp --traddr gateway_addr -s 4420 -n nqn.2016-06.io.spdk:cnode1
204210
```
205211
206212
1. List the available NVMe targets:

mk/demo.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ demo:
77
$(NVMEOF_CLI) subsystem add --subsystem $(NQN) --no-group-append
88
$(NVMEOF_CLI) namespace add --subsystem $(NQN) --rbd-pool $(RBD_POOL) --rbd-image $(RBD_IMAGE_NAME) --size $(RBD_IMAGE_SIZE) --rbd-create-image
99
$(NVMEOF_CLI) namespace add --subsystem $(NQN) --rbd-pool $(RBD_POOL) --rbd-image $(RBD_IMAGE_NAME)2 --size $(RBD_IMAGE_SIZE) --rbd-create-image --no-auto-visible
10-
$(NVMEOF_CLI) listener add --subsystem $(NQN) --host-name `docker ps -q -f name=$(NVMEOF_CONTAINER_NAME)` --traddr $(NVMEOF_IP_ADDRESS) --trsvcid $(NVMEOF_IO_PORT)
11-
$(NVMEOF_CLI) listener add --subsystem $(NQN) --host-name `docker ps -q -f name=$(NVMEOF_CONTAINER_NAME)` --traddr 0.0.0.0 --trsvcid $(NVMEOF_IO_PORT2)
12-
$(NVMEOF_CLI_IPV6) listener add --subsystem $(NQN) --host-name `docker ps -q -f name=$(NVMEOF_CONTAINER_NAME)` --traddr $(NVMEOF_IPV6_ADDRESS) --trsvcid $(NVMEOF_IO_PORT) --adrfam IPV6
10+
$(NVMEOF_CLI) listener add --subsystem $(NQN) --host-name `$(NVMEOF_CLI) --output stdio gw info | grep "Gateway's host name:" | cut -d: -f2 | sed 's/ //g'` --traddr $(NVMEOF_IP_ADDRESS) --trsvcid $(NVMEOF_IO_PORT) --verify-host-name
11+
$(NVMEOF_CLI) listener add --subsystem $(NQN) --host-name `$(NVMEOF_CLI) --output stdio gw info | grep "Gateway's host name:" | cut -d: -f2 | sed 's/ //g'` --traddr 0.0.0.0 --trsvcid $(NVMEOF_IO_PORT2) --verify-host-name
12+
$(NVMEOF_CLI_IPV6) listener add --subsystem $(NQN) --host-name `$(NVMEOF_CLI) --output stdio gw info | grep "Gateway's host name:" | cut -d: -f2 | sed 's/ //g'` --traddr $(NVMEOF_IPV6_ADDRESS) --trsvcid $(NVMEOF_IO_PORT) --adrfam IPV6 --verify-host-name
1313
$(NVMEOF_CLI) host add --subsystem $(NQN) --host-nqn "*"
1414
$(NVMEOF_CLI) namespace add_host --subsystem $(NQN) --nsid 2 --host-nqn $(HOSTNQN)
1515

0 commit comments

Comments
 (0)