Bug 2302756

Summary: [8.0] [NFS-Ganesha][Dashboard] While creating nfs export via dashboard, CephFS Path should be non-editable and Pseudo path should be left blank for user input
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Manisha Saini <msaini>
Component: Ceph-DashboardAssignee: dtalweka
Status: CLOSED ERRATA QA Contact: Manisha Saini <msaini>
Severity: high Docs Contact: Akash Raj <akraj>
Priority: unspecified    
Version: 8.0CC: akraj, ceph-eng-bugs, cephqe-warriors, dtalweka, nia, rpollack, tserlin
Target Milestone: ---   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ceph-19.2.0-4.el9cp Doc Type: Bug Fix
Doc Text:
.Validation for pseudo path and CephFS path is now added during NFS export creation Previously, during the creation of NFS export, the psuedo path had to be entered manually. As a result, CephFS path could not be validated. With this fix, the pseudo path field is left blank for the user to input a path and CephFS path gets the updated path from the selected subvolume group and subvolume. A validation is now also in place for invalid values added for CephFS path. If a user attempts to change the CephFS path to an invalid value, the export creation fails.
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-11-25 09:04:58 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: 2317218    

Description Manisha Saini 2024-08-04 23:38:04 UTC
Description of problem:
======================

While creating NFS Ganesha export via Dashboard, the "CephFS Path" and "Pseudo" path are autofilled. 

1. The CephFS path should be immutable. If a user attempts to change the CephFS path to an invalid value, the export creation still succeeds, although it should ideally fail due to the invalid path.


Scenario -
==========

If the user edit the default "CephFS Path" to someother value -

Original Path - /volumes/nfssubvolgroup/nfsvol/283b30d1-9efe-4d97-beb8-63ae1d17a34b

Overwritten the Path - /volumes/nfssubvolgroup/nfsvol/283b30d1-9efe-4d97-beb8-63ae1d17a3

The export creation is still successful and mount fail on client since the path mentioned is incorrect

# ceph nfs export info nfsganesha /cephfs/volumes/nfssubvolgroup/nfsvol/283b30d1-9efe-4d97-beb8-63ae1d17a3
{
  "access_type": "RW",
  "clients": [],
  "cluster_id": "nfsganesha",
  "export_id": 2,
  "fsal": {
    "fs_name": "cephfsnfs",
    "name": "CEPH",
    "user_id": "nfs.nfsganesha.2"
  },
  "path": "/volumes/nfssubvolgroup/nfsvol/283b30d1-9efe-4d97-beb8-63ae1d17a3",
  "protocols": [
    3,
    4
  ],
  "pseudo": "/cephfs/volumes/nfssubvolgroup/nfsvol/283b30d1-9efe-4d97-beb8-63ae1d17a3",
  "security_label": false,
  "squash": "no_root_squash",
  "transports": [
    "TCP",
    "UDP"
  ]
}


In actual, if same is tried with cephadm cli, it fails

# ceph nfs export create cephfs nfsganesha /export_demo cephfs --path=/volumes/nfssubvolgroup/nfsvol/283b30d1-9efe-4d97-beb8-63ae1d17a3

[ceph: root@ceph-auto-cluster-pd1jue-node1-installer /]# ceph nfs export create cephfs nfsganesha /export_demo cephfsnfs --path=/volumes/nfssubvolgroup/nfsvol/283b30d1-9efe-4d97-beb8-63ae1d17a3
Error ENOENT: path /volumes/nfssubvolgroup/nfsvol/283b30d1-9efe-4d97-beb8-63ae1d17a3 does not exist


[ceph: root@ceph-auto-cluster-pd1jue-node1-installer /]# ceph nfs export create cephfs nfsganesha /export_demo cephfsnfs --path=/volumes/nfssubvolgroup/nfsvol/283b30d1-9efe-4d97-beb8-63ae1d17a34b
{
  "bind": "/export_demo",
  "cluster": "nfsganesha",
  "fs": "cephfsnfs",
  "mode": "RW",
  "path": "/volumes/nfssubvolgroup/nfsvol/283b30d1-9efe-4d97-beb8-63ae1d17a34b"
}

# ceph nfs export info nfsganesha /export_demo
{
  "access_type": "RW",
  "clients": [],
  "cluster_id": "nfsganesha",
  "export_id": 3,
  "fsal": {
    "fs_name": "cephfsnfs",
    "name": "CEPH",
    "user_id": "nfs.nfsganesha.3"
  },
  "path": "/volumes/nfssubvolgroup/nfsvol/283b30d1-9efe-4d97-beb8-63ae1d17a34b",
  "protocols": [
    4
  ],
  "pseudo": "/export_demo",
  "security_label": true,
  "squash": "none",
  "transports": [
    "TCP"
  ]
}


2. Pseudo Path: This field should be left blank for the user to input a name. Currently, it automatically uses the same Pseudo name as the CephFS Path.

(i) If the user attempts to create an export on the same CephFS subvolume from which an export was previously created, the same Pseudo name is autofilled by default, causing the export creation to fail. To successfully create a new export on the same CephFS subvolume, the user must provide a different Pseudo name.

(ii) The Pseudo Name is used for mounting the export on the client. Using a complex name can make it difficult for the user to differentiate between multiple exports.

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

# ceph --version
ceph version 19.1.0-15.el9cp (f552c890eaaac66497a15d2c04b4fc4cab52f209) squid (rc)


How reproducible:
================
1/1


Steps to Reproduce:
1. On Dashboard, create cephfs filesystem, subvolume group and subvolume
2. On File --> NFS Page, try creating the export twice using the same subvolume

Actual results:
==============
1. Export creation still pass if the incorrect CephFS path is given while creating export

2. Pseudo Name is autofilled. As a result, when user try creating another export using same subvolume, export creation will fail with same Pseudo name. User will have to delete the autofill entry and give a unique name.


Expected results:
================
1. CephFS path validation should be implemented in the Dashboard, or the path should be made uneditable.

2. The Pseudo Name should not be autofilled. Instead, the user should see a blank space in the field, as was the case in previous releases.


Additional info:

Comment 6 errata-xmlrpc 2024-11-25 09:04:58 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 (Red Hat Ceph Storage 8.0 security, bug fix, and enhancement updates), 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/RHBA-2024:10216