Re: Path to a cephfs subvolume

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

Thanks Ramana for your insightful answer, that's very helpful!

The last thing I'd like to ask just out of curiosity -- since there's at
most only one <UUID> dir in /volumes/<subvol group>/<subvol>, do you know
any details as to why is it a UUID instead of some stable dir name?

The reason I ask is I'd like to construct (programatically) an absolute
path to a subvolume snapshot, which would be as follows:
* /volumes/<subvol group>/<subvol>/.snap/<snap>/<UUID>, or the "old way"
that implies the subvolume still exists
* /volumes/<subvol group>/<subvol>/<UUID>/.snap/_<snap>_<snap inode number>

In both cases this would require directory traversal to find out what this
UUID is.

Cheers,
Robert

st 23. 3. 2022 o 4:03 Ramana Venkatesh Raja <rraja@xxxxxxxxxx> napísal(a):

> On Tue, Mar 22, 2022 at 11:24 AM Robert Vasek <rvasek01@xxxxxxxxx> wrote:
> >
> > Hello,
> >
> > I have a question about cephfs subvolume paths. The path to a subvol
> seems
> > to be in the format of <subvol group>/<subvol>/<some UUID>, e.g.:
> >
> >
> /volumes/csi/csi-vol-59c3cb5a-a9ee-11ec-b412-0242ac110004/b2b5a0b3-e02b-4f93-a3f5-fdcef80ebbea
> >
> > I'm wondering about the <some UUID> segment. Where is it coming from, why
> > is there this indirection?
>
> It is the directory within the subvolume where the user's subvolume
> data is stored. When you fetch the mount path of the subvolume using
> `ceph fs subvolume getpath` command, you get the absolute path of the
> directory of the form, /volumes/<subvol gp name>/<subvol name>/<uuid>/
> The indirection was introduced to allow storing subvolume's internal
> metadata within /volumes/<subvol gp name>/<subvol name>/, and to
> support features such as removing a subvolume while retaining its
> snapshots.  For more details you can see,
>
>
> https://github.com/ceph/ceph/blob/v16.2.7/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v1.py#L33
>
> https://github.com/ceph/ceph/blob/v16.2.7/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v2.py#L22
>
> The UUID component of a subvolume's mount path is generated here,
>
> https://github.com/ceph/ceph/blob/v16.2.7/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v2.py#L168
>
> > I suppose this means there can be multiple of
> > these UUIDs?
>
> No. There is only one such UUID directory that stores the user's
> subvolume data during the lifecycle of the subvolume.
>
> > Nowhere in "ceph fs subvolume{,group}" can I find anything to
> > list them (without actually traversing <subvol group>/<subvol>/*)
> however.
> > Or can you give me hints where to look for this in the code?
>
> `ceph fs subvolume ls` is used to list the subvolume names within a
> subvolume group, and `ceph fs subvolume getpath` or `ceph fs subvolume
> info`  is used to fetch the mount path of a subvolume. There is no
> single command to list the mount paths of all the subvolumes within a
> subvolume group . Looking at
>
> https://github.com/ceph/ceph/blob/v16.2.7/src/pybind/mgr/volumes/fs/volume.py#L368
> and
> https://github.com/ceph/ceph/blob/v16.2.7/src/pybind/mgr/volumes/fs/volume.py#L329
> should provide clues on how it can be implemented.
>
> >
> > Thank you!
> >
> > Cheers,
> > Robert
> > _______________________________________________
> > ceph-users mailing list -- ceph-users@xxxxxxx
> > To unsubscribe send an email to ceph-users-leave@xxxxxxx
> >
>
> Regards,
> Ramana
>
>
_______________________________________________
ceph-users mailing list -- ceph-users@xxxxxxx
To unsubscribe send an email to ceph-users-leave@xxxxxxx




[Index of Archives]     [Information on CEPH]     [Linux Filesystem Development]     [Ceph Development]     [Ceph Large]     [Ceph Dev]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [xfs]


  Powered by Linux