Bug #9056
openDHCP leases not deleted for image-based hosts via API
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
Updated by Benjamin Roberts almost 10 years ago
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.
Updated by Lukas Zapletal almost 10 years ago
Can you attach dhcpd.leases file and log of the proxy - only the relevant bits. Host creation, deletion and subsequent creation with the error.
Updated by Benjamin Roberts almost 10 years ago
- File build-error.txt build-error.txt added
- File dhcpd.leases dhcpd.leases added
- File proxy.log proxy.log added
Updated by Benjamin Roberts almost 10 years ago
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.
Updated by Lukas Zapletal almost 10 years ago
- 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.
Updated by Lukas Zapletal over 7 years ago
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.
Updated by Lukas Zapletal over 7 years ago
- Related to Bug #17194: Deleting a host doesn't delete ISC-DHCP entry added