Skip to content

mgr/cephadm: Add "default_listeners" to nvmeof spec#64210

Closed
VallariAg wants to merge 1 commit intoceph:mainfrom
VallariAg:wip-nvmeof-default-listeners
Closed

mgr/cephadm: Add "default_listeners" to nvmeof spec#64210
VallariAg wants to merge 1 commit intoceph:mainfrom
VallariAg:wip-nvmeof-default-listeners

Conversation

@VallariAg
Copy link
Member

@VallariAg VallariAg commented Jun 26, 2025

If the cephadm spec "default_listeners: x.x.x.:4420" is present, look for IP address on each host which matches x.x.x. subnet.
And add "default_listeners: x.x.x.y:4420" to
ceph-nvmeof conf. This would be used to auto-create listeners when creating NVMeoF subsystems.

Related PR: ceph/ceph-nvmeof#1381

Fixes: https://tracker.ceph.com/issues/71860

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 x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

@github-actions
Copy link

github-actions bot commented Jul 9, 2025

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@VallariAg VallariAg force-pushed the wip-nvmeof-default-listeners branch from 60839a7 to d0fbc5d Compare August 25, 2025 04:53
@VallariAg VallariAg force-pushed the wip-nvmeof-default-listeners branch from d0fbc5d to de6573f Compare August 26, 2025 12:33
If the cephadm spec "default_listeners: 1.1.1.*"
is present, look for IP address on each host which
matches x.x.x.* subnet.
And add "default_listeners: 1.1.1.2:4420" to
ceph-nvmeof conf. This would be used to auto-create
listeners when creating NVMeoF subsystems.

Fixes: https://tracker.ceph.com/issues/71860

Signed-off-by: Vallari Agrawal <vallari.agrawal@ibm.com>
@VallariAg VallariAg force-pushed the wip-nvmeof-default-listeners branch from de6573f to 90ba2f0 Compare September 10, 2025 06:01
if default_listeners:
listeners_ip = ""
for listeners_format in default_listeners.split(','):
hosts = [h.hostname for h in spec.placement.hosts]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we okay with this limiting the feature to only when using direct host lists for placements? For example if I was using labels this wouldn't work. Actually I think you might end up getting a 'NoneType' object is not iterable error if someone tried which we should do something about.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need to support it with labels or with any other form of deployment.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, in that case I'd recommend trying to look at things like how we get the set of peers for keepalived configs. That has the same issue where it needs to know where all the daemons are in order to write the config properly.

Copy link
Member Author

@VallariAg VallariAg Sep 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adk3798 when I test placement with labels, it seems to work. I deployed the service with this command: ceph orch apply nvmeof mypool mygroup1 --placement 'cephnvme-vm14=nvmeof.a;cephnvme-vm13=nvmeof.b;cephnvme-vm12=nvmeof.c;cephnvme-vm11=nvmeof.d'

And exported spec looks like this (I've masked IPs in this output):

service_type: nvmeof
service_id: mypool.mygroup1
service_name: nvmeof.mypool.mygroup1
placement:
  hosts:
  - cephnvme-vm14=nvmeof.a
  - cephnvme-vm13=nvmeof.b
  - cephnvme-vm12=nvmeof.c
  - cephnvme-vm11=nvmeof.d
spec:
  default_listeners: "x.x.x.*"
...

And the hostnames and IPs are working well too.

[11-Sep-2025 10:59:55] INFO config.py:72 (2): default_listeners = cephnvme-vm14=x.x.x.x;cephnvme-vm13=x.x.x.y;cephnvme-vm12=x.x.x.z;cephnvme-vm11=x.x.x.k;

Then I also tested by removing the service again and deploying directly by above spec and that seemed to work well. Is there any other way of deployment that I'm missing?

I'd recommend trying to look at things like how we get the set of peers for keepalived configs.

Please also share details about that, it would be very helpful! Thank you!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That kind of surprises me, but if it works, it works. Would you mind adding something to this PR to include a teuthology test that includes setting those fields (or an update to https://github.com/ceph/ceph/blob/main/qa/suites/orch/cephadm/smoke-roleless/2-services/nvmeof.yaml, which is quite simplistic at the moment) just so we can make sure that's getting tested?

Comment on lines +149 to +150
if ip_network(n_subnet).version != 4:
continue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is no IPv6 a restriction on the nvmeof side?

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions bot added the stale label Nov 15, 2025
@github-actions
Copy link

This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution!

@github-actions github-actions bot closed this Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants