Bug 2267814

Summary: [NFS-Ganesha] [Dashboard] Modifying the export block causing the export v3 changes wipe away.
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Manisha Saini <msaini>
Component: Ceph-DashboardAssignee: avan <athakkar>
Status: CLOSED ERRATA QA Contact: Manisha Saini <msaini>
Severity: high Docs Contact: Akash Raj <akraj>
Priority: unspecified    
Version: 7.1CC: akraj, athakkar, ceph-eng-bugs, cephqe-warriors, jcaratza, tserlin
Target Milestone: ---   
Target Release: 7.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ceph-18.2.1-106.el9cp Doc Type: Bug Fix
Doc Text:
.Ceph dashboard now supports both NFS v3 and v4-enabled export management Previously, the Ceph dashboard only supported the NFSv4-enabled exports management and not the NFSv3-enabled exports. Due to this, any management done for exports via CLI for NFSv3 was corrupted. With this fix, support for NFSv3-based exports management is enabled by having an additional checkbox. The Ceph dashboard now supports both v3 and v4-enabled export management.
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-06-13 14:28:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2267614, 2298578, 2298579    

Description Manisha Saini 2024-03-04 20:54:03 UTC
Description of problem:
===============

To enable the v3 on NFS-Ganesha export, currently, the export file needs to be edited via ceph cli and changes needs to be applied to ceph orchestrator -

1. ceph nfs export info msaini /ganeshav3 > ganeshav3.conf
2. sed -i '/"protocols": \[/a \ \ \ \ 3,' ganeshav3.conf
3. ceph nfs export apply msaini -i ganeshav3.conf
[
  {
    "pseudo": "/ganeshav3",
    "state": "updated"
  }
]

# ceph nfs export info msaini /ganeshav3
{
  "access_type": "RW",
  "clients": [],
  "cluster_id": "msaini",
  "export_id": 3,
  "fsal": {
    "cmount_path": "/",
    "fs_name": "cephfs",
    "name": "CEPH",
    "user_id": "nfs.msaini.cephfs"
  },
  "path": "/",
  "protocols": [
    3,
    4
  ],
  "pseudo": "/ganeshav3",
  "security_label": true,
  "squash": "none",
  "transports": [
    "TCP"
  ]
}

4. mount -t nfs -o vers=3 10.8.128.216:/ganeshav3 /mnt/ganeshav3/
# cd /mnt/ganeshav3/

If the same export is edited via Dashboard, Eg - Enable rootsquash via dashboard or add any client permission for the export specific, the v3 changes gets wiped away and mount via v3 protocol now fails

Changes reverted
=====

[ceph: root@argo016 /]# ceph nfs export info msaini /ganeshav3
{
  "access_type": "RW",
  "clients": [],
  "cluster_id": "msaini",
  "export_id": 3,
  "fsal": {
    "cmount_path": "/",
    "fs_name": "cephfs",
    "name": "CEPH",
    "user_id": "nfs.msaini.cephfs"
  },
  "path": "/",
  "protocols": [
    4
  ],
  "pseudo": "/ganeshav3",
  "security_label": false,
  "squash": "root_squash",
  "transports": [
    "TCP"
  ]
} 



Version-Release number of selected component (if applicable):
===========================

# ceph --version
ceph version 18.2.1-42.el9cp (99eeea5747b2d0f6873630efda2d6d2d50d7ae61) reef (stable)

How reproducible:
========
2/2


Steps to Reproduce:
1. Create ganesha cluster
2. Create an export
3. Modify the ganesha.conf file and export config to enable the v3 mount 
4. From dashboard, modify the export values. Eg - Enable rootsquash for the export

Actual results:
========

The v3 changes applied via cli for v3 goes away and rootsquash is enabled

Expected results:
=========

The v3 changes should be persistent on export

Additional info:

Comment 5 Manisha Saini 2024-04-22 19:16:28 UTC
Verified this BZ with

# ceph --version
ceph version 18.2.1-150.el9cp (4a63dafcc8b87d799b599d01d34a419e85212ed1) reef (stable)

# rpm -qa | grep ganesha
nfs-ganesha-selinux-5.7-3.el9cp.noarch
nfs-ganesha-5.7-3.el9cp.x86_64
nfs-ganesha-rgw-5.7-3.el9cp.x86_64
nfs-ganesha-ceph-5.7-3.el9cp.x86_64
nfs-ganesha-rados-grace-5.7-3.el9cp.x86_64
nfs-ganesha-rados-urls-5.7-3.el9cp.x86_64


Modifying the export from cephadm cli is reflecting correctly at the dashboard end.

1. Create an export from Dashboard with NFSv3 and NFSv4 enabled.
2. Modify the export block from cli side to only enable v3 mount.
3. Check the export details from Dashboard. Only v3 is enabled
4. Modify the export again from dashboard side to enable v4 and v3 both.
5. Check from cli side. Both v3 and v4 are enabled in volume export info.

Moving this BZ to verified state.

Comment 8 errata-xmlrpc 2024-06-13 14:28:45 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Critical: Red Hat Ceph Storage 7.1 security, enhancements, and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2024:3925