Repository navigation
mgr/smb: add RGW-backed SMB share support - #69103
Conversation
fef009f to
8f305ba
Compare
|
jenkins test make check |
|
jenkins test make check arm64 |
phlogistonjohn
left a comment
There was a problem hiding this comment.
Generally, this looks like a fantastic start. I have shared a few initial thoughts. Most important to me right now is type decoupling via protocol types (see inline).
I'll share more thoughts in the future as the PR evolves. Thanks!
d13419b to
308f75e
Compare
|
jenkins test make check |
|
jenkins test make check arm64 |
308f75e to
8bf5a4a
Compare
|
Updated this PR with decoupling via protocol types as mentioned by @phlogistonjohn as a review comment. |
phlogistonjohn
left a comment
There was a problem hiding this comment.
Very nice improvements thanks. I think this is very close to being reviewable (conditional on having the corresponding samba features available :-) ).
I have a couple thoughts about testing:
- I would like to see a few new tests in test_smb.py that tests the new resource type for show/apply & the new cli command (mocked). You don't need to go wild, but some coverage here would be good
- This is a pretty major new feature and I think it demands some level of teuthology test. Depending on the timelines involved I propose two paths: (a) we add new teuthology tests as part of this PR or (b) we skip teuthology in this PR but add coverage for this feature as a new subtask to https://tracker.ceph.com/issues/76672
We can discuss / debate the latter at your convenience.
8bf5a4a to
a2445f2
Compare
a2445f2 to
3d1464e
Compare
41998ef to
0f74024
Compare
|
Just so this is not lost in resolved threads:
Totally fine. It's quite annoying to add a new type still. Don't hesitate to ask q's if you start experimenting in this area and run into issues. |
0f74024 to
0ce7c8f
Compare
|
This PR, few comments not yet resolved since i have not added a code for that , remaining all comment i resolved also added a test cases as well . |
0ce7c8f to
b3c93a4
Compare
|
jenkins test make check |
1 similar comment
|
jenkins test make check |
c9720c8 to
259880e
Compare
016c9d9 to
a2ee8b0
Compare
|
test result o/p for latest code change (Moving ceph_rgw config , keyring and id to global section) Deleted share2 Deleted Share1 and created cephfs share |
phlogistonjohn
left a comment
There was a problem hiding this comment.
Some mostly minor stuff. I plan on doing some local practical tests of these patches later today.
6112608 to
713c714
Compare
|
jenkins test make check arm64 |
- Add RGWStorage component class for RGW bucket storage backend - Include fields: bucket, user_id, access_key_id, secret_access_key - Add password conversion support for credentials - Update Share class to accept optional rgw field and added convert defination - Update Share validation to support both cephfs and rgw backends - Ensure exactly one storage backend (cephfs or rgw) is specified This is the first step in implementing RGW storage support for SMB shares, similar to the existing NFS RGW export functionality. Signed-off-by: Shweta Sodani <[email protected]>
- Add rgw.py module for RGW integration - Implement fetch_rgw_credentials() to get user credentials from radosgw-admin - Implement validate_rgw_bucket() to check bucket existence - Handle bucket owner lookup when user_id not provided - Add proper error handling and logging This provides the foundation for RGW authentication in SMB shares, similar to the NFS RGW export implementation. Signed-off-by: Shweta Sodani <[email protected]>
- Add 'smb share create rgw' CLI command - Import rgw module for credential management - Fetch RGW credentials using radosgw-admin - Create Share resource with RGWStorage backend - Handle errors from credential fetching This enables users to create SMB shares backed by RGW buckets, similar to 'nfs export create rgw' functionality. Example usage: ceph smb share create rgw mysmb share1 mybucket Signed-off-by: Shweta Sodani <[email protected]>
…rror handling - Add _generate_rgw_share() function for RGW share configuration - Skip CephFS authorization for RGW shares in cluster assembly - Configure Samba VFS with RGW-specific parameters: - rgw_bucket, rgw_user_id, rgw_access_key, rgw_secret_key - Validate bucket accessibility using radosgw-admin - Ensure proper error handling in share creation flow This enables the handler to generate proper Samba configuration for RGW-backed shares along with validation and error handling. Signed-off-by: Shweta Sodani <[email protected]>
Add test cases for RGW-backed SMB shares Key changes: - RGWStorage creation, validation, and serialization - Edge cases: None values, mutual exclusion Signed-off-by: Shweta Sodani <[email protected]> Signed-off-by: Avan Thakkar <[email protected]>
Signed-off-by: Shweta Sodani <[email protected]>
|
jenkins test make check arm64 |
Refactored RGW credential management to use dedicated RGWCredential resources instead of embedding credentials directly in Share resources. This will help to reuse the same credential across multiple shares using same user. RGW credentials must not appear in the public RADOS store, which any client with pool caps can read. Instead, write a config:merge stub containing only the credential fields to the private mon config-key store, and pass its URI to the container alongside the primary config URI via extra_config_uris. - Public config: ceph_rgw:access_key / secret_access_key are empty strings - Private stub: stored under smb/config/<cluster_id>/config.smb.rgw, contains only the real credential values via config:merge - extra_config_uris: new Config field carrying supplementary URIs appended to SAMBACC_CONFIG after the primary config_uri Signed-off-by: Avan Thakkar <[email protected]> Signed-off-by: Shweta Sodani <[email protected]>
713c714 to
8916aa8
Compare
|
Teuthology results: |
Replace mon 'allow *' and the osd tag cap with the rgw profile. The profile covers pool creation on first write, which is what the mon cap was there for. auth get-or-create refuses an entity that already exists with different caps, so fall back to auth caps. Anything created before this carries the old caps and would error on the next apply. Signed-off-by: Matthew N. Heler <[email protected]> (cherry picked from commit 853cdfa) Conflicts: src/pybind/mgr/smb/rgw_auth.py the mgr/smb module does not exist in squid; its prerequisite (ceph#69103) has not been merged there. Nothing to apply, so this is an empty commit recording that the upstream change was intentionally not backported.
Replace mon 'allow *' and the osd tag cap with the rgw profile. The profile covers pool creation on first write, which is what the mon cap was there for. auth get-or-create refuses an entity that already exists with different caps, so fall back to auth caps. Anything created before this carries the old caps and would error on the next apply. Signed-off-by: Matthew N. Heler <[email protected]> (cherry picked from commit 853cdfa) Conflicts: src/pybind/mgr/smb/rgw_auth.py does not exist in tentacle; its prerequisite (ceph#69103) has not been merged there. Nothing to apply, so this is an empty commit recording that the upstream change was intentionally not backported.
Replace mon 'allow *' and the osd tag cap with the rgw profile. The profile covers pool creation on first write, which is what the mon cap was there for. auth get-or-create refuses an entity that already exists with different caps, so fall back to auth caps. Anything created before this carries the old caps and would error on the next apply. Signed-off-by: Matthew N. Heler <[email protected]> (cherry picked from commit 853cdfa) Conflicts: src/pybind/mgr/smb/rgw_auth.py does not exist in umbrella; its prerequisite (ceph#69103) has not been merged there. Nothing to apply, so this is an empty commit recording that the upstream change was intentionally not backported.
Replace mon 'allow *' and the osd tag cap with the rgw profile. The profile covers pool creation on first write, which is what the mon cap was there for. auth get-or-create refuses an entity that already exists with different caps, so fall back to auth caps. Anything created before this carries the old caps and would error on the next apply. Signed-off-by: Matthew N. Heler <[email protected]> (cherry picked from commit 853cdfa) Conflicts: src/pybind/mgr/smb/rgw_auth.py the mgr/smb module does not exist in squid; its prerequisite (ceph#69103) has not been merged there. Nothing to apply, so this is an empty commit recording that the upstream change was intentionally not backported.
Add support for creating SMB shares backed by RGW buckets,
allowing S3-compatible object storage to be exported over SMB.
Key changes:
Add share create rgw CLI command for RGW share creation
Implement RGW credential retrieval using radosgw-admin
Add RGWStorage resource class with S3 authentication support
Track rgw_buckets in orchestration alongside CephFS volumes
Create CephX entities conditionally for CephFS shares only
Implementation details:
Register share create rgw before share create for correct CLI routing
Trigger orchestration when either vols or rgw_buckets are present
Use S3 access and secret keys for RGW share authentication
Improve logging with CephFS and RGW share breakdown details
New CLI :
ceph smb share create rgw <cluster_id> <bkt_id> <share_id> [--share-name=<share_name>] [--user-id=<user_id>] [--readonly]
example: ceph smb share create rgw mysmb share2 bkt2 --share-name=s2 user1
Declarative :
Define share
cluster_id: mysmb
share_id: ds1
name: dshare1
rgw:
bucket: bkt1
user_id: user1
Testing:
Created a cluster with a CephFS share, then added an RGW share.
Verified both shares inside the container using net conf list.
Created a cluster with an RGW share first, then added a CephFS share.
Verified both shares successfully.
Verified successful deletion of both CephFS and RGW shares.
Signed-off-by: Shweta Sodani [email protected]
Checklist