Skip to content

Commit

Permalink
Make Ceph Full treshold to be configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
petr-balogh committed Jul 25, 2024
1 parent 1aeaace commit b6c0ab0
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 4 deletions.
3 changes: 3 additions & 0 deletions conf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,9 @@ higher priority).
* `custom_vpc` - Applicable only for IMB Cloud IPI deployment where we want to create custom VPC and networking
with specific Address prefixes to prevent /18 CIDR to be used.
* `ip_prefix` - Applicable only for IMB Cloud IPI deployment when custom_vpc, if not specified: 27 prefix will be used.
* `ceph_threshold_backfill_full_ratio` - Configure backfillFullRatio the ceph osd full thresholds value in the StorageCluster CR.
* `ceph_threshold_full_ratio` - Configure fullRatio the ceph osd full thresholds value in the StorageCluster CR.
* `ceph_threshold_near_full_ratio` - Configure nearFullRatio the ceph osd full thresholds value in the StorageCluster CR.

#### UPGRADE

Expand Down
6 changes: 6 additions & 0 deletions conf/ocsci/ceph_full_threshold.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# For testing EPIC: https://issues.redhat.com/browse/RHSTOR-5929
# Ceph full threshold is configurable via storageCluster
ENV_DATA:
ceph_threshold_backfill_full_ratio: 0.925
ceph_threshold_full_ratio: 0.975
ceph_threshold_near_full_ratio: 0.875
36 changes: 32 additions & 4 deletions ocs_ci/deployment/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -1564,13 +1564,41 @@ def deploy_ocs_via_operator(self, image=None):
wait_timeout_for_healthy_osd_in_minutes = config.ENV_DATA.get(
"wait_timeout_for_healthy_osd_in_minutes"
)
if wait_timeout_for_healthy_osd_in_minutes:
# For testing: https://issues.redhat.com/browse/RHSTOR-5929
ceph_threshold_backfill_full_ratio = config.ENV_DATA.get(
"ceph_threshold_backfill_full_ratio"
)
ceph_threshold_full_ratio = config.ENV_DATA.get("ceph_threshold_full_ratio")
ceph_threshold_near_full_ratio = config.ENV_DATA.get(
"ceph_threshold_near_full_ratio"
)
set_managed_resources_ceph_cluster = (
wait_timeout_for_healthy_osd_in_minutes
or ceph_threshold_backfill_full_ratio
or ceph_threshold_full_ratio
or ceph_threshold_near_full_ratio
)
if set_managed_resources_ceph_cluster:
cluster_data.setdefault("spec", {}).setdefault(
"managedResources", {}
).setdefault("cephCluster", {})
cluster_data["spec"]["managedResources"]["cephCluster"][
"waitTimeoutForHealthyOSDInMinutes"
] = wait_timeout_for_healthy_osd_in_minutes
managed_resources_ceph_cluster = cluster_data["spec"]["managedResources"][
"cephCluster"
]
if wait_timeout_for_healthy_osd_in_minutes:
managed_resources_ceph_cluster[
"waitTimeoutForHealthyOSDInMinutes"
] = wait_timeout_for_healthy_osd_in_minutes
if ceph_threshold_backfill_full_ratio:
managed_resources_ceph_cluster[
"backfillFullRatio"
] = ceph_threshold_backfill_full_ratio
if ceph_threshold_full_ratio:
managed_resources_ceph_cluster["fullRatio"] = ceph_threshold_full_ratio
if ceph_threshold_near_full_ratio:
managed_resources_ceph_cluster[
"nearFullRatio"
] = ceph_threshold_near_full_ratio

cluster_data_yaml = tempfile.NamedTemporaryFile(
mode="w+", prefix="cluster_storage", delete=False
Expand Down

0 comments on commit b6c0ab0

Please sign in to comment.