Merge pull request #6815 from travisn/osd-deviceclass
ceph: Apply deviceClass properly to new osds
This commit is contained in:
4 files changed
+11
-5
No files matched your search
@@ -118,6 +118,7 @@ func addOSDConfigFlags(command *cobra.Command) {
|
||||
command.Flags().StringVar(&cfg.storeConfig.StoreType, "osd-store", "", "type of backing OSD store to use (bluestore or filestore)")
|
||||
command.Flags().IntVar(&cfg.storeConfig.OSDsPerDevice, "osds-per-device", 1, "the number of OSDs per device")
|
||||
command.Flags().BoolVar(&cfg.storeConfig.EncryptedDevice, "encrypted-device", false, "whether to encrypt the OSD with dmcrypt")
|
||||
command.Flags().StringVar(&cfg.storeConfig.DeviceClass, "osd-crush-device-class", "", "The device class for all OSDs configured on this node")
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -524,10 +524,16 @@ func (a *OsdAgent) initializeDevices(context *clusterd.Context, devices *DeviceO
|
||||
deviceArg,
|
||||
}...)
|
||||
|
||||
if a.storeConfig.DeviceClass != "" {
|
||||
// assign the device class specific to the device
|
||||
deviceClass := device.Config.DeviceClass
|
||||
if deviceClass == "" {
|
||||
// fall back to the device class for all devices on the node
|
||||
deviceClass = a.storeConfig.DeviceClass
|
||||
}
|
||||
if deviceClass != "" {
|
||||
immediateExecuteArgs = append(immediateExecuteArgs, []string{
|
||||
crushDeviceClassFlag,
|
||||
a.storeConfig.DeviceClass,
|
||||
deviceClass,
|
||||
}...)
|
||||
}
|
||||
|
||||
|
||||
@@ -139,7 +139,6 @@ type osdProperties struct {
|
||||
tuneSlowDeviceClass bool
|
||||
tuneFastDeviceClass bool
|
||||
schedulerName string
|
||||
crushDeviceClass string
|
||||
encrypted bool
|
||||
deviceSetName string
|
||||
// Drive Groups which apply to the node
|
||||
@@ -268,11 +267,11 @@ func (c *Cluster) startProvisioningOverPVCs(config *provisionConfig) {
|
||||
placement: volume.Placement,
|
||||
preparePlacement: volume.PreparePlacement,
|
||||
portable: volume.Portable,
|
||||
crushDeviceClass: volume.CrushDeviceClass,
|
||||
schedulerName: volume.SchedulerName,
|
||||
encrypted: volume.Encrypted,
|
||||
deviceSetName: volume.Name,
|
||||
}
|
||||
osdProps.storeConfig.DeviceClass = volume.CrushDeviceClass
|
||||
|
||||
logger.Debugf("osdProps are %+v", osdProps)
|
||||
|
||||
|
||||
@@ -233,6 +233,7 @@ func (c *Cluster) provisionOSDContainer(osdProps osdProperties, copyBinariesMoun
|
||||
envVars = append(envVars, deviceFilterEnvVar("all"))
|
||||
}
|
||||
envVars = append(envVars, v1.EnvVar{Name: "ROOK_CEPH_VERSION", Value: c.clusterInfo.CephVersion.CephVersionFormatted()})
|
||||
envVars = append(envVars, crushDeviceClassEnvVar(osdProps.storeConfig.DeviceClass))
|
||||
|
||||
if osdProps.metadataDevice != "" {
|
||||
envVars = append(envVars, metadataDeviceEnvVar(osdProps.metadataDevice))
|
||||
@@ -281,7 +282,6 @@ func (c *Cluster) provisionOSDContainer(osdProps osdProperties, copyBinariesMoun
|
||||
}
|
||||
envVars = append(envVars, dataDevicesEnvVar(string(marshalledDevices)))
|
||||
envVars = append(envVars, pvcBackedOSDEnvVar("true"))
|
||||
envVars = append(envVars, crushDeviceClassEnvVar(osdProps.crushDeviceClass))
|
||||
envVars = append(envVars, encryptedDeviceEnvVar(osdProps.encrypted))
|
||||
envVars = append(envVars, pvcNameEnvVar(osdProps.pvc.ClaimName))
|
||||
|
||||
|
||||
Reference in new issue
Block a user