-
Notifications
You must be signed in to change notification settings - Fork 555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cephfs: upgrading mount syntax #5090
base: devel
Are you sure you want to change the base?
Conversation
Many thanks @MageekChiu! Could you update the PR description with a reference that explains the changes? It would be useful to know how recent these changes are, and if there could be a problem when users have an older version deployed. It seems the commit message contains a few long lines. Please edit it and keep them under 80 characters. @kotreshhr, maybe you have a reference to the new/changed mount options handy? |
161f986
to
19eeb9a
Compare
The old syntax is almost deprecated,and there are reasons to upgrade it - old syntax is lack of fsid(critical for debugging and observability) - mds_namespace is deprecated, it might be inappropriate to continue using it - kernel will try new syntax first and then the old one, it's a waste Signed-off-by: mageekchiu <[email protected]>
@nixpanic Greate advices, thank you. Cool homepage by the way, need to add one myself 😄. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks!
internal/cephfs/mounter/kernel.go
Outdated
@@ -74,16 +74,13 @@ func (m *kernelMounter) mountKernel( | |||
|
|||
args := []string{ | |||
"-t", "ceph", | |||
fmt.Sprintf("%s:%s", volOptions.Monitors, volOptions.RootPath), | |||
fmt.Sprintf("%s@%s.%s=%s", cr.ID, volOptions.ClusterID, volOptions.FsName, volOptions.RootPath), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MageekChiu, The volOptions.ClusterID
does not represent the actual Ceph cluster ID. Instead, Ceph-CSI uses it as a unique identifier to map the cluster configuration between the clusterID parameter specified in the StorageClass and the clusterID defined in the ceph-csi-config
ConfigMap. This field does not necessarily have to be the cluster FSID required by the mount option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! internal/util.GetMonsAndClusterID()
should be used for obtaining the real cluster-id.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nixpanic 🤔, even that just returns the clusterID from the csi configFile. The right method is internal/util.GetFSID()
ceph-csi/internal/util/connection.go
Lines 118 to 124 in 4e02fae
func (cc *ClusterConnection) GetFSID() (string, error) { | |
if cc.conn == nil { | |
return "", errors.New("cluster is not connected yet") | |
} | |
return cc.conn.GetFSID() | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iPraveenParihar @nixpanic thanks for your opinions, very helpful.
Ceph support multiple fs nowadays, but I don't see any parameter indicates our csi supports that.
So we only support getting fsid like bellow?
conn := &util.ClusterConnection{}
err = conn.Connect(monitors, cr)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to connect to MONs %q: %s", monitors, err)
}
defer conn.Destroy()
fsID, err := conn.GetFSID()
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to get cephfs id: %s", err)
}
By the way, the fsid of the default and only one fs is indeed the clusterID itself.
If we don't intend to support multiple fs, then internal/util.GetMonsAndClusterID()
should be enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nixpanic 🤔, even that just returns the clusterID from the csi configFile.
Isn't that the ceph-csi-config
ConfigMap?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ceph support multiple fs nowadays, but I don't see any parameter indicates our csi supports that.
My mistake, the fsName in storageclass does that, I'll do the refactoring.
And for clarity, FsID is UUID for a ceph cluster rather than an id for a CephFS instance(file system)
Pull request has been modified.
Getting FsID instead of ClusterID as parameter Signed-off-by: mageekchiu <[email protected]>
I see the old and new mount options are already linked in the PR. Yes, the kernel tries the new syntax first and falls back to old if not available. I think this should be fine but tagging the kernel developer @Markuze @vshankar to confirm if this breaks anything based on the version it got introduced. |
@@ -46,6 +46,7 @@ type VolumeOptions struct { | |||
RequestName string | |||
NamePrefix string | |||
ClusterID string | |||
FsID string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of always fetching the FsID
, can you add a func (vo *VolumeOptions) GetFSID() (string, error)
function?
This can then be used where needed, currently only in NewKernelMounter()
.
By extending the NewVolumeOptions()
function, it grows (too) large, and the golang-ci linter fails due to that.
The old syntax is almost deprecated, and there are reasons to upgrade it to the new one
From the ubuntu manpage,20.04 LTS supports the old syntax while 22.04 LTS supports the new one.