Project

General

Profile

Actions

Bug #9056

open

DHCP leases not deleted for image-based hosts via API

Added by Benjamin Roberts over 9 years ago. Updated almost 7 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
DHCP
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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

build-error.txt build-error.txt 5.55 KB API errors when rebuilding host Benjamin Roberts, 01/22/2015 05:44 PM
dhcpd.leases dhcpd.leases 6.82 KB Leases after failure Benjamin Roberts, 01/22/2015 05:44 PM
proxy.log proxy.log 3.02 KB Benjamin Roberts, 01/22/2015 05:44 PM

Related issues 1 (0 open1 closed)

Related to Smart Proxy - Bug #17194: Deleting a host doesn't delete ISC-DHCP entryResolved11/03/2016Actions
Actions #1

Updated by Benjamin Roberts over 9 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.

Actions #2

Updated by Lukas Zapletal over 9 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.

Actions #4

Updated by Benjamin Roberts over 9 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.

Actions #5

Updated by Lukas Zapletal about 9 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.

Actions #6

Updated by Lukas Zapletal almost 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.

Actions #7

Updated by Lukas Zapletal almost 7 years ago

  • Related to Bug #17194: Deleting a host doesn't delete ISC-DHCP entry added
Actions

Also available in: Atom PDF