Skip to content

Commit c353b78

Browse files
committed
mgr/cephadm: add Server_Scope = <fsid> to NFSv4 section of ganesha conf
From the ganesha team """ In the NFSv4 param block, we need a parameter Server_Scope set to some value common among all servers in a cluster. The default with it blank is to use the hostname which may be different for each server in the cluster. """ This is related to ongoing work on high availability nfs. From the cephadm side we just need to make sure all nfs daemons in the cluster end up with the same value for the Server_Scope field. This patch uses the cluster id (which we already brought into the template as the "namespace" attribute) Signed-off-by: Adam King <[email protected]>
1 parent b7d3d39 commit c353b78

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ def get_ganesha_conf() -> str:
122122
"haproxy_hosts": [],
123123
"nfs_idmap_conf": nfs_idmap_conf,
124124
"enable_nlm": str(spec.enable_nlm).lower(),
125+
"cluster_id": self.mgr._cluster_fsid,
125126
}
126127
if spec.enable_haproxy_protocol:
127128
context["haproxy_hosts"] = self._haproxy_hosts()

src/pybind/mgr/cephadm/templates/services/nfs/ganesha.conf.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ NFSv4 {
1919
Delegations = false;
2020
RecoveryBackend = 'rados_cluster';
2121
Minor_Versions = 1, 2;
22+
Server_Scope = {{ cluster_id }}-{{ namespace }}
2223
{% if nfs_idmap_conf %}
2324
IdmapConf = "{{ nfs_idmap_conf }}";
2425
{% endif %}

src/pybind/mgr/cephadm/tests/test_services.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3292,6 +3292,7 @@ def fake_keys():
32923292
' Delegations = false;\n'
32933293
" RecoveryBackend = 'rados_cluster';\n"
32943294
' Minor_Versions = 1, 2;\n'
3295+
f' Server_Scope = {cephadm_module._cluster_fsid}-foo\n'
32953296
' IdmapConf = "/etc/ganesha/idmap.conf";\n'
32963297
'}\n'
32973298
'\n'

0 commit comments

Comments
 (0)