Bug #9056
open
DHCP leases not deleted for image-based hosts via API
Added by Benjamin Roberts almost 10 years ago.
Updated over 7 years ago.
Description
Foreman does not cleanup the dhcp leases of auto-suggested IP's allocated to image based hosts. Expected behaviour is that foreman will remove the hosts lease from the appropriate smart-proxy.
Creating an image based host (with a subnet_id specified), deleting it and subsequently recreating it results in a smart proxy dhcp conflict:
"Create DHCP Settings for vm-3.[ommited] task failed with the following error: ERF12-6899 [ProxyAPI::ProxyException]: Unable to set DHCP entry ([RestClient::Conflict]: 409 Conflict) for proxy http://[ommited]:8443/dhcp"
The entry must be manually removed from /var/lib/dhcpd/leases on the offending smart proxy before the host can be recreated.
Potentially related to http://projects.theforeman.org/issues/8827
Files
I attempted to change the host back to provision_method="build" to see if that enabled removal of the dhcp lease, however this is not modifiable after a host is created.
Can you attach dhcpd.leases file and log of the proxy - only the relevant bits. Host creation, deletion and subsequent creation with the error.
The only way to continue is to manually remove the host entry for "vm-2" from the leases file and restart dhcpd.
When encountered in the gui the overwrite dialog seems to work.
- Subject changed from DHCP leases not deleted for image hosts to DHCP leases not deleted for image-based hosts via API
It looks there are two issues:
a) Host overwrite V2 flag does not work
b) DHCP reservation does not get deleted
Thanks for the report, we will get back to that later.
Benjamin, what is the status of this. Do you still experience this bug with 1.14? Was this always an API issue and not UI? Thanks.
- Related to Bug #17194: Deleting a host doesn't delete ISC-DHCP entry added
Also available in: Atom
PDF