diff --git a/README.md b/README.md index 479ca120..897e1ffb 100644 --- a/README.md +++ b/README.md @@ -146,6 +146,16 @@ The same configuration can also be manually run: cephnvmf host add --subsystem nqn.2016-06.io.spdk:cnode1 --host "*" ``` +These can also be run by setting environment variables `CEPH_NVMEOF_SERVER_ADDRESS` and `CEPH_NVMEOF_SERVER_PORT` before running nvmeof-cli commands, example: +``` +export CEPH_NVMEOF_SERVER_ADDRESS=x.x.x.x +export CEPH_NVMEOF_SERVER_PORT=5500 + +// using containers +docker-compose run --it subsystem add --subsystem nqn.2016-06.io.spdk:cnode1 +// using pypi package +ceph-nvmeof subsystem add --subsystem nqn.2016-06.io.spdk:cnode1 +``` ### Mounting the NVMe-oF volume diff --git a/control/cli.py b/control/cli.py index d82f385b..178d99e9 100644 --- a/control/cli.py +++ b/control/cli.py @@ -108,13 +108,13 @@ def __init__(self): required=False) self.parser.add_argument( "--server-address", - default="localhost", + default=(os.getenv('CEPH_NVMEOF_SERVER_ADDRESS') or "localhost"), type=str, help="Server address", ) self.parser.add_argument( "--server-port", - default=5500, + default=int(os.getenv('CEPH_NVMEOF_SERVER_PORT') or "5500"), type=int, help="Server port", )