Skip to content

Commit

Permalink
mgr/cephadm: Make the discovery and gateway IPs configurable in NVMEo…
Browse files Browse the repository at this point in the history
…f configuration

Fixes https://tracker.ceph.com/issues/68030

Signed-off-by: Gil Bregman <[email protected]>
  • Loading branch information
gbregman committed Sep 11, 2024
1 parent 02bbd3c commit 9eb3b99
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/pybind/mgr/cephadm/services/nvmeof.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,17 @@ def prepare_create(self, daemon_spec: CephadmDaemonDeploySpec) -> CephadmDaemonD
transport_tcp_options = json.dumps(spec.transport_tcp_options) if spec.transport_tcp_options else None
name = '{}.{}'.format(utils.name_to_config_section('nvmeof'), nvmeof_gw_id)
rados_id = name[len('client.'):] if name.startswith('client.') else name
addr = host_ip
discovery_addr = host_ip
if spec.addr and spec.addr != "0.0.0.0":
addr = spec.addr
if spec.discovery_addr and spec.discovery_addr != "0.0.0.0":
discovery_addr = spec.discovery_addr
context = {
'spec': spec,
'name': name,
'addr': host_ip,
'addr': addr,
'discovery_addr': discovery_addr,
'port': spec.port,
'spdk_log_level': 'WARNING',
'rpc_socket_dir': '/var/tmp/',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ max_log_directory_backups = {{ spec.max_log_directory_backups }}
log_directory = {{ spec.log_directory }}

[discovery]
addr = {{ addr }}
addr = {{ discovery_addr }}
port = {{ spec.discovery_port }}

[ceph]
Expand Down

0 comments on commit 9eb3b99

Please sign in to comment.