From bf97d6350cf86dde126f6d962739d0e496d623d3 Mon Sep 17 00:00:00 2001 From: Mike Russell Date: Mon, 17 Nov 2025 11:54:28 -0800 Subject: [PATCH] adj: Ensure No Virtual Media Present Prior To Network Boot * making sure that there is no media present, that if there was we eject it * adds the additional rufio Action to do so prior to the one time network boot Resolves: adj/ensure-no-media-present-prior-to-pxe-boot Signed-off-by: Mike Russell --- pkg/util/job.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pkg/util/job.go b/pkg/util/job.go index 402fd27..3a393a5 100644 --- a/pkg/util/job.go +++ b/pkg/util/job.go @@ -19,6 +19,18 @@ func GenerateJob(name, namespace, powerAction string) *rufio.Job { PowerAction: rufio.PowerOn.Ptr(), } + /* + doc: Making sure to remove remote media that may be attached, + if media is attached network boot mode may not work, the node + may previously have been used to do an iso based install + */ + ensureMediaIsEjected := rufio.Action{ + VirtualMediaAction: &rufio.VirtualMediaAction{ + MediaURL: "", + Kind: "CD", + }, + } + pxeBoot := rufio.Action{ OneTimeBootDeviceAction: &rufio.OneTimeBootDeviceAction{ Devices: []rufio.BootDevice{ @@ -33,7 +45,7 @@ func GenerateJob(name, namespace, powerAction string) *rufio.Job { case seederv1alpha1.NodePowerActionShutdown: tasks = append(tasks, powerOffTask) case seederv1alpha1.NodePowerActionReboot: - tasks = append(tasks, powerOffTask, pxeBoot, powerOnTask) + tasks = append(tasks, powerOffTask, ensureMediaIsEjected, pxeBoot, powerOnTask) default: return nil }