Skip to content

Commit 9eb3b99

Browse files
committed
mgr/cephadm: Make the discovery and gateway IPs configurable in NVMEof configuration
Fixes https://tracker.ceph.com/issues/68030 Signed-off-by: Gil Bregman <[email protected]>
1 parent 02bbd3c commit 9eb3b99

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/pybind/mgr/cephadm/services/nvmeof.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,17 @@ def prepare_create(self, daemon_spec: CephadmDaemonDeploySpec) -> CephadmDaemonD
4747
transport_tcp_options = json.dumps(spec.transport_tcp_options) if spec.transport_tcp_options else None
4848
name = '{}.{}'.format(utils.name_to_config_section('nvmeof'), nvmeof_gw_id)
4949
rados_id = name[len('client.'):] if name.startswith('client.') else name
50+
addr = host_ip
51+
discovery_addr = host_ip
52+
if spec.addr and spec.addr != "0.0.0.0":
53+
addr = spec.addr
54+
if spec.discovery_addr and spec.discovery_addr != "0.0.0.0":
55+
discovery_addr = spec.discovery_addr
5056
context = {
5157
'spec': spec,
5258
'name': name,
53-
'addr': host_ip,
59+
'addr': addr,
60+
'discovery_addr': discovery_addr,
5461
'port': spec.port,
5562
'spdk_log_level': 'WARNING',
5663
'rpc_socket_dir': '/var/tmp/',

src/pybind/mgr/cephadm/templates/services/nvmeof/ceph-nvmeof.conf.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ max_log_directory_backups = {{ spec.max_log_directory_backups }}
3232
log_directory = {{ spec.log_directory }}
3333

3434
[discovery]
35-
addr = {{ addr }}
35+
addr = {{ discovery_addr }}
3636
port = {{ spec.discovery_port }}
3737

3838
[ceph]

0 commit comments

Comments
 (0)