Skip to content

PR 1: Detect undersized BlueStore DB devices - #1120

Open
zhhuabj wants to merge 1 commit into
canonical:mainfrom
zhhuabj:ceph-db-check-974
Open

PR 1: Detect undersized BlueStore DB devices#1120
zhhuabj wants to merge 1 commit into
canonical:mainfrom
zhhuabj:ceph-db-check-974

Conversation

@zhhuabj

@zhhuabj zhhuabj commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Implement the first item of #974 only: warn when a local OSD has a positive BlueStore DB capacity of 5 GiB or less.

Discover local OSDs from ceph-volume lvm list and obtain each OSD's DB capacity from bluefs.db_total_bytes in its admin-socket perf dump. Support the current standard Ceph sosreport perf-dump filename, which avoids relying on ceph report: that cluster-wide command can fail on OSD-only hosts without an admin keyring.

Add unit and scenario coverage for the warning.

Other checks proposed by #974, including BlueStore DB utilisation and spillover detection, are intentionally not included in this change.

Copilot AI lite review requested due to automatic review settings August 28, 2026 04:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Ceph OSD health signal to detect undersized BlueStore DB devices on the local host by correlating locally discovered OSD IDs (from ceph-volume lvm list) with each OSD’s admin-socket perf dump (bluefs.db_total_bytes), and raises a scenario warning when the DB device is ≤ 5 GiB.

Changes:

  • Introduces a CephChecks.local_osds_with_small_bluestore_db check with a 5 GiB threshold based on bluefs.db_total_bytes.
  • Extends CLI catalog support to read the “classic” sosreport admin-socket perf-dump filename for OSDs.
  • Adds unit + scenario coverage and a new scenario raising CephOSDWarning when undersized DB devices are detected.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/unit/storage/test_ceph_common.py Unit test covering detection of local OSDs with small BlueStore DB devices.
hotsos/defs/tests/scenarios/storage/ceph/ceph-osd/small_bluestore_db.yaml Scenario test validating the warning message is raised when the check reports bad OSDs.
hotsos/defs/scenarios/storage/ceph/ceph-osd/small_bluestore_db.yaml New scenario definition that raises CephOSDWarning based on the new check property.
hotsos/core/plugins/storage/ceph/common.py Implements the new CephChecks property and the 5 GiB threshold constant.
hotsos/core/host_helpers/cli/catalog.py Adds sosreport file-source support for ceph daemon osd.N perf dump output.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread hotsos/core/host_helpers/cli/catalog.py
Implement the first item of canonical#974 only: warn when a local OSD has a
positive BlueStore DB capacity of 5 GiB or less.

Discover local OSDs from ceph-volume lvm list and obtain each OSD's DB
capacity from bluefs.db_total_bytes in its admin-socket perf dump.
Support the current standard Ceph sosreport perf-dump filename, which
avoids relying on ceph report: that cluster-wide command can fail on
OSD-only hosts without an admin keyring.

Add unit and scenario coverage for the warning.

Other checks proposed by canonical#974, including BlueStore DB utilisation and
spillover detection, are intentionally not included in this change.

Signed-off-by: Zhang Hua <joshua.zhang@canonical.com>
@zhhuabj
zhhuabj force-pushed the ceph-db-check-974 branch from f43a8c2 to 49a8780 Compare August 28, 2026 04:37
@zhhuabj

zhhuabj commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

hua@y9000p:/bak/work/hotsos$ .tox/py3/bin/python -m hotsos.cli --storage --scenario storage.ceph.ceph-osd.small_bluestore_db --short data/hotsos-small-db-test.tar.xz
INFO: extracting sosreport data/hotsos-small-db-test.tar.xz to /tmp/tmp73zvhep8/sosreport-juju-b45c2d-ceph-22-hotsos-small-db-minimal-2026-08-27-xthswlm
INFO: analysing sosreport /tmp/tmp73zvhep8/sosreport-juju-b45c2d-ceph-22-hotsos-small-db-minimal-2026-08-27-xthswlm
INFO: analysing -
potential-issues:
storage:
CephOSDWarnings:
- Found OSD(s) osd.0 with a BlueStore DB device of 5 GiB or smaller. A small
DB device can cause metadata to spill over to the main OSD device and degrade
performance. Review the OSD device layout and provision a larger fast DB device.

@pponnuvel pponnuvel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good overall but I do want to understand how 5GiB was chosen and whether it's good for different OSD sizes.


@cached_property
def local_osds_with_small_bluestore_db(self):
"""Return local OSDs with a BlueStore DB device at most 5 GiB."""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Use BLUESTORE_DB_SIZE_MIN instead of 5 GiB

""" Ceph Checks. """
# A 1 GiB BlueStore DB is the ceph-volume default and is generally too
# small for production OSDs.
BLUESTORE_DB_SIZE_MIN = 5 * 1024 * 1024 * 1024

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

wy 5 GiB? The typical recommendation is 4% of the block dev size. So it's possible that a DB dev is > 5GiB but still be "small" for that OSD.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants