Bug 2245261 - nfs exports of cephfs subvolumes path '/volumes/<VOLUME NAME>/<SUBVOLUME NAME>/.snap/...' fails to mount
Summary: nfs exports of cephfs subvolumes path '/volumes/<VOLUME NAME>/<SUBVOLUME NAME...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Ceph Storage
Classification: Red Hat Storage
Component: Cephadm
Version: 6.4
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 7.1
Assignee: Adam King
QA Contact: Manisha Saini
Akash Raj
URL:
Whiteboard:
Depends On:
Blocks: 2231151 2295943
TreeView+ depends on / blocked
 
Reported: 2023-10-20 11:22 UTC by Rakshith
Modified: 2024-07-05 10:55 UTC (History)
14 users (show)

Fixed In Version: ceph-18.2.1-163.el8cp
Doc Type: Enhancement
Doc Text:
.Users can now mount snapshots (exports within .snap directory) With this enhancement, users can mount snapshots (exports within `.snap` directory) to look at in a RO mode. NFS exports created with the NFS MGR module now include the `cmount_path` setting (this cannot be configured and should be left as "/") which allows snapshots to be mounted.
Clone Of:
Environment:
Last Closed: 2024-06-13 14:22:27 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github ceph ceph pull 53925 0 None open mgr/nfs: add cmount_path 2024-05-10 09:35:06 UTC
Github ceph ceph pull 54277#discussion_r1486913195 0 None open mgr/nfs: generate user_id & access_key for apply_export(CEPHFS) 2024-05-10 09:35:04 UTC
Red Hat Issue Tracker RHCEPH-7754 0 None None None 2023-10-20 11:23:56 UTC
Red Hat Issue Tracker RHSTOR-4851 0 None None None 2023-10-20 11:22:55 UTC
Red Hat Product Errata RHSA-2024:3925 0 None None None 2024-06-13 14:22:36 UTC

Description Rakshith 2023-10-20 11:22:56 UTC
Description of problem:

Epic: https://issues.redhat.com/browse/RHSTOR-4851
`nfs: add support for shallow volumes - Dev Preview`
The above epic aims to add support for shallow volumes -> 
snaphots mounted as readonly volumes for cephfs subvolumes exported over NFS.

Design for CephFS shallow volume: https://github.com/ceph/ceph-csi/blob/devel/docs/design/proposals/cephfs-snapshot-shallow-ro-vol.md#snapshots-as-shallow-read-only-volumes

We need to be able to mount nfs exports of cephfs subvolumes with the path `/volumes/<VOLUME NAME>/<SUBVOLUME NAME>/.snap/...` to access snapshot contents.

However, `/.snap` does not show up in a mounted subvolume nfs export.
(it can be accessed when root '/' is exported and mounted).

https://docs.ceph.com/en/quincy/mgr/nfs/#create-cephfs-export

The main goal is to facilitate backup softwares by replacing expensive full clones with shallow volumes(snapshot as readonly volume).

How reproducible:
Everytime

Steps to Reproduce:

1. Export a snapshot with path  `/volumes/<VOLUME NAME>/<SUBVOLUME NAME>/.snap/...`
[root@m1 /]# ceph nfs export create cephfs my-nfs /snap myfs /volumes/csi/csi-vol-5a989f69-a58a-4a7f-b803-a91c596559d8/.snap/csi-snap-ca8efd01-a71f-4c6d-978f-4a8cc28 --readonly
bbedc/fa15a4bc-2177-4c14-b449-253152c1c20e
{
    "bind": "/snap",
    "fs": "myfs",
    "path": "/volumes/csi/csi-vol-5a989f69-a58a-4a7f-b803-a91c596559d8/.snap/csi-snap-ca8efd01-a71f-4c6d-978f-4a8cc28bbedc/fa15a4bc-2177-4c14-b449-253152c1c20e",
    "cluster": "my-nfs",
    "mode": "RO"
}

2. try to mount the export
[root@m1 /]# mkdir /snap
[root@m1 /]# mount -t nfs4 -o snap=tcp rook-ceph-nfs-my-nfs-a:/snap /snap
mount.nfs4: mounting rook-ceph-nfs-my-nfs-a:/snap failed, reason given by server: No such file or directory

Actual results:
The mount fails.

Expected results:
The mount should success and data within the snapshot should be accessible.

Additional info:

- https://issues.redhat.com/browse/RHSTOR-4851
- https://github.com/ceph/ceph-csi/blob/devel/docs/design/proposals/cephfs-snapshot-shallow-ro-vol.md#snapshots-as-shallow-read-only-volumes
- https://github.com/ceph/ceph-csi/issues/3997

Comment 1 RHEL Program Management 2023-10-20 11:23:08 UTC
Please specify the severity of this bug. Severity is defined here:
https://bugzilla.redhat.com/page.cgi?id=fields.html#bug_severity.

Comment 5 Niels de Vos 2023-11-01 12:42:32 UTC
There are currently two approaches that could be done to get the wanted result:

a. Ceph-CSI uses the same flow for NFS as it does for CephFS (mount the volume, bind-mount the .snap/... into the publish path). It needs to introduce NodeStageVolume//NodeUnStageVolume for NFS, as that is not used at the moment yet.

b. NFS-Ganesha internally uses the volume root with libcephfs, but only exports access to a .snap/... directory.


Franks, is option (b) maybe achievable with NFS-Ganesha already? Like setting Export.Path in combination with FSAL.Ceph.

Comment 6 Frank Filz 2023-11-01 22:57:29 UTC
Option B maybe could work with the new cmount_path option. Set Path in the EXPORT {} to the full location. Set cmount_path in EXPORT { FSAL {} } to everything but .snap or even just to "/".

Comment 10 Niels de Vos 2023-11-09 11:21:47 UTC
I think the upstream PR for Ceph is at https://github.com/ceph/ceph/pull/53925

Comment 30 Adam King 2024-06-05 15:29:09 UTC
(In reply to Akash Raj from comment #29)
> Hi Adam.
> 
> Please provide the doc text. This is being requested to be added in the 7.1
> release notes.
> 
> Thanks.

added doc text

Comment 31 errata-xmlrpc 2024-06-13 14:22:27 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


Note You need to log in before you can comment on or make changes to this bug.