From 31722a2041bff616c30cd223e46b8954c3f12b0a Mon Sep 17 00:00:00 2001 From: David Orman Date: Fri, 27 Mar 2026 15:42:55 -0500 Subject: [PATCH] osd: fix CRUSH device class not applied during OSD re-discovery When an OSD is purged and reprovisioned, it comes back without the correct CRUSH device class. NVMe devices configured with deviceClass: nvme in the CR end up as ssd. Root cause: the operator sets ROOK_OSD_CRUSH_DEVICE_CLASS on prepare jobs but not on OSD deployments. During re-discovery (GetCephVolumeRawOSDs), the daemon reads this env var, finds it absent, and falls back to auto-detected deviceType which returns ssd for NVMe. Fix: add crushDeviceClassEnvVar(osd.DeviceClass) to the OSD deployment spec in spec.go, alongside the existing dataDeviceClassEnvVar. Existing deployments pick up the new env var on operator reconciliation without manual intervention. Fixes #17227 Signed-off-by: David Orman (cherry picked from commit 1357d711771eb379670e7309691208d47855df55) --- pkg/operator/ceph/cluster/osd/spec.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/operator/ceph/cluster/osd/spec.go b/pkg/operator/ceph/cluster/osd/spec.go index f07fae5e5..4938d0ce1 100644 --- a/pkg/operator/ceph/cluster/osd/spec.go +++ b/pkg/operator/ceph/cluster/osd/spec.go @@ -422,6 +422,7 @@ func (c *Cluster) makeDeployment(osdProps osdProperties, osd *OSDInfo, provision blockPathEnvVariable(osd.BlockPath), cvModeEnvVariable(osd.CVMode), dataDeviceClassEnvVar(osd.DeviceClass), + crushDeviceClassEnvVar(osd.DeviceClass), k8sutil.PodIPEnvVar("ROOK_POD_IP"), }...) configEnvVars := append(c.getConfigEnvVars(osdProps, dataDir, false), []v1.EnvVar{