Skip to content

Commit bf97d63

Browse files
committed
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 <michael.russell@suse.com>
1 parent a53a950 commit bf97d63

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

pkg/util/job.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@ func GenerateJob(name, namespace, powerAction string) *rufio.Job {
1919
PowerAction: rufio.PowerOn.Ptr(),
2020
}
2121

22+
/*
23+
doc: Making sure to remove remote media that may be attached,
24+
if media is attached network boot mode may not work, the node
25+
may previously have been used to do an iso based install
26+
*/
27+
ensureMediaIsEjected := rufio.Action{
28+
VirtualMediaAction: &rufio.VirtualMediaAction{
29+
MediaURL: "",
30+
Kind: "CD",
31+
},
32+
}
33+
2234
pxeBoot := rufio.Action{
2335
OneTimeBootDeviceAction: &rufio.OneTimeBootDeviceAction{
2436
Devices: []rufio.BootDevice{
@@ -33,7 +45,7 @@ func GenerateJob(name, namespace, powerAction string) *rufio.Job {
3345
case seederv1alpha1.NodePowerActionShutdown:
3446
tasks = append(tasks, powerOffTask)
3547
case seederv1alpha1.NodePowerActionReboot:
36-
tasks = append(tasks, powerOffTask, pxeBoot, powerOnTask)
48+
tasks = append(tasks, powerOffTask, ensureMediaIsEjected, pxeBoot, powerOnTask)
3749
default:
3850
return nil
3951
}

0 commit comments

Comments
 (0)