Skip to content

Commit

Permalink
fix: handle network interfaces without dhcp during pxeboot
Browse files Browse the repository at this point in the history
High Speed Networks (e.g. HPE Slingshot) with statically assigned IPs
don't use DHCP services. This causes the ipxe dhcp command to fail and
prevent pxe-booting from a subsequent interface. This change will allow
the ipxe script to skip over these types of networks.

Signed-off-by: Nathan Lee <[email protected]>
Signed-off-by: Andrey Smirnov <[email protected]>
  • Loading branch information
nathandotleeathpe authored and smira committed Nov 6, 2023
1 parent b2adb9f commit 7f6f787
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions app/sidero-controller-manager/internal/ipxe/ipxe_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ var ErrBootFromDisk = errors.New("boot from disk")
var BootTemplate = template.Must(template.New("iPXE embedded").Parse(`#!ipxe
prompt --key 0x02 --timeout 2000 Press Ctrl-B for the iPXE command line... && shell ||
# print interfaces
{{/* print interfaces */}}
ifstat
# retry 10 times overall
{{/* retry 10 times overall */}}
set attempts:int32 10
set x:int32 0
Expand All @@ -56,18 +56,19 @@ set x:int32 0
set idx:int32 0
:loop
# try DHCP on each interface
{{/* try DHCP on each interface */}}
isset ${net${idx}/mac} || goto exhausted
ifclose
iflinkwait --timeout 5000 net${idx} || goto next_iface
dhcp net${idx} && goto boot
dhcp net${idx} || goto next_iface
goto boot
:next_iface
inc idx && goto loop
:boot
# attempt boot, if fails try next iface
{{/* attempt boot, if fails try next iface */}}
route
chain --replace http://{{ .Endpoint }}:{{ .Port }}/ipxe?uuid=${uuid}&mac=${net${idx}/mac:hexhyp}&domain=${domain}&hostname=${hostname}&serial=${serial}&arch=${buildarch} || goto next_iface
Expand Down

0 comments on commit 7f6f787

Please sign in to comment.