Skip to content

Support the kea-dhcp-server lease file format - #98

Draft
mwindower wants to merge 1 commit into
masterfrom
support-kea-dhcp-server-lease-format
Draft

Support the kea-dhcp-server lease file format#98
mwindower wants to merge 1 commit into
masterfrom
support-kea-dhcp-server-lease-format

Conversation

@mwindower

@mwindower mwindower commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Description

metal-bmc could only read the lease file of the isc-dhcp-server. Which dhcp server wrote the lease file is now selectable from the outside with METAL_BMC_LEASE_FORMAT (isc or kea), next to the already existing METAL_BMC_LEASE_FILE. The default stays isc, so existing deployments are unaffected.

The kea memfile is a csv file whose columns are looked up by name from the header line, because kea appended columns over the versions and does not rewrite the memfile on an upgrade. It is written append-only, so the last entry of an address wins, a valid lifetime of zero means that the lease was removed and only leases in state 0 are handed out to a client.

Both parsers follow the same error convention: a malformed file fails the whole parse, an entry that is merely incomplete is logged and skipped.

An unknown format is rejected by Config.Validate at startup, the reporter resolves it once in New.

Used AI-Tools ✨

  • Claude Opus 5

metal-bmc could only read the lease file of the isc-dhcp-server. Which dhcp
server wrote the lease file is now selectable from the outside with
METAL_BMC_LEASE_FORMAT (isc or kea), next to the already existing
METAL_BMC_LEASE_FILE. The default stays isc, so existing deployments are
unaffected.

The kea memfile is a csv file whose columns are looked up by name from the
header line, because kea appended columns over the versions and does not
rewrite the memfile on an upgrade. It is written append-only, so the last
entry of an address wins, a valid lifetime of zero means that the lease was
removed and only leases in state 0 are handed out to a client.

Both parsers follow the same error convention: a malformed file fails the
whole parse, an entry that is merely incomplete is logged and skipped.

An unknown format is rejected by Config.Validate at startup, the reporter
resolves it once in New.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@majst01

majst01 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Looks promising, to have a full picture, a kea deployment at least in the mini-lab is required.

@mwindower

Copy link
Copy Markdown
Contributor Author

capms and dell flavor of mini-lab already deploy kea-dhcp but metal-bmc is not used in the mini-lab at all.
Would a integration test with a running dhcp-server instance in this repo help?

@majst01

majst01 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

capms and dell flavor of mini-lab already deploy kea-dhcp but metal-bmc is not used in the mini-lab at all. Would a integration test with a running dhcp-server instance in this repo help?

Sure, but the migrating the existing isc-dhcp deployments would also help. Maintaining two flavours is time consuming.

@mwindower

mwindower commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

I'm not sure what the expectations are here:

  • should the Ansible-role for isc-dhcp and kea have the same interface so that existing deployments can migrate to kea just by changing the role name
  • or should active leases be transferred from isc-dhcp to kea? this sounds more like a small helper tool within metal-roles?

For both I do not see why metal-bmc should do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants