From d7f08693ed3f5d858eb018a6ecb0deefb5d5b11c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Knecht?= Date: Mon, 7 Jul 2025 10:51:35 +0200 Subject: [PATCH] core: set erasure-code-profile plugin based on pool algorithm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a `CephBlockPool` defines `spec.erasureCoded.algorithm`, use it as the erasure-code-profile plugin. Until now, that parameter would have been ignored completely, and every erasure-coded pool would use the same plugin as the `default` erasure-code-profile (i.e. `jerasure`). Note that using any algorithm other than `jerasure` or `isa` is likely to fail given the current implementation, as different algorithm require different sets of parameters, and those cannot be supplied by the user. Signed-off-by: BenoƮt Knecht --- pkg/daemon/ceph/client/erasure-code-profile.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/daemon/ceph/client/erasure-code-profile.go b/pkg/daemon/ceph/client/erasure-code-profile.go index bb8c2fbad..16579af81 100644 --- a/pkg/daemon/ceph/client/erasure-code-profile.go +++ b/pkg/daemon/ceph/client/erasure-code-profile.go @@ -72,6 +72,10 @@ func CreateErasureCodeProfile(context *clusterd.Context, clusterInfo *ClusterInf return errors.Wrap(err, "failed to look up default erasure code profile") } + if pool.ErasureCoded.Algorithm != "" { + defaultProfile.Plugin = pool.ErasureCoded.Algorithm + } + // define the profile with a set of key/value pairs profilePairs := []string{ fmt.Sprintf("k=%d", pool.ErasureCoded.DataChunks),