]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
mgr/nfs: add cmount_path
authoravanthakkar <avanjohn@gmail.com>
Tue, 10 Oct 2023 17:06:28 +0000 (22:36 +0530)
committerAvan Thakkar <athakkar@redhat.com>
Fri, 6 Dec 2024 06:50:38 +0000 (12:20 +0530)
commite45aa32c964e7810399240c9d1b298333a70f636
treed47fede17837faab05fb85293dc037c6eb5bdba8
parent2e6e0fbf4fb88173e5804431557a61e2c5123a2e
mgr/nfs: add cmount_path

Implementing necessary changes for the NFS module to align with the new export block format introduced in nfs-ganesha-V5.6.
The purpose of these changes is to enhance memory efficiency for exports. To achieve this goal, we have introduced a new field
called cmount_path under the FSAL block of export. Initially, this is applicable only to CephFS-based exports.

Furthermore, the newly created CephFS exports will now share the same user_id and secret_access_key, which are determined based
on the NFS cluster name and filesystem name. This results in each export on the same filesystem using a shared connection,
thereby optimizing resource usage.

Signed-off-by: avanthakkar <avanjohn@gmail.com>
mgr/nfs: fix a unit test failure

Signed-off-by: John Mulligan <jmulligan@redhat.com>
mgr/nfs: fix a unit test failure

Signed-off-by: John Mulligan <jmulligan@redhat.com>
mgr/nfs: fix a unit test failure

Signed-off-by: John Mulligan <jmulligan@redhat.com>
mgr/nfs: enable user management on a per-fs basis

Add back the ability to create a user for a cephfs export but do
it only for a cluster+filesystem combination. According to the
ganesha devs this ought to continue sharing a cephfs client connection
across multiple exports.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
mgr/nfs: add more unit tests with cmount_path

Add more unit tests for CEPHFS based NFS exports with
newly added cmount_path field under FSAL.
Signed-off-by: avanthakkar <avanjohn@gmail.com>
mgr/nfs: fix rgw nfs export when no existing exports

Signed-off-by: avanthakkar <avanjohn@gmail.com>
mgr/nfs: generate user_id & access_key for apply_export(CEPHFS)

Generate user_id & secret_access_key for CephFS based exports
for apply export. Also ensure the export FSAL block has
`cmount_path`.

Fixes: https://tracker.ceph.com/issues/63377
Signed-off-by: avanthakkar <avanjohn@gmail.com>
mgr/nfs: simplify validation, update f-strings, add generate_user_id function

- Improved validation to check cmount_path as a superset of path
- Replaced format method with f-strings
- Added generate_user_id function using SHA-1 hash
- Enhanced error handling and integrated new user_id generation

Signed-off-by: Avan Thakkar <athakkar@redhat.com>
(cherry picked from commit 9c70adf8080c053950e89b220195e3aa47991f86)
src/pybind/mgr/nfs/export.py
src/pybind/mgr/nfs/ganesha_conf.py
src/pybind/mgr/nfs/module.py