Bug #17847
Updated by Alex Brodov about 8 years ago
When I'm deleting a host Foreman is sending a request to smart proxy to delete the reservation, but the lease will still exist until the expiration date.
Currently, smart-proxy (dhcp_native_ms module) doesn't have a functionality of a lease deletion.
I don't know if it's a bug or it's the expected behavior, but if we look at the scenario where we are provisioning a lot of hosts, our range is just 100 IPs, and we're deleting them after 4 hours, the lease will still exist and DHCP server won't provide an option for another host to be provisioned (unused IPs will be 0).
It can be avoided by setting up the TTL for a few hours, but this is not going to solve the issue, since, MS DHCP is not going to remove the lease immediately (after it got expired).
How does it affecting my environment and most likely others as well?
Let's say that i have one subnet configured in Foreman with the range of 50 IPs, I've configured in the smart proxy a TTL of 3 days for this subnet.
I've just created 50 hosts on top of this subnet, 1 hour later, I've deleted the 10 hosts, now I'm trying to create hosts, unfortunately, I'm getting the following error:
<pre>
{
"error": {"id":null,"errors":{"interfaces.ip":["can't be blank"],"interfaces.ip6":["can't be blank"]},"full_messages":["Ip can't be blank","Ip6 can't be blank"]}
}
</pre>
This is due to unfreed resources (lease) after the deletion of the host object has been performed.