Skip to content

mgr/cephadm: Control cephadm files logging based on a mgr flag - #68859

Merged
rkachach merged 2 commits into
ceph:mainfrom
ashjosh1git:ceph-tracker-74872-cephadm-debug-log
Jun 12, 2026
Merged

rkachach merged 2 commits into
ceph:mainfrom
ashjosh1git:ceph-tracker-74872-cephadm-debug-log

Conversation

@ashjosh1git

@ashjosh1git ashjosh1git commented May 12, 2026 •

Copy link
Copy Markdown
Contributor

Supersedes/continues #67300 after branch rename.

User wants to disable the host check-hosts, or gather-facts logs that is being captured every minute in the cephadm.log file. The existing mgr flag mgr/cephadm/log_to_cluster_level does not control the logging by cephadm binary. This patch adds a new mgr flag cephadm_binary_logging_level to control the logging in cephadm.log. The default behaviour would have 'debug' level set, and the repetative messages can be turned off by setting mgr/cephadm/cephadm_binary_logging_level to 'info'. The cephadm_binary_logging_level logging level applies to all cephadm binary invocations by mgr.

Fixes: https://tracker.ceph.com/issues/74872
Signed-off-by: Ashwin M. Joshi [email protected]

  1. The per minute gather-facts repetitive logs continue to appear with default ‘debug’ setting of the flag, and error or warning levels if set.
[ceph: root@ceph-node-0 /]# ceph config get mgr mgr/cephadm/cephadm_binary_logging_level
debug
[ceph: root@ceph-node-0 /]#

2026-02-11 07:14:54,680 7fd4e73d3740 DEBUG --------------------------------------------------------------------------------
cephadm ['--logging-level', 'debug', '--timeout', '895', 'gather-facts']
2026-02-11 07:15:59,977 7fb582bd8740 DEBUG --------------------------------------------------------------------------------
cephadm ['--logging-level', 'debug', '--timeout', '895', 'gather-facts']
  1. The above logs stop with the ‘info’ setting for cephadm_binary_logging_level
[ceph: root@ceph-node-0 /]# ceph config set mgr mgr/cephadm/cephadm_binary_logging_level info
[ceph: root@ceph-node-0 /]# ceph config get mgr mgr/cephadm/cephadm_binary_logging_level
info
[ceph: root@ceph-node-0 /]# 
  1. Command line invocation work as expected with all new logging levels:
[root@ceph-node-0 ~]# cephadm --logging-level info check-host
podman (/usr/bin/podman) version 4.9.4 is present
systemctl is present
lvcreate is present
Unit chronyd.service is enabled and running
Host looks OK
[root@ceph-node-0 ~]# cephadm --logging-level debug check-host
podman (/usr/bin/podman) version 4.9.4 is present
systemctl is present
lvcreate is present
Unit chronyd.service is enabled and running
Host looks OK
[root@ceph-node-0 ~]# cephadm --logging-level warning check-host
podman (/usr/bin/podman) version 4.9.4 is present
systemctl is present
lvcreate is present
Unit chronyd.service is enabled and running
Host looks OK
[root@ceph-node-0 ~]# cephadm --logging-level error check-host
podman (/usr/bin/podman) version 4.9.4 is present
systemctl is present
lvcreate is present
Unit chronyd.service is enabled and running
Host looks OK
[root@ceph-node-0 ~]# 

  1. Other commands work as expected with default debug level
[root@ceph-node-0 ~]# cephadm ceph-volume inventory
Inferring fsid 750dc53a-0b3e-11f1-a55c-525400515ad4

Device Path               Size         Device nodes    rotates available Model name
/dev/sr0                  2.26 MB      sr0             True    False     QEMU DVD-ROM
/dev/vda                  100.00 GB    vda             True    False     
/dev/vdb                  10.00 GB     vdb             True    False     
/dev/zram0                5.77 GB      zram0           False   False     
[root@ceph-node-0 ~]#

And with higher logging levels

[root@ceph-node-0 ~]# cephadm  --logging-level error ceph-volume inventory 
Inferring fsid 750dc53a-0b3e-11f1-a55c-525400515ad4

Device Path               Size         Device nodes    rotates available Model name
/dev/sr0                  2.26 MB      sr0             True    False     QEMU DVD-ROM
/dev/vda                  100.00 GB    vda             True    False     
/dev/vdb                  10.00 GB     vdb             True    False     
/dev/zram0                5.77 GB      zram0           False   False     
[root@ceph-node-0 ~]#

Syslog tests:

[ceph: root@ceph-node-0 /]# ceph config get mgr mgr/cephadm/cephadm_binary_logging_level     
info
[ceph: root@ceph-node-0 /]# ceph config get mgr mgr/cephadm/cephadm_log_destination
syslog

[ceph: root@ceph-node-0 /]# ceph cephadm check-host ceph-node-0
ceph-node-0 (None) ok
podman (/usr/bin/podman) version 4.9.4 is present
systemctl is present
lvcreate is present
Unit chronyd.service is enabled and running
Hostname "ceph-node-0" matches what is expected.
Host looks OK

shows no debug logs in journalctl -t cephadm -f

Jun 08 09:56:42 ceph-node-0 cephadm[36949]: 2026-06-08 09:56:42,166 7f534375d740 INFO lvcreate is present
Jun 08 09:56:42 ceph-node-0 cephadm[36949]: 2026-06-08 09:56:42,291 7f534375d740 INFO Unit chronyd.service is enabled and running
Jun 08 09:56:42 ceph-node-0 cephadm[36949]: 2026-06-08 09:56:42,292 7f534375d740 INFO Hostname "ceph-node-0" matches what is expected.
Jun 08 09:56:42 ceph-node-0 cephadm[36949]: 2026-06-08 09:56:42,292 7f534375d740 INFO Host looks OK

Whereas

[ceph: root@ceph-node-0 /]# ceph config set mgr mgr/cephadm/cephadm_binary_logging_level debug

shows the following with debug logs as expected:

Jun 08 09:57:11 ceph-node-0 cephadm[37060]: 2026-06-08 09:57:11,295 7fb168570740 DEBUG --------------------------------------------------------------------------------
                                            cephadm ['--logging-level', 'debug', '--timeout', '895', '--log-dest=syslog', 'check-host', '--expect-hostname', 'ceph-node-0']
Jun 08 09:57:11 ceph-node-0 cephadm[37060]: 2026-06-08 09:57:11,401 7fb168570740 INFO podman (/usr/bin/podman) version 4.9.4 is present
Jun 08 09:57:11 ceph-node-0 cephadm[37060]: 2026-06-08 09:57:11,402 7fb168570740 INFO systemctl is present
Jun 08 09:57:11 ceph-node-0 cephadm[37060]: 2026-06-08 09:57:11,403 7fb168570740 INFO lvcreate is present
Jun 08 09:57:11 ceph-node-0 cephadm[37060]: 2026-06-08 09:57:11,524 7fb168570740 INFO Unit chronyd.service is enabled and running
Jun 08 09:57:11 ceph-node-0 cephadm[37060]: 2026-06-08 09:57:11,524 7fb168570740 INFO Hostname "ceph-node-0" matches what is expected.
Jun 08 09:57:11 ceph-node-0 cephadm[37060]: 2026-06-08 09:57:11,525 7fb168570740 INFO Host looks OK

Note that ceph config get mgr mgr/cephadm/cephadm_binary_logging_level as "info" only applies when the mgr runs cephadm over SSH (internal orchestration), not when cephadm is run directly on the host.

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.

@ashjosh1git

Copy link
Copy Markdown
Contributor Author

This PR takes #67300 further.

@ashjosh1git
ashjosh1git force-pushed the ceph-tracker-74872-cephadm-debug-log branch from 25ca6c5 to 8cd3f23 Compare June 8, 2026 08:21
@ashjosh1git ashjosh1git changed the title Ceph tracker 74872 cephadm debug log mgr/cephadm: Control cephadm files logging based on a mgr flag Jun 8, 2026
@ashjosh1git
ashjosh1git marked this pull request as ready for review June 8, 2026 09:09
@ashjosh1git
ashjosh1git requested a review from a team as a code owner June 8, 2026 09:09
@ashjosh1git
ashjosh1git force-pushed the ceph-tracker-74872-cephadm-debug-log branch 2 times, most recently from 3354325 to 801c940 Compare June 8, 2026 11:27
@ashjosh1git

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@adk3798 adk3798 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.

Generally looks okay. Left one comment asking a question about a certain debug level log statement. You might also want to squash the two commits as the second modifies a bunch of stuff added in the first.

Comment thread src/cephadm/cephadmlib/logging.py Resolved

@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, just a minor comment

Comment thread src/cephadm/cephadmlib/logging.py Resolved
@ashjosh1git
ashjosh1git force-pushed the ceph-tracker-74872-cephadm-debug-log branch from 801c940 to 03eb9bc Compare June 12, 2026 07:38
@ashjosh1git

Copy link
Copy Markdown
Contributor Author

@rkachach I have pushed a fix to retain the comment and the fix context. I will push a squashed commit next as per @adk3798 's suggestion. Thanks for the reviews!

…level flag

  Introduces a new 'cephadm_binary_logging_level' config option to control
  the verbosity of cephadm logging to persistent destinations (cephadm.log, syslog).

  - Adds --logging-level CLI flag (info, debug, error, warning)
  - Adds mgr/cephadm/cephadm_binary_logging_level config option
  - Applies logging level to file and syslog handlers
  - Console handlers maintain their defaults for terminal UX

Fixes: https://tracker.ceph.com/issues/74872
Signed-off-by: Ashwin M. Joshi <[email protected]>
@ashjosh1git
ashjosh1git requested a review from rkachach June 12, 2026 08:13
@ashjosh1git
ashjosh1git force-pushed the ceph-tracker-74872-cephadm-debug-log branch from 03eb9bc to 63b9183 Compare June 12, 2026 08:17
@ashjosh1git
ashjosh1git requested a review from a team as a code owner June 12, 2026 08:40
@rkachach

Copy link
Copy Markdown
Contributor

@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 merged commit 7a4cdf1 into ceph:main Jun 12, 2026
6 checks passed
@github-actions

Copy link
Copy Markdown

This is an automated message by src/script/redmine-upkeep.py.

I found one or more Fixes: tags in the commit messages in

git log 7a4cdf1e701e5dfb754bb1802c66a980e131862c^..7a4cdf1e701e5dfb754bb1802c66a980e131862c

The referenced tickets are:

Those tickets do not reference this merged Pull Request. If this Pull Request merge resolves any of those tickets, please update the "Pull Request ID" field on each ticket. A future run of this script will appropriately update them.

Update Log: https://github.com/ceph/ceph/actions/runs/27411714574

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