feat(cinder): add crush_rule support for EC metadata pool (#3747)

Signed-off-by: Guilherme Steinmuller <gsteinmuller@vexxhost.com>
This commit is contained in:
Guilherme Steinmüller authored and GitHub committed 2026-05-21 10:23:34 -04:00
1 parent 57a2414767
commit 6b2e50bde5
7 files changed
+29 -2

No files matched your search

@@ -13,6 +13,7 @@ Bitnami
CAPI
CAPO
CRD
CRUSH
CSI
Cinder
CoreDNS
@@ -46,5 +46,7 @@ spec:
failureDomain: {{ $pool_config.erasure_coded.failure_domain }}
replicated:
size: {{ $pool_config.metadata.replication }}
parameters:
crush_rule: {{ $pool_config.metadata.crush_rule }}
{{- end }}
{{- end }}
+1
View File
@@ -807,6 +807,7 @@ conf:
# data_pool_name: my-custom-data-pool # optional: override
# metadata:
# replication: 3
# crush_rule: replicated_rule
#
# Then configure the backend to reference the derived names:
#
@@ -1,6 +1,6 @@
--- a/cinder/templates/cephblockpool.yaml 2026-02-03 13:56:36.692000000 +0000
+++ b/cinder/templates/cephblockpool.yaml 2026-02-18 14:11:54.765316685 +0000
@@ -0,0 +1,50 @@
@@ -0,0 +1,52 @@
+{{/*
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
@@ -49,12 +49,14 @@
+ failureDomain: {{ $pool_config.erasure_coded.failure_domain }}
+ replicated:
+ size: {{ $pool_config.metadata.replication }}
+ parameters:
+ crush_rule: {{ $pool_config.metadata.crush_rule }}
+{{- end }}
+{{- end }}
--- a/cinder/values.yaml
+++ b/cinder/values.yaml
@@ -788,14 +788,33 @@
@@ -788,14 +788,34 @@
chunk_size: 8
app_name: cinder-volume
@@ -79,6 +81,7 @@
+ # data_pool_name: my-custom-data-pool # optional: override
+ # metadata:
+ # replication: 3
+ # crush_rule: replicated_rule
+ #
+ # Then configure the backend to reference the derived names:
#
+5
View File
@@ -135,6 +135,7 @@ EC pools require two components:
failure_domain: host
device_class: hdd # optional
metadata_replication: 3
crush_rule: replicated_rule # optional: CRUSH rule for metadata pool
user: cinder-ec # must be unique per EC backend
secret_uuid: <unique-uuid>
@@ -154,6 +155,10 @@ The EC pool configuration parameters are:
Failure domain for data placement, for example ``host``, ``rack``, or
``room``.
``crush_rule``
CRUSH rule for the replicated metadata pool. Defaults to
``replicated_rule``.
.. warning::
Each erasure-coded backend requires a **dedicated** ``user`` and a
+1
View File
@@ -249,6 +249,7 @@ class VolumeBackendRbdEc(ErasureCodedRbdPoolSpec, LibvirtSecretSpec):
},
"metadata": {
"replication": self.metadata_replication,
"crush_rule": self.crush_rule,
},
}
if ec.device_class is not None:
+14
View File
@@ -402,6 +402,7 @@ class TestStorageToCinderHelmValues:
assert ec_pool["erasure_coded"]["m"] == 2
assert ec_pool["erasure_coded"]["failure_domain"] == "host"
assert ec_pool["metadata"]["replication"] == 3
assert ec_pool["metadata"]["crush_rule"] == "replicated_rule"
assert ec_pool["app_name"] == "cinder-volume"
def test_ec_with_device_class(self):
@@ -434,6 +435,19 @@ class TestStorageToCinderHelmValues:
pool = result["conf"]["ceph"]["pools"]["cinder.volumes.ec"]
assert pool["erasure_coded"]["data_pool_name"] == "custom-data-pool"
def test_ec_with_custom_metadata_crush_rule(self):
ec_backend = {**_EC_BACKEND, "crush_rule": "ssd_rule"}
storage = {
**DEFAULT_STORAGE,
"volumes": {
"default": "ec1",
"backends": {"ec1": ec_backend},
},
}
result = storage_to_cinder_helm_values(storage)
pool = result["conf"]["ceph"]["pools"]["cinder.volumes.ec"]
assert pool["metadata"]["crush_rule"] == "ssd_rule"
def test_powerstore_backend_iscsi(self):
storage = {
**DEFAULT_STORAGE,