Problem:
When a server that have EFI and Bios Legacy support enabled, foreman-proxy constantly set the pxe boot to legacy boot.
In our infra, all servers are using UEFI but also have legacy boot enabled.
Even if the server is capable of using pxe and boot in legacy mode, when the host is being provisioned, OS installer think it is a legacy bios and does not create nor install EFI capabilities and the host is not able to boot after it has been provisioned.
Some of you will tell me to limit our system to only use EFI, but it is currently not an option.
Expected outcome:
boot host with efiboot option
Foreman and Proxy versions:
- foreman-proxy 2.4.0-rc2
- rubygem-rubyipmi-0.10.0-6.el8
- ipmitool-1.8.18-17.el8.x86_64
Distribution and version:
CentOS Linux release 8.3.2011
Other relevant data:
The servers are Lenovo ThinkSystem SD530
Bios settings:
System Settings → Legacy BIOS → Legacy boot = enabled
System Settings → Network boot settings → {NIC_DEVICE}
- UEFI PXE mode = Enabled
- Legacy PXE mode = Enabled
System boot mode = UFEI Mode
Workaround
rubyipmi is quite old according to the gitlab repo and it hasn’t been updated in the past 4 years.
So, as a dirty workaround, I edited /usr/share/gems/gems/rubyipmi-0.10.0/lib/rubyipmi/ipmitool/commands/chassisconfig.rb
and changed the following:
# Set the boot device
def bootdevice(device, persistent=false)
if persistent
@options["cmdargs"] = "chassis bootdev #{device} options=efiboot"
else
#@options["cmdargs"] = "chassis bootparam set bootflag force_#{device}"
@options["cmdargs"] = "chassis bootdev #{device} options=efiboot"
end
value = runcmd
@options.delete_notify("cmdargs")
return value
end
This may not work for systems that still using legacy PXE, or for people that have mixed environment
Feature request
It would be great to have an option in foreman so we can set this option directly in the GUI or by using a BMC host parameter