On further investigation I am wondering if my new hosts are not being added
to the dhcp.leases file at all. That is whatever mechanism that foreman
uses to update dhcp does not seem to be working. None of the hosts I added
yesterday have been added to the leases file, nor as above has that older
host been removed.
These issues started happening when I upgraded from 1.4 so perhaps there is
something that I am not running now that I need to?
Apparently my dhcp.yml file got reverted to not manage it, or at least that
is what appears to be the case.
···
---
# Enable DHCP management
:enabled: true
# valid vendors:
# - isc
# - native_ms (Microsoft native implementation)
# - virsh (simple implementation for libvirt)
# The vendor can be either isc or native_ms
:dhcp_vendor: isc
# dhcp_subnets is a Native MS implementation setting. It restricts the
subnets queried to a
# subset, so as to reduce the query time.
#:dhcp_subnets: [192.168.205.0/255.255.255.128,
192.168.205.128/255.255.255.128]
# Settings for Ubuntu ISC
#:dhcp_config: /etc/dhcp3/dhcpd.conf
#:dhcp_leases: /var/lib/dhcp3/dhcpd.leases
# Settings for Redhat ISC
:dhcp_config: /etc/dhcpd.conf
:dhcp_leases: /var/lib/dhcpd/dhcpd.leases
Hopefully I will see updates to the leases file now.
Just to followup, I am not getting any new hosts that I create to appear in
my dhcpd.leases file. However any existing systems, if they are not already
there, are not being created in the file.
Is there a way to force the creation of these entries without recreating
all of my hosts?
Sorry that is NOW getting any new hosts that I create to appear.
···
On Friday, January 9, 2015 at 2:12:52 PM UTC-8, Terrence Martin wrote:
>
>
> Just to followup, I am now getting any new hosts that I create to appear
> in my dhcpd.leases file. However any existing systems, if they are not
> already there, are not being created in the file.
>
> Is there a way to force the creation of these entries without recreating
> all of my hosts?
>
>
> Just to followup, I am not getting any new hosts that I create to appear
> in my dhcpd.leases file. However any existing systems, if they are not
> already there, are not being created in the file.
>
> Is there a way to force the creation of these entries without recreating
> all of my hosts?
>
Ohad
···
On Sat, Jan 10, 2015 at 12:12 AM, Terrence Martin wrote:
> Sorry that is NOW getting any new hosts that I create to appear.
Hello,
are you aware how ISC DHCP manages data in the leases file? It only
appends to the file, it never modifies existing entries. Read the
dhcpd.leases man page for more info.
Actually that is not really accurate. The leases file can get entries that
remove the previous entry and on the next update the old one is removed. I
have seen this first hand while fiddling.
I took advantage of this by changing and then changing back the IP mapping
of all of my new hosts so that they then appeared correctly in the file.
From the man page
In order to prevent the lease database from growing without bound,
the file is rewritten from time to time.
Terrence
···
On Tue, Jan 13, 2015 at 4:35 AM, Lukas Zapletal wrote:
Sorry that is NOW getting any new hosts that I create to appear.
Hello,
are you aware how ISC DHCP manages data in the leases file? It only
appends to the file, it never modifies existing entries. Read the
dhcpd.leases man page for more info.
> In order to prevent the lease database from growing without bound,
> the file is rewritten from time to time.
What I said is really correct. It never modifies, it only appends.
What you have here is the rewrite scenario when it reads the old file
dropping all the unnecessary records and creating (appending) a new
(temp) file which is then renamed back. This is for data consistency.
But this is really nitpicking. It does this every start, so you can
really modify what you want and restart the server to get the desired
behavior. Then it happens every hour or something.