diff options
author | Zuul <zuul@review.opendev.org> | 2022-08-03 23:28:19 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2022-08-03 23:28:19 +0000 |
commit | 37af14608823a8ef79fccaf9ee7f8b3e67644a9c (patch) | |
tree | 9e920828775fa87b7b812b9916ae1aa6576eb5c3 /ironic | |
parent | 2f06cc69029acfdbefdf4970c9e3c51c55a15ae2 (diff) | |
parent | fb73bdf10501f25b8ed29c23b865c58ed4cb10b7 (diff) | |
download | ironic-37af14608823a8ef79fccaf9ee7f8b3e67644a9c.tar.gz |
Merge "Exit ipxe script if enable_netboot_fallback failed"
Diffstat (limited to 'ironic')
12 files changed, 27 insertions, 9 deletions
diff --git a/ironic/drivers/modules/boot.ipxe b/ironic/drivers/modules/boot.ipxe index 4ed58497c..95d95686a 100644 --- a/ironic/drivers/modules/boot.ipxe +++ b/ironic/drivers/modules/boot.ipxe @@ -10,6 +10,12 @@ isset ${net${netid}/mac} || goto loop_done echo Attempting to boot from MAC ${net${netid}/mac:hexhyp} chain {{ ipxe_for_mac_uri }}${net${netid}/mac:hexhyp} || goto loop +# If we've got here the chained config returned success +# suggesting "sanboot" in boot_whole_disk failed (some UEFI cases) +# exit 0 so the bios continues to the next device +echo Exiting pxe config to allow boot to continue on next device +exit 0 + :loop_done {% if ipxe_fallback_script -%} chain {{ ipxe_fallback_script }} | goto boot_failed diff --git a/ironic/drivers/modules/ipxe_config.template b/ironic/drivers/modules/ipxe_config.template index bca63c982..7f348bb2f 100644 --- a/ironic/drivers/modules/ipxe_config.template +++ b/ironic/drivers/modules/ipxe_config.template @@ -72,4 +72,4 @@ goto boot_iscsi {%- endif %} :boot_whole_disk -sanboot --no-describe +sanboot --no-describe || exit 0 diff --git a/ironic/tests/unit/drivers/boot-fallback.ipxe b/ironic/tests/unit/drivers/boot-fallback.ipxe index bf8ab414c..ada2646a6 100644 --- a/ironic/tests/unit/drivers/boot-fallback.ipxe +++ b/ironic/tests/unit/drivers/boot-fallback.ipxe @@ -10,6 +10,12 @@ isset ${net${netid}/mac} || goto loop_done echo Attempting to boot from MAC ${net${netid}/mac:hexhyp} chain pxelinux.cfg/${net${netid}/mac:hexhyp} || goto loop +# If we've got here the chained config returned success +# suggesting "sanboot" in boot_whole_disk failed (some UEFI cases) +# exit 0 so the bios continues to the next device +echo Exiting pxe config to allow boot to continue on next device +exit 0 + :loop_done chain inspector.ipxe | goto boot_failed diff --git a/ironic/tests/unit/drivers/boot.ipxe b/ironic/tests/unit/drivers/boot.ipxe index aa8ee9e51..006bcb4aa 100644 --- a/ironic/tests/unit/drivers/boot.ipxe +++ b/ironic/tests/unit/drivers/boot.ipxe @@ -10,6 +10,12 @@ isset ${net${netid}/mac} || goto loop_done echo Attempting to boot from MAC ${net${netid}/mac:hexhyp} chain pxelinux.cfg/${net${netid}/mac:hexhyp} || goto loop +# If we've got here the chained config returned success +# suggesting "sanboot" in boot_whole_disk failed (some UEFI cases) +# exit 0 so the bios continues to the next device +echo Exiting pxe config to allow boot to continue on next device +exit 0 + :loop_done echo PXE boot failed! No configuration found for any of the present NICs. echo Press any key to reboot... diff --git a/ironic/tests/unit/drivers/ipxe_config.template b/ironic/tests/unit/drivers/ipxe_config.template index 70f8a03f1..86e8fe36b 100644 --- a/ironic/tests/unit/drivers/ipxe_config.template +++ b/ironic/tests/unit/drivers/ipxe_config.template @@ -44,4 +44,4 @@ initrd http://1.2.3.4:1234/ramdisk || goto boot_ramdisk boot :boot_whole_disk -sanboot --no-describe +sanboot --no-describe || exit 0 diff --git a/ironic/tests/unit/drivers/ipxe_config_boot_from_anaconda.template b/ironic/tests/unit/drivers/ipxe_config_boot_from_anaconda.template index 7963b3883..08e377899 100644 --- a/ironic/tests/unit/drivers/ipxe_config_boot_from_anaconda.template +++ b/ironic/tests/unit/drivers/ipxe_config_boot_from_anaconda.template @@ -44,4 +44,4 @@ initrd http://1.2.3.4:1234/ramdisk || goto boot_ramdisk boot :boot_whole_disk -sanboot --no-describe +sanboot --no-describe || exit 0 diff --git a/ironic/tests/unit/drivers/ipxe_config_boot_from_iso.template b/ironic/tests/unit/drivers/ipxe_config_boot_from_iso.template index c7133c7b6..7e4c83640 100644 --- a/ironic/tests/unit/drivers/ipxe_config_boot_from_iso.template +++ b/ironic/tests/unit/drivers/ipxe_config_boot_from_iso.template @@ -42,4 +42,4 @@ imgfree sanboot http://1.2.3.4:1234/uuid/iso :boot_whole_disk -sanboot --no-describe +sanboot --no-describe || exit 0 diff --git a/ironic/tests/unit/drivers/ipxe_config_boot_from_ramdisk.template b/ironic/tests/unit/drivers/ipxe_config_boot_from_ramdisk.template index 70f8a03f1..86e8fe36b 100644 --- a/ironic/tests/unit/drivers/ipxe_config_boot_from_ramdisk.template +++ b/ironic/tests/unit/drivers/ipxe_config_boot_from_ramdisk.template @@ -44,4 +44,4 @@ initrd http://1.2.3.4:1234/ramdisk || goto boot_ramdisk boot :boot_whole_disk -sanboot --no-describe +sanboot --no-describe || exit 0 diff --git a/ironic/tests/unit/drivers/ipxe_config_boot_from_volume_extra_volume.template b/ironic/tests/unit/drivers/ipxe_config_boot_from_volume_extra_volume.template index 0a872804a..bab0d879c 100644 --- a/ironic/tests/unit/drivers/ipxe_config_boot_from_volume_extra_volume.template +++ b/ironic/tests/unit/drivers/ipxe_config_boot_from_volume_extra_volume.template @@ -62,4 +62,4 @@ sleep 10 goto boot_iscsi :boot_whole_disk -sanboot --no-describe +sanboot --no-describe || exit 0 diff --git a/ironic/tests/unit/drivers/ipxe_config_boot_from_volume_multipath.template b/ironic/tests/unit/drivers/ipxe_config_boot_from_volume_multipath.template index 571216e39..2ab084b9d 100644 --- a/ironic/tests/unit/drivers/ipxe_config_boot_from_volume_multipath.template +++ b/ironic/tests/unit/drivers/ipxe_config_boot_from_volume_multipath.template @@ -59,4 +59,4 @@ sleep 10 goto boot_iscsi :boot_whole_disk -sanboot --no-describe +sanboot --no-describe || exit 0 diff --git a/ironic/tests/unit/drivers/ipxe_config_boot_from_volume_no_extra_volumes.template b/ironic/tests/unit/drivers/ipxe_config_boot_from_volume_no_extra_volumes.template index 6b7a4394d..12b025f87 100644 --- a/ironic/tests/unit/drivers/ipxe_config_boot_from_volume_no_extra_volumes.template +++ b/ironic/tests/unit/drivers/ipxe_config_boot_from_volume_no_extra_volumes.template @@ -59,4 +59,4 @@ sleep 10 goto boot_iscsi :boot_whole_disk -sanboot --no-describe +sanboot --no-describe || exit 0 diff --git a/ironic/tests/unit/drivers/ipxe_config_timeout.template b/ironic/tests/unit/drivers/ipxe_config_timeout.template index 2458f010b..97a690801 100644 --- a/ironic/tests/unit/drivers/ipxe_config_timeout.template +++ b/ironic/tests/unit/drivers/ipxe_config_timeout.template @@ -44,4 +44,4 @@ initrd --timeout 120 http://1.2.3.4:1234/ramdisk || goto boot_ramdisk boot :boot_whole_disk -sanboot --no-describe +sanboot --no-describe || exit 0 |