Foreman does not add IP reservations to dhcpd.leases

Hi everyone,

Problem:

When I create a host in foreman and register a MAC and IP to it’s interfaces, a section for that is written to /var/lib/dhcpd/dhcpd.leases, immediately and looks like this:

host test123.mydomain.net {
  dynamic;
  hardware ethernet 00:50:56:8c:48:64;
  fixed-address 10.6.8.36;
        supersede server.filename = "pxelinux.0";
        supersede server.next-server = 0a:06:07:13;
        supersede host-name = "test123.mydomain.net";
}

But this seems to work for the primary/first interface of a host only: If I add another interface to the host, set that device’s MAC and IP and save, there is no entry added to /var/lib/dhcpd/dhcpd.leases for that. That results in that interface to receive a randomly IP instead of the configured one.

Expected outcome:

I expect that when it comes to IP reservation and assignment, a secondary interface should be handled just like the primary one by having a dhcp.leases section added for it.

Foreman and Proxy versions:

1.20.2

Am I doing something wrong?

Hello,

when you add the second interface, do you check “Managed” flag? Only managed interfaces are orchestrated. Also, make sure it is associated with a subnet that has DHCP Proxy set, otherwise DHCP orchestration is not performed.

Hey @lzap,

thank you for your answer and sorry for my very late reply! I missed this update to my question, to be honest; sorry for that!

Yes, Managed flag is set, without it resulting to be managed by the DHCP.

Any additional ideas?

Do you have multiple NICs? I think it might be this bug:

https://projects.theforeman.org/issues/26104

@tbrisker is working on 1.20.3 which should have this fix. In the meantime you can apply it as a hotfix.

Yes, the nodes have multiple NICs and I expect that each one get’s the IP I configured for them in Foreman. One IP per one NIC, nothing too special nor multiple IPs on the same NIC.

I tried to update our instance of Forman to 1.22.0, since this is what happened when following the Upgrade manual. I installed Foreman on CentOS 7 using the foreman-installer. I ended up with a version of 1.22.0, which had other issues (like removing all users from the “admins” user-group upon login of a LDAP authenticated user), but this issue did not get fixed. So I restored the VM snapshot of the Foreman - node I took before starting the upgrade.

The Bug reads exactly like the issue I am facing, but upgrading to 1.22.0 does not help here; the fix should be included in this release as well, doesn’t it?

Yes, 1.22 has it.

What I need to see is production.log with debug mode enabled - pastebin the relevant POST HTTP transaction which performs the orchestration steps.