[Kea-users] Unable to get the active lease list in sync with configuration data

Darren Ankney darren.ankney at gmail.com
Mon Apr 24 06:28:50 UTC 2023


Hi Kraishak,

Leases still being present when you didn't delete the file is easier
to understand.  The lease file is maintained by a separate application
called `kea-lfc`
(https://kea.readthedocs.io/en/kea-2.2.0/arm/lfc.html#the-lfc-process).
This process is executed periodically by `kea-dhcp4`.  You can also
execute it yourself if you like.  You can also modify how frequently
it is run with the "lfc-interval" argument to the "lease-database"
config block (https://kea.readthedocs.io/en/kea-2.2.0/arm/dhcp4-srv.html#memfile-basic-storage-for-leases)

Thank you,

Darren Ankney

On Mon, Apr 24, 2023 at 6:49 AM Kraishak Mahtha <kraishak.edu at gmail.com> wrote:
>
> Hi Darren,
>
> The clients are not active clients those are created from a test tool, so until we send the renew request command we don't see them get renewed,
>
> After changing the configuration I did a restart and observed the logs, the logs say that leases loaded from the lease file (this time I didn't delete the lease file) to observe it correctly. I still see the old leases in the lease output which are totally out of range as per the new config, for the same case in ISC DHCP it discards the leases if the IP is not in sync with the config.
>
> Please find my attached test results:
> Initial config: before_changes_first_config.txt
> Initial lease output: before_changes_first_lease_output.txt
> Changed the config with a totally different scope range: after_changes_second_config.txt
> After changing I initiated a few lease requests and tried to fetch the leases, it showed me the old and new leases in the output: after_changes_second_lease.txt
>
> Do we have any parameter config statement or process where we can reload the lease memory of the kea-DHCP to be in sync with the config? In ISC it handles by default
>
> Thanks
> Kraishak
>
>
>
>
>
>
> On Sun, Apr 23, 2023 at 10:44 AM Darren Ankney <darren.ankney at gmail.com> wrote:
>>
>> Hi Kraishak,
>>
>> I would suspect that you have a particularly chatty client that is
>> constantly renewing the lease.  I suspect that by the time you start
>> the server and have a chance to perform the lease4-get-all that the
>> client has already renewed the lease.  You confirm this by having a
>> look in the logs.  Possibly, while testing, set the severity to DEBUG
>> and debug level to 99.
>>
>> lease4-get-all is getting the data from the kea-dhcp4 server, it has
>> no where else to get it from.  It has to be the data as the kea-dhcp4
>> server sees it.
>>
>> Thank you,
>>
>> Darren Ankney
>>
>> On Fri, Apr 21, 2023 at 11:05 AM Kraishak Mahtha <kraishak.edu at gmail.com> wrote:
>> >
>> > Hi All,
>> > I am using the kea-HA in load balance mode, as part of testing I configured a subnet and set the lease time to "86400", later as part of the change I changed the scope rang and restarted kea-dhcp4(stopped and started) but still the lease4-get-all command shows all the old lease as active.
>> > Command I used to get lease : echo '{"command":"lease4-get-all"}' | /usr/bin/socat - UNIX:/root/tmp/kea4-ctrl-socket
>> >
>> > I stopped kea-DHCP on both servers, deleted all the lease files(kea service created two lease files with .2 extension remove that too), and then recreated with empty, and then started one by one but still, the command gives me the old leases data, Now I removed the HA config and made it standalone, deleted all the lease files and recreated lease file with empty data and started again but still, it shows the old lease entries as active.
>> >
>> > I tried adding the sanity check section too in the config,  line "lease-checks": "del" but it looks like it works at the subnet level, if I remove the subnet then it is not showing the data, but when I add it back the subnet with the different pool range still I can get the old lease data.
>> >
>> > I have two doubts
>> > 1)Even after deleting the lease file and deleting the range from the config file how can the server still have the lease information or from where does it get the data, Can we reset it manually or do we have any approach that needs to be followed for the server to auto figure out the lease entries are not used as the range definition itself is removed from the config file.
>> >
>> > 2)lease4-get-all command is not giving the correct data, do we have any way or any other command where we can get the current active leases without having old ones?
>> >
>> > Thanks In Advance
>> > Kraishak
>> >
>> > --
>> > ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.
>> >
>> > To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users.
>> >
>> > Kea-users mailing list
>> > Kea-users at lists.isc.org
>> > https://lists.isc.org/mailman/listinfo/kea-users


More information about the Kea-users mailing list