forked from rook/rook
Merge pull request #14187 from travisn/legacy-osd-status
osd: Add cephcluster status for deprecated osds to replace
This commit is contained in:
@@ -4054,6 +4054,16 @@ OSDStatus
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>deprecatedOSDs</code><br/>
|
||||
<em>
|
||||
map[string][]int
|
||||
</em>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3 id="ceph.rook.io/v1.CephVersionSpec">CephVersionSpec
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user