<label for="device_class"
class="cd-col-form-label">
<ng-container i18n>Device class</ng-container>
- <cd-helper [html]="tooltips.device_class">
- </cd-helper>
</label>
<div class="cd-col-form-input">
<select class="form-select"
name="device_class"
formControlName="device_class">
<option ngValue=""
- i18n>Let Ceph decide</option>
+ i18n>All devices</option>
<option *ngFor="let deviceClass of devices"
[ngValue]="deviceClass">
{{ deviceClass }}
</option>
</select>
+ <cd-help-text>
+ <span i18n>{{tooltips.device_class}}</span>
+ </cd-help-text>
</div>
</div>
</div>
<label for="crushDeviceClass"
class="cd-col-form-label">
<ng-container i18n>Crush device class</ng-container>
- <cd-helper [html]="tooltips.crushDeviceClass">
- </cd-helper>
</label>
<div class="cd-col-form-input">
<select class="form-select"
name="crushDeviceClass"
formControlName="crushDeviceClass">
<option ngValue=""
- i18n>Let Ceph decide</option>
+ i18n>All devices</option>
<option *ngFor="let deviceClass of devices"
[ngValue]="deviceClass">
{{ deviceClass }}
</option>
</select>
+ <cd-help-text>
+ <span i18n>{{tooltips.crushDeviceClass}}</span>
+ </cd-help-text>
<span class="form-text text-muted"
i18n>Available OSDs: {{deviceCount}}</span>
</div>
ecpChange('technique', 'cauchy');
formHelper.setMultipleValues(ecp, true);
formHelper.setValue('crushFailureDomain', 'osd', true);
+ formHelper.setValue('crushDeviceClass', 'ssd', true);
submittedEcp['crush-failure-domain'] = 'osd';
submittedEcp['crush-device-class'] = 'ssd';
testCreation();
nodes,
this.form.get('crushRoot'),
this.form.get('crushFailureDomain'),
- this.form.get('crushDeviceClass')
+ this.form.get('crushDeviceClass'),
+ false
);
this.plugins = plugins;
this.names = names;
// Copied from /doc/rados/operations/crush-map.rst
root: $localize`The name of the node under which data should be placed.`,
failure_domain: $localize`The type of CRUSH nodes across which we should separate replicas.`,
- device_class: $localize`The device class data should be placed on.`
+ device_class: $localize`The device class on which to place data.`
};
constructor(private http: HttpClient) {}
defaults to 1. Using a value greater than one will cause a CRUSH MSR rule to be created.
Must be specified if crush-num-failure-domains is specified.`,
- crushDeviceClass: $localize`Restrict placement to devices of a specific class
- (e.g., ssd or hdd), using the crush device class names in the CRUSH map.`,
+ crushDeviceClass: $localize`The device class on which to place data.`,
directory: $localize`Set the directory name from which the erasure code plugin is loaded.`
};
failureDomainKeys: string[] = [];
devices: string[] = [];
deviceCount = 0;
+ /**
+ * Handles manual or automatic update of device class.
+ *
+ * When set true, the device class form field is automatically
+ * updated with the first device in the list of devices.
+ * Otherwise, user manually selects a device class.
+ */
+ autoDeviceUpdate: boolean = true;
static searchFailureDomains(
nodes: CrushNode[],
nodes: CrushNode[],
rootControl: AbstractControl,
failureControl: AbstractControl,
- deviceControl: AbstractControl
+ deviceControl: AbstractControl,
+ autoDeviceUpdate: boolean = true
) {
+ this.autoDeviceUpdate = autoDeviceUpdate;
this.nodes = nodes;
this.idTree = CrushNodeSelectionClass.createIdTreeFromNodes(nodes);
nodes.forEach((node) => {
this.devices.length === 1
? this.devices[0]
: this.getIncludedCustomValue(this.controls.device, this.devices);
- this.silentSet(this.controls.device, device);
+ if (this.autoDeviceUpdate) this.silentSet(this.controls.device, device);
this.onDeviceChange(device);
}