Problem description
When provisioning Ubuntu hosts(physical server) with network bonding via Foreman, we run into a structural problem that seems hard (or impossible) to model cleanly using Foreman’s host interface model.
Unlike RHEL-based distributions, Ubuntu does not support bonding during early boot/installer stage (initramfs/Subiquity/curtin).
Because of this, Ubuntu cannot use a bond interface as the provisioning interface.
This forces the following design:
A single physical interface must be used for provisioning
The final installed system must use a bond interface (LACP / active-backup)
All networking must be fully automated, no manual post-install steps
How is this scenario intended to be solved in Foreman?
How should one model:
A provisioning-only physical interface
A final bond interface
With a single static IP
Is there:
A known limitation in Foreman’s interface model when used with Ubuntu w bonding interface?
A recommended best practice?
This seems like a common enterprise use case, but it’s unclear how Foreman expects it to be solved.
I’m in similar issue, what i’ve figured out is that, default kickstart file configures Bond and provisioning interface via NetworkManager, but I have seen a race condition between that, lets say provisioning interface is a slave in bond interface and if NetworkManager gets IP from dhcp 1st then that bond slave is not configured properly and it becomes useless.But if bond interface gets IP from dhcp 1st then bond interface works fine.So what I did is I edited out kickstart file to not configure provisioning interface, if it is also a bond slave. this way bond works fine if needed and provisioning interface gets configured if it is not a bond slave.The line which handles the interface configuration in default kickstart file:
<% # start with provisioning interface, then other non-bond non-bridge interfaces and the bonds + bridges at the end @host.interfaces.reject{ |iface| iface.bmc? }.sort_by { |iface| (iface.bond? || iface.bridge?) ? 0 : iface.provision? ? 20 : 10 }.each do |iface| -%>
ouput for above:
network --device=bond0 --hostname test.test.net --mtu=1500 --bondslaves=enp2s0f0np0,enp2s0f1np1 --bondopts=mode=balance-rr, --nodns network --device=enp2s0f0np0 --hostname test.test.net --noipv6 --mtu=1500 --bootproto dhcp --bondslaves= --bondopts=mode=balance-rr, --nodns
my modification:
<% # Collect all bond slave identifiers (interfaces attached to bonds) bond_slaves = @host.interfaces.select { |i| i.bond? }.map { |b| b.attached_devices.to_s.split(',').map { |s| s.strip } }.flatten # start with bonds + bridges first, then other non-bond non-bridge interfaces, and the provision interface at the end # reject BMC interfaces and bond slaves (they are configured as part of their bond) @host.interfaces.reject{ |iface| iface.bmc? || bond_slaves.include?(iface.identifier) }.sort_by { |iface| (iface.bond? || iface.bridge?) ? 0 : iface.provision? ? 20 : 10 }.each do |iface| -%> <%= snippet( 'kickstart_network_interface', variables: { iface: iface, host: @host, static: @static, static6: @static6 } ) -%> <%end-%>
Thank you for sharing your experience.
Provisioning RHEL-based systems with a bonded interface as the primary provisioning interface works well, since RHEL-based initrd supports bonding configuration via kernel parameters.
However, Ubuntu does not support bonding during early boot, which means a separate physical interface is required for provisioning, while a bond interface is needed to ensure correct netplan configuration on the installed system.
The challenge is that this setup does not seem to be cleanly modelable in Foreman:
we need a provisioning-only interface and a final bond interface using the same IP, but Foreman does not allow this.
As a result, it’s unclear how this scenario is intended to be handled in a fully automated way when provisioning Ubuntu with bonding.