-
Notifications
You must be signed in to change notification settings - Fork 48
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
control/state: add name to rados.Rados object initialization #166
Conversation
NOTE: This is where the name is defaulted to client.admin in python librados if it is not provided. https://github.com/ceph/ceph/blob/main/src/pybind/rados/rados.pyx#L425-L426 |
Thank you for bringing this up. I am not sure though that "name" param from "gateway" section is a good choice for this. It is supposed to have different names for gateways in the same group (if "name" param is empty in the config then the hostname is used), and with your approach it would add a restriction to create a separate ceph user for every gateway. This may be not a big problem but I am not sure we want this restriction. Moreover the gateway name should be "client.XYZ" (this could be solved though by using Instead of re-using the gateway name param I would prefer if we added "name" (or "id") param into "ceph" section and use it. Additionally it would be good to add "mon_host" and "keyring" (or "keyfile") params (which could be passed in "conf" arg when initializing the rados object). Then it would be possible to have setups without ceph.conf file, keeping all ceph related settings for the gateway clients in the ceph mon db. |
sure, if I want it to be something in the "ceph" section do I need to do anything special, or just change this to try and check the config for a "name" option in the "ceph" section (and probably have a default if it isn't specified) |
Yes, I would be fine with just changing Though other people might have different thoughts... |
would the idea with |
It is already done by the Rados python class, see the code you referred previously and how |
ah, I missed this. Alright, I think I understand what you mean now. I'll make the adjustments. |
39d4708
to
62b414d
Compare
now using rados_id over name |
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.
LGTM
If we want to use a keyring that isn't the client.admin keyring, we need to provide the name or rados id. The rados.Rados object defaults the name to client.admin, and if that doesn't match the provided keyring you end up hitting an error like ERROR:control.state:Unable to create omap: [errno 13] RADOS permission denied (error connecting to the cluster). Exiting! INFO:control.server:Terminating SPDK... INFO:control.server:Exiting the gateway process. Traceback (most recent call last): File "/usr/lib64/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib64/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/src/control/__main__.py", line 35, in <module> gateway.serve() File "/src/control/server.py", line 99, in serve omap_state = OmapGatewayState(self.config) File "/src/control/state.py", line 178, in __init__ conn.connect() File "rados.pyx", line 680, in rados.Rados.connect rados.PermissionDeniedError: [errno 13] RADOS permission denied (error connecting to the cluster) Setting the correct name gets around this and allows other keyrings with the correct name and permissions to be used Signed-off-by: Adam King <[email protected]>
62b414d
to
03ff595
Compare
The current nvmeof image we have only works with admin keyring. This is a placeholder commit that points to an image with changes that should allow the nvmeof daemon to use the keyring we generate for it. This should be removed once a proper nvmeof image is made with the necessary changes from ceph/ceph-nvmeof#166
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.
Thank you Adam 👍 LGTM
The current nvmeof image we have only works with admin keyring. This is a placeholder commit that points to an image with changes that should allow the nvmeof daemon to use the keyring we generate for it. This should be removed once a proper nvmeof image is made with the necessary changes from ceph/ceph-nvmeof#166
If we want to use a keyring that isn't the client.admin keyring, we need to provide the name. The rados.Rados object defaults the name to client.admin, and if that doesn't match the provided keyring you end up hitting an error like
Setting the correct name gets around this and allows other keyrings with the correct name and permissions to be used