diff --git a/Documentation/CRDs/specification.md b/Documentation/CRDs/specification.md index 9c7b67357..f7dce1376 100644 --- a/Documentation/CRDs/specification.md +++ b/Documentation/CRDs/specification.md @@ -4054,6 +4054,16 @@ OSDStatus + + +deprecatedOSDs
+ +map[string][]int + + + + +

CephVersionSpec diff --git a/deploy/charts/rook-ceph/templates/resources.yaml b/deploy/charts/rook-ceph/templates/resources.yaml index 223f67535..4abe22cfe 100644 --- a/deploy/charts/rook-ceph/templates/resources.yaml +++ b/deploy/charts/rook-ceph/templates/resources.yaml @@ -5159,6 +5159,12 @@ spec: storage: description: CephStorage represents flavors of Ceph Cluster Storage properties: + deprecatedOSDs: + additionalProperties: + items: + type: integer + type: array + type: object deviceClasses: items: description: DeviceClasses represents device classes of a Ceph Cluster diff --git a/deploy/examples/crds.yaml b/deploy/examples/crds.yaml index aef1d5a77..9bd4fbb44 100644 --- a/deploy/examples/crds.yaml +++ b/deploy/examples/crds.yaml @@ -5157,6 +5157,12 @@ spec: storage: description: CephStorage represents flavors of Ceph Cluster Storage properties: + deprecatedOSDs: + additionalProperties: + items: + type: integer + type: array + type: object deviceClasses: items: description: DeviceClasses represents device classes of a Ceph Cluster diff --git a/pkg/apis/ceph.rook.io/v1/types.go b/pkg/apis/ceph.rook.io/v1/types.go index 1c45f3ac9..9189e915d 100755 --- a/pkg/apis/ceph.rook.io/v1/types.go +++ b/pkg/apis/ceph.rook.io/v1/types.go @@ -473,8 +473,9 @@ type Capacity struct { // CephStorage represents flavors of Ceph Cluster Storage type CephStorage struct { - DeviceClasses []DeviceClasses `json:"deviceClasses,omitempty"` - OSD OSDStatus `json:"osd,omitempty"` + DeviceClasses []DeviceClasses `json:"deviceClasses,omitempty"` + OSD OSDStatus `json:"osd,omitempty"` + DeprecatedOSDs map[string][]int `json:"deprecatedOSDs,omitempty"` } // DeviceClasses represents device classes of a Ceph Cluster diff --git a/pkg/operator/ceph/cluster/osd/osd.go b/pkg/operator/ceph/cluster/osd/osd.go index ae96ce125..5922e15c3 100644 --- a/pkg/operator/ceph/cluster/osd/osd.go +++ b/pkg/operator/ceph/cluster/osd/osd.go @@ -77,14 +77,15 @@ const ( // Cluster keeps track of the OSDs type Cluster struct { - context *clusterd.Context - clusterInfo *cephclient.ClusterInfo - rookVersion string - spec cephv1.ClusterSpec - ValidStorage cephv1.StorageScopeSpec // valid subset of `Storage`, computed at runtime - kv *k8sutil.ConfigMapKVStore - deviceSets []deviceSet - replaceOSD *OSDReplaceInfo + context *clusterd.Context + clusterInfo *cephclient.ClusterInfo + rookVersion string + spec cephv1.ClusterSpec + ValidStorage cephv1.StorageScopeSpec // valid subset of `Storage`, computed at runtime + kv *k8sutil.ConfigMapKVStore + deviceSets []deviceSet + replaceOSD *OSDReplaceInfo + deprecatedOSDs map[string][]int } // New creates an instance of the OSD manager @@ -902,6 +903,9 @@ func (c *Cluster) updateCephStorageStatus() error { cephClusterStorage.OSD = *osdStore + // Add the status about deprecated OSDs + cephClusterStorage.DeprecatedOSDs = c.deprecatedOSDs + err = c.context.Client.Get(c.clusterInfo.Context, c.clusterInfo.NamespacedName(), &cephCluster) if err != nil { if kerrors.IsNotFound(err) { diff --git a/pkg/operator/ceph/cluster/osd/spec.go b/pkg/operator/ceph/cluster/osd/spec.go index ac26064c9..a2285f062 100644 --- a/pkg/operator/ceph/cluster/osd/spec.go +++ b/pkg/operator/ceph/cluster/osd/spec.go @@ -555,6 +555,13 @@ func (c *Cluster) makeDeployment(osdProps osdProperties, osd OSDInfo, provisionC if osdProps.onPVC() { if osd.CVMode == "lvm" { initContainers = append(initContainers, c.getPVCInitContainer(osdProps)) + + // This is a deprecated OSD and should be replaced for future supportability + if c.deprecatedOSDs == nil { + c.deprecatedOSDs = make(map[string][]int) + } + reason := "LVM-based OSDs on a PVC are deprecated, see documentation on replacing OSDs" + c.deprecatedOSDs[reason] = append(c.deprecatedOSDs[reason], osd.ID) } else { // Raw mode on PVC needs this path so that OSD's metadata files can be chown after 'ceph-bluestore-tool' ran dataPath = activateOSDMountPath + osdID