-
Notifications
You must be signed in to change notification settings - Fork 9
[DNM] Dashboard modification to detect fully Ceph-backed deployment #157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Hi @H-M-Quang-Ngo thanks for the PR. It will be more nicer if you can:
|
|
Hi @H-M-Quang-Ngo, I'm okay with the changes now—thanks for providing the calculation examples. One thing I’d like to request is an update to the commit message. The current message makes it a bit difficult to trace the context of the change. Could you please include more details to make it clearer? Thanks! |
- Add a variable to (heuristically) detect a shared-Ceph-backend condition into compute.json & cloud.json dashboards - Change to expression of `Hypervisor Disk Subscription` panel in `compute.json` - Change to expression of `Total` panel in `compute.json` - Change to expression of `Free Disk by aggregate` panel in `cloud.json`
0de7948 to
20c166c
Compare
e14467f to
acc97e0
Compare
acc97e0 to
14363a9
Compare
thejjw
pushed a commit
to thejjw/sunbeam-charms
that referenced
this pull request
Jul 29, 2025
having Ceph-shared storage backend Add logic to some Openstack-Exporter-Operator dashboards to correctly report storage status when Ceph is used as the storage backend and no ephemeral storage available. The issue is reported in GitHub: canonical/openstack-exporter-operator#154 This patch add a workaround logic to detect whether the Openstack storage is likely backed by Ceph and nodes' ephemeral storages aren't used. Calculations are also updated for several dashboard parameters such as total storage or free storage, so that they are correctly properly when the condition is met. If the condition is not met, the logic will simply fallback to existing expression. A more detailed explanation and testing proof can be found in: canonical/openstack-exporter-operator#157 Change-Id: Id14fd0acd3f5b9601a08be35cc078f00d8035ef8 Signed-off-by: Quang Ngo <[email protected]>
- Replace the expression for `ceph_cluster_total_bytes` and `ceph_cluster_total_used_bytes` to be 0 when Ceph is not used.
62f0997 to
d4f1059
Compare
Previous commit has the `Ceph Shared Storage` returned both values 0 and 1 when shared Ceph is detected, since the `or` operator in promql returns both when evaluating between two terms both have data. This can be simply fixed by wrap a max() around the expression.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes to
OpenStack Cloud UsageandOpenStack Compute Overviewdashboards to address #154This solution adds a template variable
ceph_without_ephemeralfor these dashboards to check these conditions:If all checks are true, querying
ceph_without_ephemeralwill return true (1), which indicates Ceph is fully used as the storage backend on this deployment and there are likely no ephemeral/instance storage available. In that case, we need to use another expressions for disk calculation, otherwise (return0) we fallback to the existing expressions.Proposed panels to modify expression are:
Free Disk by Aggregate(inOpenStack Cloud Usage),Hypervisor Disk Subscriptionand itsTotal(fromOpenStack Compute Overview)Some sample calculations
Case 1 : Current bug
Case 2: Identical local storage
Case 3: Mixed Ceph + Local
Testing
Default configuration Environment (no Ceph)
openstack-exporter-operatorwithgrafana-agentsubordinate.Brief check
From

Ceph storagepanel (OpenStack Cloud Usage):Result:
No Ceph shared storage back end is detected as:

OpenStack Cloud Usage
Unchanged:
OpenStack Compute Overview
Unchanged:
Ceph-shared storage Environment (the issue's case)
Jammy Yoga Openstack with Ceph as the shared storage backend, with 3 compute nodes from stsstack-bundles
openstack-exporter-operatorwithgrafana-agentsubordinate.COS-lite on MicroK8s.
3 VM instances each with 1GiB disk created.
Add additional relations to scrape for Ceph metrics:
- From OpenStack model:
juju offer ceph-mon:metrics-endpointFrom COS model:
juju consume yoga-ceph.ceph-monjuju relate ceph-mon:metrics-endpoint prometheus-k8s:metrics-endpoint(May need to workaround this bug)
Brief check
From

Ceph storagepanel (OpenStack Cloud Usage):Result:
Ceph shared storage back end is correctly detected for each dashboard, as:

OpenStack Cloud Usage
Pre:
Free disk usage is incorrectly reported: x3 (total 29 x 3 - 3 allocated = 84 GiB)

After:
Free Disk is correctly reported as 24.8 (29.9 - 5.10 used = 24.8 GiB)

OpenStack Compute Overview
Pre:
Total Disk is incorrectly reported: x3 from actual Ceph cluster storage (29x3 = 87 GiB)

Subscription percentage is incorrect accordingly: 3/87 = 3.45%
After:
Total is correct from actual Ceph cluster storage (29.9 GiB)

Subscription is 5.10/29.9 = 17% (same from the Ceph storage dashboard)
Note:
Actual changes should be made from sunbeam