Deleting a provisionned host, then rediscover and reprovision fails at DHCP

When I delete a host and rediscover it then reprovision with the same DNS name, dhcp proxy fails by saying duplicate entry.

I have to edit /var/lib/dhcpd/dhcpd.leases and manually remove the entry for the mac.

Expected outcome:

When rebuilding or recreating, dhcp is able to either reuse a still valid dhcp lease or at least overwrite the previous information without breaking.

Foreman and Proxy versions:

Foreman 2.4 with Katello 4.0

Distribution and version:

Installed on RHEL 7

You should configure your DHCP not to intersect with DHCP reservation range in foreman.

This is documented, granted this is buried down at the two places:


I am taking this into the new documentation:

From the new paragraph proposal:

Ensure that DHCP range of all subnets where discovery is planned do not intersect with DHCP lease pool configured for the managed DHCP service.
DHCP range is set in web interface while lease pool range is set via {foreman-installer}.
For example, in a network range to could be allocated for leases and to could be allocate for reservations.

Ok so the Discovery range must be distinct from the provisioning range?

I discover hosts using PXE Boot and the Foreman DHCP is the one responsible for DHCP on discovery and then Provisioning on the same subnet with same Foreman DHCP.

From what I understand, the range given when installing Foreman with ‘–foreman-proxy-dhcp-range’ would be used for provisioning and the range given in the web interface would be used for Discovery?

So for Provisioning using Foreman I should create a Subnet with IPAM set to DHCP and the range configured so as to not overlap the range I put in ‘–foreman-proxy-dhcp-range’, is that right?

Thank you.