Repository navigation
mgr: add a new smb cluster & share module - #56350
Conversation
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
9e215a8 to
3d7de1b
Compare
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
3d7de1b to
75e6c4c
Compare
d9c1dc4 to
62ef110
Compare
2959497 to
aa2f86e
Compare
|
Lots of red, but nearly all of those are 'x in cluster log' type stuff and some timeouts. I don't see any smb related regressions and the new tests pass. No news is good news. |
e04a211 to
defa46b
Compare
|
Update: I found that the implementation regarding user-and-groups definitions was incomplete and needed changes to cephadm too. Now, the PR isn't purely adding just the smb module. JFYI |
adk3798
left a comment
There was a problem hiding this comment.
High level review without much SMB knowledge. Also, only reviewed up to the pybind/mgr/smb: extend module.py with real smb mgmt methods commit, with the exception of the docs commit, as the rest seemed to all be unit tests or temporary xxx commits. Generally it seems good, although it can be a bit confusing trying to understand some of what's happening in resourcelib, probably because it's primarily doing type handling and is therefore very abstract (I think you may have also mentioned that would be one of the more complicated pieces to review before).
There was a problem hiding this comment.
Is this allowing users to specify where in the config-key store the user credentials would be stored? I assume we'd want to at least limit that to some mgr/smb/... path to be in line with how other modules use the config-key store
There was a problem hiding this comment.
The non-AD deployment mode has a ceph administrator defining users and groups. These are roughly the same as the ceph.smb.usersgroups resource. When we need to deliver this config to the actual smb containers we will store the generated JSON in the priv store and then the URI values for each one will be added to the user_sources list. I suppose it ought to be called user_group_sources but I guess I was being lazy. Do you think I ought to change it?
There was a problem hiding this comment.
no, I don't think the naming was the problem for me here. I think we talked about this offline and you said this was mostly going to be filled in by the SMB module to tell the orchestrator where it stored these credentials so that can be passed on to the SMB daemons. When I first read this I thought the expectation was for users to go and place some auth info at some arbitrary path in the config-key store or some rados object and then just pass that to the orchestrator themselves. But that doesn't seem to be the intended workflow.
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
defa46b to
81ba269
Compare
Signed-off-by: John Mulligan <[email protected]>
Signed-off-by: John Mulligan <[email protected]>
Signed-off-by: John Mulligan <[email protected]>
Signed-off-by: John Mulligan <[email protected]>
Signed-off-by: John Mulligan <[email protected]>
Signed-off-by: John Mulligan <[email protected]>
Signed-off-by: John Mulligan <[email protected]>
Provide tox envs that check or reformat code with black and isort, currently applied to only the new smb module. This is similar to what we recently did for enabling tox in the cephadmlib dir as it only applies to new code. However, other modules that want to opt-in to automated, python-community-wide typical, stop-thinking-and-let-tools-do-it approach to code formatting can be added to the new envs later on. Signed-off-by: John Mulligan <[email protected]>
The only distro ceph squid+ is building for at the moment that does not already have a python version that includes dataclasses is centos/rhel 8. Add a dependency for the backport package on rhel8. Signed-off-by: John Mulligan <[email protected]>
Add initial documentation for the new smb mgr module. It doesn't cover every possible thing or expected future changes but it should cover the basics of interacting with the module from the cli. Signed-off-by: John Mulligan <[email protected]>
Add a wait_for_service_not_present task function that will wait until a given service name is not present in the list of running cephadm services. This is intended for testing service cleanup operations. Signed-off-by: John Mulligan <[email protected]>
Signed-off-by: John Mulligan <[email protected]>
Signed-off-by: John Mulligan <[email protected]>
Signed-off-by: John Mulligan <[email protected]>
Signed-off-by: John Mulligan <[email protected]>
e844d87 to
5434e88
Compare
|
I was able to get a clean run of the smb teuthology tests under orch (and only those): Next step is to do a small regression run of orch/cephadm and if that goes well I think I'll move this PR out of draft. |
|
Some failures and 3 dead jobs. Most failures are 'cluster log' scrape things. I don't think any of these are related to the patches, but feedback welcome (esp. @adk3798 ) in case I overlooked something. |
|
jenkins test make check |
|
jenkins test api |
run looks okay. I recognize all the types of failures from other recent runs |
|
jenkins test make check |
|
jenkins test make check |
Depends on #55068Depends on #56274This PR adds the core of a new
smbmanager module. The module is inspired by thenfsmodule as well as prior work in cephadm, samba, the samba-operator for kubernetes and others. It builds upon and currently requires cephadm to orchestrate smb services using samba containers.This preliminary version is missing a few obvious features but the fundamentals are largely there. You can create and remove "clusters" (currently only single smbd instances) like nfs. You can create and remove "shares" like the nfs module's "exports". AD-compatibility is already present in this version, albeit without a lot of configuration options - so it may not suite all domains exactly yet.
CLI Interface
There are two ways interacting with the smb module using the
cephCLIcommand. The traditional mode uses commands like:
and
The alternative is to use the
ceph smb applycommand to ingest configurationresources that use a declarative style. This is inspired by the
ceph orchworkflow and
ceph nfs export apply. Example:To remove resources using the apply command, set the intent value to 'removed'.
Declarative mode
There are four resource types:
ceph.smb.clusterceph.smb.shareceph.smb.join.authceph.smb.usersgroupsThe
ceph.smb.clusterresource type defines properties that impact an entirecluster, even if that's a cluster of one node. This includes what domain the
cluster might belong to.
The
ceph.smb.shareresource type defines properites of a single SMB share. Ashare is always part of one cluster. A share's id is a short unique string. A
share's name is the string that is shared with clients. If a share name is not
explicitly defined the share's name is the same as the share's id. Shares
expose part of a cephfs file system. A share must always spcecify what cephfs
volume and path to use. Optionally, the share can refer to a subvolume (and/or
subvolumegroup) by name instead of figuring out that path first. A example YAML
block looks a bit something like this:
As a shortcut, in both the YAML and on the command lines a subvolume
ybelonging to a subvolumegroup
xcan be specified asx/yusing thesubvolume:field or--subvolume=cli option.The
ceph.smb.join.authresource type contains user information needed tojoin an Active Directory domain. This information can be specified inside the
cluster resource or as a
ceph.smb.join.authto seperate the two items.The values provided to the join auth must be a
usernameandpasswordfora user with sufficient rights to join a system to an AD domain.
It is recommended to create a user on the domain with the minimal rights needed
for this purpose alone.
The
ceph.smb.usersgroupsresource defines users and groups that wil beset up within the cluster when using a standalone (not joined to AD) cluster.
This information can be kept separate from the cluster for easier modification
and sharing the same users with multiple clusters.
Resources can be viewed with
ceph smb show. The show subcommand can beprovided with resource type as in
ceph smb show ceph.smb.shareor resourcetype plus id strings in the form
<resource_type>.<id1>[.<id2>].NOTES
is defined. The short version is that the cluster needs extra information
about the volume and we don't know what volume to use until we have at least
one share. If this proves to be too confusing or a big issue we can probably
figure out a workaround if needed.
Critical TODOs prior to leaving 'draft':
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windowsjenkins test rook e2e