mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-07 14:46:15 +08:00
feat: support network boot (PXE) for VM interfaces (#1176)
Add an "Enable network boot (PXE)" option to bridge network interfaces and a VM-level choice to place network boot devices before or after volumes. The form now owns interface boot order: enabled NICs get sequential boot orders ahead of or behind the volumes, and a stale bootOrder is no longer inherited from the old spec. This also fixes editing a VM whose interface bootOrder was set in YAML (the documented workaround): the form used to renumber disks from 1 while keeping the NIC's bootOrder, producing a duplicate that KubeVirt rejects. The boot order shown on the VM, snapshot and backup detail pages now includes network interfaces. Related: harvester/harvester#3325 Signed-off-by: Alejandro Bonilla <abonilla@suse.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
528255dea4
commit
5af181f5b6
@@ -15,6 +15,7 @@ import OverviewKeypairs from '../kubevirt.io.virtualmachine/VirtualMachineTabs/V
|
||||
import Volume from '../../edit/kubevirt.io.virtualmachine/VirtualMachineVolume';
|
||||
import Network from '../../edit/kubevirt.io.virtualmachine/VirtualMachineNetwork';
|
||||
import CloudConfig from '../../edit/kubevirt.io.virtualmachine/VirtualMachineCloudConfig';
|
||||
import { getBootDevices } from '../../utils/vm';
|
||||
const UNDEFINED = 'n/a';
|
||||
|
||||
export default {
|
||||
@@ -74,18 +75,8 @@ export default {
|
||||
return image?.spec?.displayName || '-';
|
||||
},
|
||||
|
||||
disks() {
|
||||
const disks = this?.spec?.template?.spec?.domain?.devices?.disks || [];
|
||||
|
||||
return disks.filter((disk) => {
|
||||
return !!disk.bootOrder;
|
||||
}).sort((a, b) => {
|
||||
if (a.bootOrder < b.bootOrder) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
});
|
||||
bootDevices() {
|
||||
return getBootDevices(this?.spec?.template?.spec?.domain?.devices);
|
||||
},
|
||||
|
||||
cdroms() {
|
||||
@@ -101,8 +92,10 @@ export default {
|
||||
getDeviceType(o) {
|
||||
if (o.disk) {
|
||||
return 'Disk';
|
||||
} else {
|
||||
} else if (o.cdrom) {
|
||||
return 'CD-ROM';
|
||||
} else {
|
||||
return 'Network';
|
||||
}
|
||||
},
|
||||
isEmpty(o) {
|
||||
@@ -184,10 +177,10 @@ export default {
|
||||
<div>
|
||||
<ul>
|
||||
<li
|
||||
v-for="(disk, i) in disks"
|
||||
v-for="(device, i) in bootDevices"
|
||||
:key="i"
|
||||
>
|
||||
{{ disk.bootOrder }}. {{ disk.name }} ({{ getDeviceType(disk) }})
|
||||
{{ device.bootOrder }}. {{ device.name }} ({{ getDeviceType(device) }})
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -233,6 +226,7 @@ export default {
|
||||
>
|
||||
<Network
|
||||
v-model:value="networkRows"
|
||||
:network-boot-first="networkBootFirst"
|
||||
:mode="mode"
|
||||
/>
|
||||
</Tab>
|
||||
|
||||
Reference in New Issue
Block a user