2023-10-26 07:55:44 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
sudo modprobe nvme-fabrics
|
|
|
|
sudo modprobe nvme-tcp
|
|
|
|
sudo dnf install nvme-cli -y
|
|
|
|
|
|
|
|
source /etc/ceph/nvmeof.env
|
|
|
|
|
2024-02-01 13:07:27 +00:00
|
|
|
# RBD_POOL and RBD_IMAGE is intended to be set from yaml, 'mypool' and 'myimage' are defaults
|
|
|
|
RBD_POOL="${RBD_POOL:-mypool}"
|
|
|
|
RBD_IMAGE="${RBD_IMAGE:-myimage}"
|
2023-10-26 07:55:44 +00:00
|
|
|
|
2024-02-01 13:07:27 +00:00
|
|
|
HOSTNAME=$(hostname)
|
2023-10-26 07:55:44 +00:00
|
|
|
sudo podman images
|
|
|
|
sudo podman ps
|
2024-02-01 13:07:27 +00:00
|
|
|
sudo podman run -it $NVMEOF_CLI_IMAGE --server-address $NVMEOF_GATEWAY_IP_ADDRESS --server-port $NVMEOF_SRPORT subsystem list
|
|
|
|
sudo podman run -it $NVMEOF_CLI_IMAGE --server-address $NVMEOF_GATEWAY_IP_ADDRESS --server-port $NVMEOF_SRPORT subsystem add --subsystem $NVMEOF_NQN
|
|
|
|
sudo podman run -it $NVMEOF_CLI_IMAGE --server-address $NVMEOF_GATEWAY_IP_ADDRESS --server-port $NVMEOF_SRPORT namespace add --subsystem $NVMEOF_NQN --rbd-pool $RBD_POOL --rbd-image $RBD_IMAGE
|
|
|
|
sudo podman run -it $NVMEOF_CLI_IMAGE --server-address $NVMEOF_GATEWAY_IP_ADDRESS --server-port $NVMEOF_SRPORT listener add --subsystem $NVMEOF_NQN --gateway-name client.$NVMEOF_GATEWAY_NAME --traddr $NVMEOF_GATEWAY_IP_ADDRESS --trsvcid $NVMEOF_PORT
|
|
|
|
sudo podman run -it $NVMEOF_CLI_IMAGE --server-address $NVMEOF_GATEWAY_IP_ADDRESS --server-port $NVMEOF_SRPORT host add --subsystem $NVMEOF_NQN --host "*"
|
|
|
|
sudo podman run -it $NVMEOF_CLI_IMAGE --server-address $NVMEOF_GATEWAY_IP_ADDRESS --server-port $NVMEOF_SRPORT subsystem list
|
2023-10-26 07:55:44 +00:00
|
|
|
sudo lsmod | grep nvme
|
|
|
|
sudo nvme list
|
|
|
|
|
2024-02-01 13:07:27 +00:00
|
|
|
echo "[nvmeof] Initiator setup done"
|