I found some time today (it’s Friday!) to fix the second most voted discovery issue:
In short, discovered host IP address was never changed to fall within the subnet range. All discovered hosts until this patch were always provisioned with the very same IP address as the hosts were discovered with. This now changes, Foreman correctly calls IPAM (if set) to acquire IPv4 (or IPv6 when set) address during provisioning.
The patch was hanging there for few years literally, I could not get to finishing it partially because I’ve decided to do improve IPv6 support in discovery and this blocked me since it was too much change. The new patch is more simple and it only adds what’s expected:
What works now (was not working):
- Discover a IPv4 host and provision it in the same subnet - new IPv4 address is acquired via IPAM.
- Discover a IPv4 host and provision it in a different subnet - new IPv4 and/or IPv6 address is acquired via IPAM.
- Works both via autoprovisioning and quick provision form.
- Does not work for Customize Host workflow (Edit Host form hack) - in this case error is thrown IP does not belong to subnet and user must click on Unused IP link to grab a new IP from IPAM.