Skip to content

squid: mgr/orchestrator: fix nvmeof group parameter for backward compatibility - #67623

Merged
batrick merged 2 commits into
ceph:squidfrom
tchaikov:wip-squid-nvmeof-group-fix
Mar 18, 2026
Merged

batrick merged 2 commits into
ceph:squidfrom
tchaikov:wip-squid-nvmeof-group-fix

Conversation

@tchaikov

@tchaikov tchaikov commented Mar 3, 2026 •

Copy link
Copy Markdown
Contributor

This PR fixes a test failure in the smoke-roleless nvmeof test where
"ceph orch apply nvmeof " fails due to a missing required argument.

Problem

Job 50373 from test run dgalloway-2026-02-13_23:06:25 fails with:

2026-02-17T00:19:46.278 INFO:teuthology.orchestra.run.smithi042:command with stdin: sudo /home/ubuntu/cephtest/cephadm --image quay.ceph.io/ceph-ci/ceph:05b55d192f002ad5df41409624b8d176527d0841 shell -c /etc/ceph/ceph.conf -k /etc/ceph/ceph.client.admin.keyring --fsid d39beff5-0b95-11f1-9f0d-d404e6e7d460 -- bash -c 'ceph orch apply nvmeof foo'
2026-02-17T00:19:46.278 INFO:teuthology.orchestra.run.smithi042:got exit status 22 from command:
Command failed with status 22

The command fails with exit status 22 (EINVAL) due to a missing required
positional argument 'group'.

Test case: qa/suites/orch/cephadm/smoke-roleless/2-services/nvmeof.yaml

Pulpito job link:
https://pulpito.ceph.com/dgalloway-2026-02-13_23:06:25-orch:cephadm-wip-squid-pr-67199-kefu-1-distro-default-trial/50373/

Root Cause

When commit 6bee4e1 ("mgr/orchestrator: allow passing group to
apply/add nvmeof commands") was cherry-picked from main to squid, it added
a group parameter to nvmeof commands but made it required without providing
a default value:

def _apply_nvmeof(self,
                  pool: str,
                  group: str,      # <- Required, no default
                  ...

Additionally, the service_id construction used f'{pool}.{group}' which
would create service IDs with trailing dots (e.g., "foo.") when group is
empty.

On main branch, the follow-up fix (commit e1612d0) addressed the
service_id issue, but was never cherry-picked to squid. Furthermore, on
main the tests were updated to provide the group argument explicitly:

Main test:

- ceph orch apply nvmeof foo default

But squid tests still use the backward-compatible syntax without group:

Squid test:

- ceph orch apply nvmeof foo

Solution

This PR applies two commits:

  1. Cherry-pick e1612d0 from main: Fixes the service_id construction
    logic to properly handle empty groups. This uses git cherry-pick -x to
    preserve the original author attribution.

  2. Add default value for group parameter: Squid-specific change to make
    the group parameter optional (group: str = '') for backward compatibility
    with existing tests and user scripts.

After these changes:

  • ceph orch apply nvmeof foo works (creates service nvmeof.foo)
  • ceph orch apply nvmeof foo mygroup also works (creates service nvmeof.foo.mygroup)

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

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

- make service_id better alligned with default/empty group
  (ceph@f6d552d)
- fix service_id in nvmeof daemon add

Signed-off-by: Alexander Indenbaum <[email protected]>
(cherry picked from commit e1612d0)
@tchaikov

tchaikov commented Mar 4, 2026

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@tchaikov

tchaikov commented Mar 4, 2026

Copy link
Copy Markdown
Contributor Author
CMake Error at /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Python3 (missing: Python3_EXECUTABLE Python3_INCLUDE_DIRS
  Python3_LIBRARIES Interpreter Development Development.Module
  Development.Embed) (Required is exact version "3.10")

      Reason given by package: 
          Interpreter: Wrong version for the interpreter "/bin/python3"

Call Stack (most recent call first):
  /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  cmake/modules/FindPython/Support.cmake:3863 (find_package_handle_standard_args)
  cmake/modules/FindPython3.cmake:545 (include)
  CMakeLists.txt:557 (find_package)


-- Configuring incomplete, errors occurred!

retriggering..

@tchaikov

tchaikov commented Mar 4, 2026

Copy link
Copy Markdown
Contributor Author

jenkins test api

@tchaikov
tchaikov requested a review from adk3798 March 4, 2026 08:56
@tchaikov tchaikov modified the milestones: squid, v19.2.4 Mar 4, 2026
@tchaikov

tchaikov commented Mar 5, 2026

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@tchaikov

tchaikov commented Mar 5, 2026

Copy link
Copy Markdown
Contributor Author

the "ceph API tests" test failure should be addressed by #67199

Add default value for group parameter in nvmeof commands to maintain
backward compatibility with existing squid tests and deployments.

Context:
--------
On main branch, when commit 6bee4e1 added the group parameter, the
tests were subsequently updated to provide the group argument explicitly:

  Main test: ceph orch apply nvmeof foo default
  Expected: nvmeof.foo.default

However, on squid branch, the existing tests still use the older syntax
without specifying a group:

  Squid test: ceph orch apply nvmeof foo
  Expected: nvmeof.foo

The previous cherry-pick (e1612d0) fixed the service_id construction
logic to handle empty groups correctly, but the group parameter was still
required without a default value, causing "ceph orch apply nvmeof foo" to
fail with EINVAL (missing required argument).

This commit adds the missing default value (group: str = '') to make the
parameter optional, maintaining backward compatibility with existing squid
tests and user scripts that don't specify a group.

With both changes:
1. Cherry-picked e1612d0: service_id logic handles empty group
2. This commit: group parameter has default value ''

Result:
  "ceph orch apply nvmeof foo" works (creates nvmeof.foo)
  "ceph orch apply nvmeof foo mygroup" also works (creates nvmeof.foo.mygroup)

Test: qa/suites/orch/cephadm/smoke-roleless/2-services/nvmeof.yaml
Fixes job 50373 failure from test run dgalloway-2026-02-13_23:06:25

Please note, this change was not cherry-picked from main branch, because
main intentionally still requires the CLI group argument for arch
apply/add nvmeof, and its tests were updated accordingly.
On squid, however, the earlier cherry-pick 6bee4e1 introduced the
required group parameter, but squid still has the old test/behavior
(ceph orch apply nvmeof foo expecting nvmeof.foo) and does not contain
the later main commits 3e5e85a and b377085.

Signed-off-by: Kefu Chai <[email protected]>
@tchaikov
tchaikov force-pushed the wip-squid-nvmeof-group-fix branch from 086891d to 5cef25d Compare March 9, 2026 12:24
@batrick
batrick merged commit cc72887 into ceph:squid Mar 18, 2026
7 checks passed
@tchaikov
tchaikov deleted the wip-squid-nvmeof-group-fix branch March 18, 2026 03:08
afreen23 pushed a commit to rhcs-dashboard/ceph that referenced this pull request Jul 29, 2026
* refs/pull/67623/head:
	mgr/orchestrator: make group parameter optional for nvmeof (squid)
	pybind/mgr/orchestrator/module.py: NvmeofServiceSpec service_id

Reviewed-by: Patrick Donnelly <[email protected]>
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.

2 participants