We have a simple setup where we have a single subnet and the Foreman server, TFTP server, DHCP Smart Proxy server, DHCP server and DNS server are on the same single server. We are hoping to use this server to discover and provision the other hosts (which are bare-metal) within the same subnet.
The problem we experienced is as below:
- Host is discovered.
- We click the button in the Foreman UI to trigger the provisioning.
- Host reboots, but it does not download the image of the OS, and hence the provisioning fails.
Upon checking through the logs, we realised that when the host was discovered, it was assigned an IP by the ISC DHCP server, and upon reboot, the hosts asks for the same IP address, but this time, due to the previous allocation of the same IP address during the Discovery process, there was already a lease for that IP address within dhcp.leases, resulting in the DHCP server complaining that there was a Dynamic and Static Lease conflict.
We tried a variety of methods to overcome this:
- We tried removing the lease from the lease file manually while the host was rebooting and this works (i.e. the host was able to download the image and boot up the OS)
- We followed the recommended guidelines and allocate non-overlapping IP address range for the Discovery process and Provisioning process. This did not work as the host could be discovered, and upon reboot, it was assigned a different IP but it was not provisioned. For this method, we discovered that when the host was rebooting, an IP was already reserved for it in the dhcp lease file, but when we looked through the DHCP smart proxy logs, it was trying to reserve ANOTHER IP (which it could not due to an existing entry for the same MAC within the lease file).
We have also checked and ensure that there is only one DHCP server running.
We hope that the whole process of Discovery and Provisioning should be automatic, instead of needing us to manually wipe out the lease file.
Foreman and Proxy versions:
Foreman and Proxy plugin versions:
Distribution and version:
Other relevant data: