Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NetApp disable nfs v4.0 for new share servers #244

Open
wants to merge 1 commit into
base: stable/xena-m3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions manila/share/drivers/netapp/dataontap/client/client_cmode.py
Original file line number Diff line number Diff line change
Expand Up @@ -1827,13 +1827,7 @@ def _enable_nfs_protocols(self, versions, method='create',
extra_config=None):
"""Set the enabled NFS protocol versions."""
nfs3 = 'true' if 'nfs3' in versions else 'false'
# SAPCC absence of 'nfs4.0' should not equal 'false'
# instead it should mean:
# don't touch existing value for existing vservers
# and set the default value ('false' for ONTAP 9.7 and newer)
# for new vservers
# Change back to upstream once all vservers have nfs4.0 disabled!
# nfs40 = 'true' if 'nfs4.0' in versions else 'false'
nfs40 = 'true' if 'nfs4.0' in versions else 'false'
nfs41 = 'true' if 'nfs4.1' in versions else 'false'

nfs_service_modify_args = {
Expand All @@ -1845,15 +1839,21 @@ def _enable_nfs_protocols(self, versions, method='create',
'enable-ejukebox': 'false',
'is-vstorage-enabled': 'true',
}
# below options are dangerous to change on existing vservers:
# e.g. clients may lose connections or remount is required.
# absence of those options on method 'update' means to not touch them
# e.g. during ensure runs
if method == 'create':
flexgroup_opts = {
'is-nfsv3-64bit-identifiers-enabled': 'true', # default false
'is-nfsv4-64bit-identifiers-enabled': 'true', # default true
}
nfs_service_modify_args.update(flexgroup_opts)
version_opts = {
'is-nfsv40-enabled': nfs40,
}
nfs_service_modify_args.update(version_opts)

if 'nfs4.0' in versions:
nfs_service_modify_args['is-nfsv40-enabled'] = 'true'
if 'nfs4.1' in versions:
nfs41_opts = {
# 'is-nfsv41-pnfs-enabled': 'false', # default false, use default on new vservers, don't touch old vservers # noqa: E501
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2647,8 +2647,6 @@ def test_enable_nfs_protocols(self, v3, v40, v41, method, extra):
'is-vstorage-enabled': 'true',
}

if v40:
nfs_service_modify_args['is-nfsv40-enabled'] = 'true'
if v41:
nfs41_opts = {
'is-nfsv41-acl-enabled': 'false',
Expand All @@ -2664,6 +2662,8 @@ def test_enable_nfs_protocols(self, v3, v40, v41, method, extra):
'is-nfsv4-64bit-identifiers-enabled': 'true',
}
nfs_service_modify_args.update(flexgroup_opts)
v40_enabled = 'true' if v40 else 'false'
nfs_service_modify_args['is-nfsv40-enabled'] = v40_enabled

if extra:
nfs_service_modify_args.update(extra)
Expand Down