Issue: If QoS is disabled at cluster level and export still has QoS enabled, then when user tries to pass 'ceph nfs export info' output to 'ceph nfs export apply' command. it fails saying 'Please enable QoS at cluster level first'
Cause: We don't allow setting QoS at export level when its disabled at cluster level, In this case it was set before disabling at cluster level, so export info is showing qos setting.
Consequence: 'ceph nfs export apply' command will fail if QOS block is present in file passed to command.
Workaround (if any): User can just remove QOS block and run command again.
Result: 'ceph nfs qos apply' will be successful.
Description of problem: ====================== After enabling and disabling QoS at the cluster level, the QoS-related entries remain in the export block. As a result, any attempts to modify values in the export file fail. # ceph nfs export apply nfsganesha -i ganeshavol1 [ { "msg": "Failed to apply export: To configure bandwidth control for export, you must first enable bandwidth control at the cluster level for nfsganesha.", "pseudo": "/ganeshavol1", "state": "error" } ] Version-Release number of selected component (if applicable): ================== # ceph --version ceph version 19.2.0-108.el9cp (1762f710a9f63e0304d69ed81ad964841146c93d) squid (stable) # rpm -qa | grep nfs libnfsidmap-2.5.4-27.el9.x86_64 nfs-utils-2.5.4-27.el9.x86_64 nfs-ganesha-selinux-6.5-5.el9cp.noarch nfs-ganesha-6.5-5.el9cp.x86_64 nfs-ganesha-ceph-6.5-5.el9cp.x86_64 nfs-ganesha-rados-grace-6.5-5.el9cp.x86_64 nfs-ganesha-rados-urls-6.5-5.el9cp.x86_64 nfs-ganesha-rgw-6.5-5.el9cp.x86_64 nfs-ganesha-utils-6.5-5.el9cp.x86_64 How reproducible: =============== Always Steps to Reproduce: ============== 1.Create NFS Ganesha cluster 2. Enable the QoS at cluster level 3. Enable the QoS at the export level 4. Disable the QoS at the cluster level 5. Now try to update the export file. Eg update "access_type": "RW" --> "access_type": "RO" [ceph: root@cali013 ceph]# ceph nfs export info nfsganesha /ganeshavol1 > ganeshavol1 [ceph: root@cali013 ceph]# cat ganeshavol1 { "access_type": "RW", "clients": [], "cluster_id": "nfsganesha", "export_id": 1, "fsal": { "cmount_path": "/", "fs_name": "cephfs", "name": "CEPH", "user_id": "nfs.nfsganesha.cephfs.2c1043d4" }, "path": "/volumes/ganeshagroup/ganesha1/11fc5576-4e2e-46e2-8a58-5ec2b6030a93", "protocols": [ 3, 4 ], "pseudo": "/ganeshavol1", "qos_block": { "combined_rw_bw_control": false, "enable_bw_control": true, "enable_iops_control": true, "enable_qos": true, "max_export_iops": 10000, "max_export_read_bw": "1.0GB", "max_export_write_bw": "1.0GB" }, "security_label": true, "squash": "none", "transports": [ "TCP" ] } [ceph: root@cali013 ceph]# sed -i 's/"access_type": "RW"/"access_type": "RO"/' ganeshavol1 [ceph: root@cali013 ceph]# cat ganeshavol1 { "access_type": "RO", "clients": [], "cluster_id": "nfsganesha", "export_id": 1, "fsal": { "cmount_path": "/", "fs_name": "cephfs", "name": "CEPH", "user_id": "nfs.nfsganesha.cephfs.2c1043d4" }, "path": "/volumes/ganeshagroup/ganesha1/11fc5576-4e2e-46e2-8a58-5ec2b6030a93", "protocols": [ 3, 4 ], "pseudo": "/ganeshavol1", "qos_block": { "combined_rw_bw_control": false, "enable_bw_control": true, "enable_iops_control": true, "enable_qos": true, "max_export_iops": 10000, "max_export_read_bw": "1.0GB", "max_export_write_bw": "1.0GB" }, "security_label": true, "squash": "none", "transports": [ "TCP" ] } # ceph nfs export apply nfsganesha -i ganeshavol1 [ { "msg": "Failed to apply export: To configure bandwidth control for export, you must first enable bandwidth control at the cluster level for nfsganesha.", "pseudo": "/ganeshavol1", "state": "error" } ] Error EAGAIN: To configure bandwidth control for export, you must first enable bandwidth control at the cluster level for nfsganesha. for export block at index 1 Actual results: ============== Updating any other value at export level is getting failed Expected results: =============== It should allow to modify the export block Additional info: