diff --git a/pkg/harvester/l10n/en-us.yaml b/pkg/harvester/l10n/en-us.yaml
index e85e813eec8..7ae8c31d394 100644
--- a/pkg/harvester/l10n/en-us.yaml
+++ b/pkg/harvester/l10n/en-us.yaml
@@ -185,6 +185,7 @@ harvester:
tab:
volume: Volumes
network: Networks
+ boot-order: Boot Order
advanced: Advanced Options
accessCredentials: Access Credentials
pciDevices: PCI Devices
@@ -500,8 +501,10 @@ harvester:
imageTip: An external URL to the .iso, .img, .qcow2 or .raw that the virtual machine should be created from.
efiEnabled: Booting in EFI mode
secureBoot: Secure Boot
+ bootOrder:
+ dragTip: Drag and drop devices, or use the device's arrows, to change the boot order.
volume:
- dragTip: Drag and drop volumes, or use the volume's arrows, to change the boot order.
+ bootOrderTip: To change the boot order go to Boot Order tab.
volumeTip: The VM only contains a cd-rom volume. You may want to add additional disk volumes.
macTip: "MAC address as seen inside the guest system."
volumeUpdate: 'Set volume { name } successfully'
@@ -527,6 +530,7 @@ harvester:
title: Are you sure?
message: Are you sure you want to unmount this volume?
network:
+ bootOrderTip: To change the boot order go to Boot Order tab.
title: Network
addNetwork: Add Network
addPort: Add Port
diff --git a/pkg/harvester/mixins/harvester-vm/index.js b/pkg/harvester/mixins/harvester-vm/index.js
index ac78170814a..a584a6e3e1f 100644
--- a/pkg/harvester/mixins/harvester-vm/index.js
+++ b/pkg/harvester/mixins/harvester-vm/index.js
@@ -23,6 +23,18 @@ import { HCI as HCI_ANNOTATIONS } from '@pkg/harvester/config/labels-annotations
import impl, { QGA_JSON, USB_TABLET } from './impl';
import { uniq } from '@shell/utils/array';
+function asBootOrderDevice(type) {
+ return el => ({
+ ...el,
+ type
+ });
+}
+
+export const BOOT_ORDER_TYPE = {
+ DISK: 'disk',
+ INTERFACE: 'interface'
+};
+
export const MANAGEMENT_NETWORK = 'management Network';
export const OS = [{
@@ -282,6 +294,13 @@ export default {
topologyKeyPlaceholder: this.t('harvesterManager.affinity.topologyKey.placeholder')
};
},
+
+ bootOrderDevices() {
+ return [
+ ...this.networkRows?.map(asBootOrderDevice(BOOT_ORDER_TYPE.INTERFACE)),
+ ...this.diskRows?.map(asBootOrderDevice(BOOT_ORDER_TYPE.DISK))
+ ];
+ }
},
async created() {
@@ -403,6 +422,7 @@ export default {
out.push({
id: randomStr(5),
source: SOURCE_TYPE.IMAGE,
+ bootOrder: 1,
name: 'disk-0',
accessMode: 'ReadWriteMany',
bus: 'virtio',
@@ -414,7 +434,7 @@ export default {
volumeMode: 'Block',
});
} else {
- out = _disks.map( (DISK, index) => {
+ out = _disks.map( (DISK) => {
const volume = _volumes.find( V => V.name === DISK.name );
let size = '';
@@ -477,8 +497,6 @@ export default {
const bus = DISK?.disk?.bus || DISK?.cdrom?.bus;
- const bootOrder = DISK?.bootOrder ? DISK?.bootOrder : index;
-
const parseValue = parseSi(size);
const formatSize = formatSi(parseValue, {
@@ -492,7 +510,7 @@ export default {
return {
id: randomStr(5),
- bootOrder,
+ bootOrder: DISK?.bootOrder,
source,
name: DISK.name,
realName,
@@ -581,7 +599,7 @@ export default {
const diskNameLables = [];
const volumeClaimTemplates = [];
- disk.forEach( (R, index) => {
+ disk.forEach( (R) => {
const prefixName = this.value.metadata?.name || '';
let dataVolumeName = '';
@@ -594,7 +612,7 @@ export default {
dataVolumeName = R.realName;
}
- const _disk = this.parseDisk(R, index);
+ const _disk = this.parseDisk(R);
const _volume = this.parseVolume(R, dataVolumeName);
const _dataVolumeTemplate = this.parseVolumeClaimTemplate(R, dataVolumeName);
@@ -869,8 +887,8 @@ export default {
this.$set(this, 'memory', memory);
},
- parseDisk(R, index) {
- const out = { name: R.name };
+ parseDisk(R) {
+ const out = { name: R.name, bootOrder: R.bootOrder };
if (R.type === HARD_DISK) {
out.disk = { bus: R.bus };
@@ -878,8 +896,6 @@ export default {
out.cdrom = { bus: R.bus };
}
- out.bootOrder = index + 1;
-
return out;
},
@@ -957,6 +973,8 @@ export default {
_interface.model = R.model;
_interface.name = R.name;
+ _interface.bootOrder = R.bootOrder;
+
return _interface;
},