Project

General

Profile

Actions

Bug #63120

open

mgr/nfs: support providing export ID while creating exports using 'nfs export create cephfs'

Added by Dhairya Parmar 7 months ago. Updated 5 months ago.

Status:
Triaged
Priority:
Normal
Category:
Administration/Usability
Target version:
% Done:

0%

Source:
Development
Tags:
Backport:
quincy,reef
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
mgr/nfs
Labels (FS):
NFS-cluster, task(easy)
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

TL;DR: Since we can provide export_ids while creating exports using 'nfs export apply -i', we should also allow the same using 'nfs export create cephfs'

I was hitting an issue while testing a NFS PR where it complained:

"/home/teuthworker/src/github.com_dparmar18_ceph_704ae1711138eefb8d98e68a71f86d346bab1a90/qa/tasks/cephfs/test_nfs.py", line 130, in _check_auth_ls
2023-10-05T20:50:30.288 INFO:tasks.cephfs_test_runner:    self.assertIn(f'{client_id}.{export_id}', output)
2023-10-05T20:50:30.288 INFO:tasks.cephfs_test_runner:AssertionError: 'client.nfs.test.3' not found in 'mds.a.smithi175.bjizrk\n\tkey:

and the test case had this for creating an export:
self._create_export(export_id='3',
                    extra_cmd=['--pseudo-path', self.pseudo_path+'3',
                    '--path', '/testdir3'])

I had an assumption that it creates export with given export ID and thus would create respective user whose syntax is nfs.{cluster_id}.{export_id} but to my surprise i found that this functionality is not supported by 'nfs export create cephfs' interface and (fault is also of the helper that asks for export_id which is a bit misleading) thus even though i have provided export_id = 3, it is actually creating export_id = 2 and thus creates client.nfs.test.2 as well and therefore we see the error. One can also check the auth ls that is printed in the teuthology log [0] before failing:
2023-10-05T20:50:05.153 DEBUG:teuthology.orchestra.run.smithi175:> sudo adjust-ulimits ceph-coverage /home/ubuntu/cephtest/archive/coverage timeout 120 ceph --cluster ceph auth ls
2023-10-05T20:50:05.557 INFO:teuthology.orchestra.run.smithi175.stdout:mds.a.smithi175.bjizrk
2023-10-05T20:50:05.557 INFO:teuthology.orchestra.run.smithi175.stdout:    key: AQCjHx9lt1LYFRAAA4EiB/n/5J2K7l9BfPoLEw==
2023-10-05T20:50:05.557 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mds] allow
2023-10-05T20:50:05.557 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mon] profile mds
2023-10-05T20:50:05.557 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [osd] allow rw tag cephfs *=*
2023-10-05T20:50:05.557 INFO:teuthology.orchestra.run.smithi175.stdout:mds.a.smithi175.fipvis
2023-10-05T20:50:05.557 INFO:teuthology.orchestra.run.smithi175.stdout:    key: AQClHx9lm28zLxAA+B12l/NGdEBiJNEYMSzdxw==
2023-10-05T20:50:05.557 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mds] allow
2023-10-05T20:50:05.557 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mon] profile mds
2023-10-05T20:50:05.558 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [osd] allow rw tag cephfs *=*
2023-10-05T20:50:05.558 INFO:teuthology.orchestra.run.smithi175.stdout:mds.nfs-cephfs.smithi175.fzpdut
2023-10-05T20:50:05.558 INFO:teuthology.orchestra.run.smithi175.stdout:    key: AQBGIR9lj5m7HhAA9XQkCMH7TFbpVNFNHu1iTg==
2023-10-05T20:50:05.558 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mds] allow
2023-10-05T20:50:05.558 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mon] profile mds
2023-10-05T20:50:05.558 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [osd] allow rw tag cephfs *=*
2023-10-05T20:50:05.558 INFO:teuthology.orchestra.run.smithi175.stdout:mds.nfs-cephfs.smithi175.rfleah
2023-10-05T20:50:05.558 INFO:teuthology.orchestra.run.smithi175.stdout:    key: AQBIIR9lvQAdLBAAqMGSLbjGRsFaq7xpTpYtzA==
2023-10-05T20:50:05.558 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mds] allow
2023-10-05T20:50:05.558 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mon] profile mds
2023-10-05T20:50:05.558 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [osd] allow rw tag cephfs *=*
2023-10-05T20:50:05.559 INFO:teuthology.orchestra.run.smithi175.stdout:osd.0
2023-10-05T20:50:05.559 INFO:teuthology.orchestra.run.smithi175.stdout:    key: AQBGHx9lt0Z9AxAAvzXSJACsve+/PSTPF7swLw==
2023-10-05T20:50:05.559 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mgr] allow profile osd
2023-10-05T20:50:05.559 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mon] allow profile osd
2023-10-05T20:50:05.559 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [osd] allow *
2023-10-05T20:50:05.559 INFO:teuthology.orchestra.run.smithi175.stdout:osd.1
2023-10-05T20:50:05.559 INFO:teuthology.orchestra.run.smithi175.stdout:    key: AQBaHx9llX4eNBAAMhBVgQ5VKPZRKgeCLjx8DQ==
2023-10-05T20:50:05.559 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mgr] allow profile osd
2023-10-05T20:50:05.559 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mon] allow profile osd
2023-10-05T20:50:05.559 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [osd] allow *
2023-10-05T20:50:05.559 INFO:teuthology.orchestra.run.smithi175.stdout:osd.2
2023-10-05T20:50:05.559 INFO:teuthology.orchestra.run.smithi175.stdout:    key: AQBvHx9lDIcJFxAAghynFvD8kpLjJwGU9F25Tw==
2023-10-05T20:50:05.560 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mgr] allow profile osd
2023-10-05T20:50:05.560 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mon] allow profile osd
2023-10-05T20:50:05.560 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [osd] allow *
2023-10-05T20:50:05.560 INFO:teuthology.orchestra.run.smithi175.stdout:client.0
2023-10-05T20:50:05.560 INFO:teuthology.orchestra.run.smithi175.stdout:    key: AQCKHx9lmCgMHhAA5wnM7VRLCtC2uWNXtTFI5Q==
2023-10-05T20:50:05.560 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mds] allow *
2023-10-05T20:50:05.560 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mgr] allow *
2023-10-05T20:50:05.560 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mon] allow *
2023-10-05T20:50:05.560 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [osd] allow *
2023-10-05T20:50:05.560 INFO:teuthology.orchestra.run.smithi175.stdout:client.admin
2023-10-05T20:50:05.560 INFO:teuthology.orchestra.run.smithi175.stdout:    key: AQDpHh9lUDAvFhAAo7q2BzTyH/c8s7Gi5tb0YQ==
2023-10-05T20:50:05.560 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mds] allow *
2023-10-05T20:50:05.561 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mgr] allow *
2023-10-05T20:50:05.561 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mon] allow *
2023-10-05T20:50:05.561 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [osd] allow *
2023-10-05T20:50:05.561 INFO:teuthology.orchestra.run.smithi175.stdout:client.bootstrap-mds
2023-10-05T20:50:05.561 INFO:teuthology.orchestra.run.smithi175.stdout:    key: AQDsHh9lhG1vOhAAhvlJlBhuMPW8P6Kf/BvB3g==
2023-10-05T20:50:05.561 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mon] allow profile bootstrap-mds
2023-10-05T20:50:05.561 INFO:teuthology.orchestra.run.smithi175.stdout:client.bootstrap-mgr
2023-10-05T20:50:05.561 INFO:teuthology.orchestra.run.smithi175.stdout:    key: AQDsHh9l6nVvOhAAzRoeIXDjVJXYRkcE7DzKhA==
2023-10-05T20:50:05.561 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mon] allow profile bootstrap-mgr
2023-10-05T20:50:05.561 INFO:teuthology.orchestra.run.smithi175.stdout:client.bootstrap-osd
2023-10-05T20:50:05.561 INFO:teuthology.orchestra.run.smithi175.stdout:    key: AQDsHh9lOX1vOhAAH/CR1pzzWmTnwQQog20P5A==
2023-10-05T20:50:05.562 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mon] allow profile bootstrap-osd
2023-10-05T20:50:05.562 INFO:teuthology.orchestra.run.smithi175.stdout:client.bootstrap-rbd
2023-10-05T20:50:05.562 INFO:teuthology.orchestra.run.smithi175.stdout:    key: AQDsHh9ltIRvOhAAVc1AT6Ln7SmhpDzJoULILQ==
2023-10-05T20:50:05.562 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mon] allow profile bootstrap-rbd
2023-10-05T20:50:05.562 INFO:teuthology.orchestra.run.smithi175.stdout:client.bootstrap-rbd-mirror
2023-10-05T20:50:05.562 INFO:teuthology.orchestra.run.smithi175.stdout:    key: AQDsHh9lQoxvOhAAC58FHFW5465ANJt0d8C67Q==
2023-10-05T20:50:05.562 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mon] allow profile bootstrap-rbd-mirror
2023-10-05T20:50:05.562 INFO:teuthology.orchestra.run.smithi175.stdout:client.bootstrap-rgw
2023-10-05T20:50:05.563 INFO:teuthology.orchestra.run.smithi175.stdout:    key: AQDsHh9lqpZvOhAAnGoAvY3MZfxtOKvlC76lGQ==
2023-10-05T20:50:05.563 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mon] allow profile bootstrap-rgw
2023-10-05T20:50:05.563 INFO:teuthology.orchestra.run.smithi175.stdout:client.nfs.test.0.0.smithi175.hkfosa
2023-10-05T20:50:05.563 INFO:teuthology.orchestra.run.smithi175.stdout:    key: AQBzIR9ltdU8MRAAHlm+0OVF02xJttO8kYOUig==
2023-10-05T20:50:05.563 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mon] allow r
2023-10-05T20:50:05.563 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [osd] allow rw pool=.nfs namespace=test
2023-10-05T20:50:05.563 INFO:teuthology.orchestra.run.smithi175.stdout:client.nfs.test.0.0.smithi175.hkfosa-rgw
2023-10-05T20:50:05.563 INFO:teuthology.orchestra.run.smithi175.stdout:    key: AQBzIR9lK2ZANxAAGgV1pSKpiWuv7JcjILxkNQ==
2023-10-05T20:50:05.564 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mon] allow r
2023-10-05T20:50:05.564 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [osd] allow rwx tag rgw *=*
2023-10-05T20:50:05.564 INFO:teuthology.orchestra.run.smithi175.stdout:client.nfs.test.1
2023-10-05T20:50:05.564 INFO:teuthology.orchestra.run.smithi175.stdout:    key: AQB8IR9luAWdEBAAMCiwsg3Uy2FOUxun1eVcbw==
2023-10-05T20:50:05.564 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mds] allow rw path=/testdir1
2023-10-05T20:50:05.564 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mon] allow r
2023-10-05T20:50:05.564 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [osd] allow rw pool=.nfs namespace=test, allow rw tag cephfs data=nfs-cephfs
2023-10-05T20:50:05.564 INFO:teuthology.orchestra.run.smithi175.stdout:client.nfs.test.2
2023-10-05T20:50:05.564 INFO:teuthology.orchestra.run.smithi175.stdout:    key: AQB9IR9lbEPBBxAAfeZmEvL7y+D6ndN74cZdxw==
2023-10-05T20:50:05.564 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mds] allow rw path=/testdir3
2023-10-05T20:50:05.564 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mon] allow r
2023-10-05T20:50:05.564 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [osd] allow rw pool=.nfs namespace=test, allow rw tag cephfs data=nfs-cephfs
2023-10-05T20:50:05.565 INFO:teuthology.orchestra.run.smithi175.stdout:client.test
2023-10-05T20:50:05.565 INFO:teuthology.orchestra.run.smithi175.stdout:    key: AQABIB9l0ZEDOBAA/kC9j1guU/m/ryOBudswCQ==
2023-10-05T20:50:05.565 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mds] allow rw path=/
2023-10-05T20:50:05.565 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mon] allow r
2023-10-05T20:50:05.565 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [osd] allow rw pool=.nfs namespace=test, allow rw tag cephfs data=user_test_fs
2023-10-05T20:50:05.565 INFO:teuthology.orchestra.run.smithi175.stdout:mgr.x
2023-10-05T20:50:05.565 INFO:teuthology.orchestra.run.smithi175.stdout:    key: AQDqHh9loH+QBhAApNHNEsEZl34GEZfauhB5Hw==
2023-10-05T20:50:05.565 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mds] allow *
2023-10-05T20:50:05.565 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [mon] profile mgr
2023-10-05T20:50:05.565 INFO:teuthology.orchestra.run.smithi175.stdout:    caps: [osd] allow *

There is client.nfs.test.1 and client.nfs.test.2 but not client.nfs.test.3

I checked the docs [1] and also the code for create_cephfs_export() in mgr/nfs/export.py which is:

export = self.create_export_from_dict(
                cluster_id,
                self._gen_export_id(cluster_id)

So this means 'nfs export create cephfs' has no control over the export_id and the exports created using this interface will have export_id and users with sequential numbering BUT this doesn't mean that we cannot provide export_id (and thus create user) as per our will. Running 'nfs export apply -i <export_block>' allows us to mention export_id and will also create its respective user i.e. if export_id: 120 then it will successfully create that export and will also generate the correct user for it i.e. nfs.foo-cluster.120

[0] http://qa-proxy.ceph.com/teuthology/dparmar-2023-10-05_20:10:56-fs:nfs-fix-nfs-apply-err-reporting-distro-default-smithi/7412022/teuthology.log
[1] https://docs.ceph.com/en/octopus/cephfs/fs-nfs-exports/#create-cephfs-export

Actions #1

Updated by Venky Shankar 5 months ago

  • Tracker changed from Feature to Bug
  • Assignee set to Dhairya Parmar
  • Target version set to v19.0.0
  • Backport set to quincy,reef
  • Regression set to No
  • Severity set to 3 - minor

Dhairya Parmar wrote:

TL;DR: Since we can provide export_ids while creating exports using 'nfs export apply -i', we should also allow the same using 'nfs export create cephfs'

I was hitting an issue while testing a NFS PR where it complained:
[...]
and the test case had this for creating an export:
[...]
I had an assumption that it creates export with given export ID and thus would create respective user whose syntax is nfs.{cluster_id}.{export_id} but to my surprise i found that this functionality is not supported by 'nfs export create cephfs' interface and (fault is also of the helper that asks for export_id which is a bit misleading) thus even though i have provided export_id = 3, it is actually creating export_id = 2 and thus creates client.nfs.test.2 as well and therefore we see the error. One can also check the auth ls that is printed in the teuthology log [0] before failing:
[...]

There is client.nfs.test.1 and client.nfs.test.2 but not client.nfs.test.3

I checked the docs [1] and also the code for create_cephfs_export() in mgr/nfs/export.py which is:
[...]
So this means 'nfs export create cephfs' has no control over the export_id and the exports created using this interface will have export_id and users with sequential numbering BUT this doesn't mean that we cannot provide export_id (and thus create user) as per our will. Running 'nfs export apply -i <export_block>' allows us to mention export_id and will also create its respective user i.e. if export_id: 120 then it will successfully create that export and will also generate the correct user for it i.e. nfs.foo-cluster.120

Fair point. I think this should be pretty straight-forward to fix. BTW, this isn't a feature proposal as such bur rather a bug fix IMO.

Actions #2

Updated by Venky Shankar 5 months ago

  • Status changed from New to Triaged
Actions

Also available in: Atom PDF