Skip to content

qa/tasks: disable agent at end of the cephadm task - #66613

Merged
rkachach merged 3 commits into
ceph:mainfrom
ljflores:wip-fix-iscsi-test
Sep 23, 2026
Merged

rkachach merged 3 commits into
ceph:mainfrom
ljflores:wip-fix-iscsi-test

Conversation

@ljflores

@ljflores ljflores commented Dec 11, 2025 •

Copy link
Copy Markdown
Member

The cephadm agent is sometimes deployed during orch tests (determined by these yaml files: https://github.com/ceph/ceph/tree/main/qa/suites/orch/cephadm/smoke/agent).

During the test_iscsi_container task, we execute several workunits to test iscsi. Throughout the test, if the agent was deployed, it sends metadata to a cephadm endpoint. At the end of the test, we disable cephadm and shut down the cluster. However, the agent is still deployed and trying to connect to cephadm, which it fails at since cephadm was disabled.

The solution is to disable the agent during teardown via:

ceph config set mgr mgr/cephadm/use_agent false

Once set to false, the agent service will be stopped and the daemons will be removed automatically by cephadm.

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

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.

@ljflores
ljflores requested a review from a team as a code owner December 11, 2025 21:56
@ljflores
ljflores requested review from adk3798 and rkachach December 11, 2025 21:57
@ljflores

Copy link
Copy Markdown
Member Author

jenkins test make check

Comment thread qa/tasks/cephadm.py Resolved
@ljflores

Copy link
Copy Markdown
Member Author

Thanks for the feedback. I'll run some tests on this once the lab migration is complete. I would rather to this than put it into one of Yuri's batches since I'm not 100% confident that this will function how I expect it to.

@ljflores

Copy link
Copy Markdown
Member Author

jenkins test make check

@rkachach rkachach left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@rkachach

rkachach commented Feb 6, 2026

Copy link
Copy Markdown
Contributor

@ljflores did you manage to a have green/good run with this change? if that's the case we can go ahead and merge the PR.

@ljflores

ljflores commented Feb 6, 2026

Copy link
Copy Markdown
Member Author

@ljflores did you manage to a have green/good run with this change? if that's the case we can go ahead and merge the PR.

Oops, I need to return to this. I had scheduled some runs that failed from lab issues. Trying again.

@ljflores

ljflores commented Feb 6, 2026

Copy link
Copy Markdown
Member Author

The test failed because teuthology deletes the client.admin.keyring before the config change command executes in my patch. I will need to rework this. I can see now that the config change needs to occur right at the end of the last task, before anything in the cluster is deleted.

https://pulpito.ceph.com/lflores-2026-02-06_22:21:29-rados:cephadm-main-distro-default-trial/38542

2026-02-06T22:34:50.516 DEBUG:teuthology.run_tasks:Unwinding manager cephadm
2026-02-06T22:34:50.532 INFO:tasks.cephadm:Teardown begin
2026-02-06T22:34:50.533 DEBUG:teuthology.orchestra.run.trial128:> sudo rm -f /etc/ceph/ceph.conf /etc/ceph/ceph.client.admin.keyring
2026-02-06T22:34:50.581 INFO:tasks.cephadm:Tearing down any agents...
2026-02-06T22:34:50.581 DEBUG:teuthology.orchestra.run.trial128:> sudo /home/ubuntu/cephtest/cephadm --image quay.ceph.io/ceph-ci/ceph:0b9fcd80bbdbcc604152c9a96bae005a1e16537a shell -c /etc/ceph/ceph.conf -k /etc/ceph/ceph.client.admin.keyring --fsid b7a248f3-03ab-11f1-bd0f-d404e6e7d460 -- ceph config set mgr mgr/cephadm/use_agent false
2026-02-06T22:34:50.893 INFO:teuthology.orchestra.run.trial128.stderr:Inferring config /var/lib/ceph/b7a248f3-03ab-11f1-bd0f-d404e6e7d460/mon.a/config
2026-02-06T22:34:50.910 INFO:teuthology.orchestra.run.trial128.stderr:Error: statfs /etc/ceph/ceph.client.admin.keyring: no such file or directory
2026-02-06T22:34:50.936 DEBUG:teuthology.orchestra.run:got remote process result: 125

@rkachach

rkachach commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

The test failed because teuthology deletes the client.admin.keyring before the config change command executes in my patch. I will need to rework this. I can see now that the config change needs to occur right at the end of the last task, before anything in the cluster is deleted.

https://pulpito.ceph.com/lflores-2026-02-06_22:21:29-rados:cephadm-main-distro-default-trial/38542

2026-02-06T22:34:50.516 DEBUG:teuthology.run_tasks:Unwinding manager cephadm
2026-02-06T22:34:50.532 INFO:tasks.cephadm:Teardown begin
2026-02-06T22:34:50.533 DEBUG:teuthology.orchestra.run.trial128:> sudo rm -f /etc/ceph/ceph.conf /etc/ceph/ceph.client.admin.keyring
2026-02-06T22:34:50.581 INFO:tasks.cephadm:Tearing down any agents...
2026-02-06T22:34:50.581 DEBUG:teuthology.orchestra.run.trial128:> sudo /home/ubuntu/cephtest/cephadm --image quay.ceph.io/ceph-ci/ceph:0b9fcd80bbdbcc604152c9a96bae005a1e16537a shell -c /etc/ceph/ceph.conf -k /etc/ceph/ceph.client.admin.keyring --fsid b7a248f3-03ab-11f1-bd0f-d404e6e7d460 -- ceph config set mgr mgr/cephadm/use_agent false
2026-02-06T22:34:50.893 INFO:teuthology.orchestra.run.trial128.stderr:Inferring config /var/lib/ceph/b7a248f3-03ab-11f1-bd0f-d404e6e7d460/mon.a/config
2026-02-06T22:34:50.910 INFO:teuthology.orchestra.run.trial128.stderr:Error: statfs /etc/ceph/ceph.client.admin.keyring: no such file or directory
2026-02-06T22:34:50.936 DEBUG:teuthology.orchestra.run:got remote process result: 125

upssss I see, thanks @ljflores for re-testing it.

@github-actions

Copy link
Copy Markdown

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 Apr 10, 2026
@rkachach

Copy link
Copy Markdown
Contributor

Hi @ljflores is this PR still valid?

@github-actions

Copy link
Copy Markdown

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 Jul 20, 2026
@ljflores ljflores removed the stale label Aug 14, 2026
@ljflores

Copy link
Copy Markdown
Member Author

Yes, it's still valid. Forgot about it- will take another look at the fix, as last time I tested it, the fix wasn't working as expected.

@ljflores
ljflores force-pushed the wip-fix-iscsi-test branch 2 times, most recently from 90a135f to 957249b Compare September 18, 2026 19:29
@ljflores ljflores changed the title qa/tasks: disable agent at end of iscsi test qa/tasks: disable agent at end of the cephadm task Sep 18, 2026
The cephadm agent is sometimes deployed during orch tests
(determined by these yaml files: https://github.com/ceph/ceph/tree/main/qa/suites/orch/cephadm/smoke/agent).

During the `test_iscsi_container` task, we execute several workunits
to test iscsi. Throughout the test, if the agent was deployed,
it sends metadata to a cephadm endpoint. At the end of the
test, we disable cephadm and shut down the cluster. However, the agent
is still deployed and trying to connect to cephadm, which it fails at
since cephadm was disabled.

The solution is to disable the agent at the end of the task via:

```
ceph config set mgr mgr/cephadm/use_agent false
```

Once set to false, the agent service will be stopped and the daemons
will be removed automatically by cephadm.

Fixes: https://tracker.ceph.com/issues/68586
Signed-off-by: Laura Flores <[email protected]>
Wait up to 5 minutes for any agents to be
torn down. This should be plenty of time
before the cephadm module is disabled.

Fixes: https://tracker.ceph.com/issues/68586
Assisted-by: IBM-Bob-v2.0.1
Signed-off-by: Laura Flores <[email protected]>
@ljflores

Copy link
Copy Markdown
Member Author

New tests are passing! https://pulpito.ceph.com/lflores-2026-09-18_21:48:34-rados:cephadm-main-distro-default-gibba/

@rkachach mind re-reviewing the new changes?

@ljflores
ljflores requested a review from rkachach September 18, 2026 22:11
Comment thread qa/tasks/cephadm.py Outdated
ctx,
cluster_name,
ctx.ceph[cluster_name].bootstrap_remote,
['ceph', 'orch', 'ps', '--daemon_type', 'agent', '-f', 'json'],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd recommend adding --refresh argument as it forces to refresh the reported status

@rkachach rkachach left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, overall the wait loop logic looks good to me, just a couple of minor comments.

Comment thread qa/tasks/cephadm.py Outdated
Comment on lines +2227 to +2228
try:
daemons = json.loads(r.stdout.getvalue()) if r.stdout else []

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

minor: If the orch ps fails, shouldn't we just break to avoid waiting?

if r.exitstatus:
    log.warning(...)
    return / skip polling

Add `--refresh` to `ceph orch ps` to force
the command to send the most updated status.

Exit from the test early if the command somehow fails.

Fixes: https://tracker.ceph.com/issues/68586
Signed-off-by: Laura Flores <[email protected]>
@ljflores

ljflores commented Sep 22, 2026 •

Copy link
Copy Markdown
Member Author

@rkachach

rkachach commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Thanks @ljflores for addressing my comments. The changes LGTM.

@rkachach
rkachach merged commit a8b8780 into ceph:main Sep 23, 2026
14 of 15 checks passed
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.

4 participants