IPAM Réservation - how to create multiple hosts in parallel

Hi all,

I’m having an issue with Foreman IPAM provisioning.
We’re using at this time the Infoblox DHCP/DNS module for our host IP provisioning, and we’re having an issue regarding the concurent creation of hosts.

We’re using IPAM DHCP for getting new addresses on the hosts.
All hosts are created through an API call.
Instead, we’re seeing that the hosts we’re creating in parallel are all getting the same IP (the next free IP available).

What I was expecting to happen is that each host should get its own IP and this IP should be reserved to the host at the time it get it.

Have you encountered such situation already ?
How do we deal with it ?

Thanks

Seb

AFAIR this limitation does not exists in the ISC DHCP implementation unless you really ran out of IP’s. so I would assume its the infoblox provider which doesn’t “remember” which IP’s were offered?

It’d be helpful to know which versions you are using. Especially the proxy and infoblox plugin.

@Dmitri_Dolguikh / @Klaas_Demter I think you mostly worked on this.

Our foreman is version 1.15.6.
Our infoblox_plugins : 0.0.6 for dns and dhcp.

I’m not sure when the proxy asked for an ip address the infoblox reserves it.

This known issue was solved in upstream recently and should be part of 1.17

  • IP addresses are no longer issued to different hosts.

http://projects.theforeman.org/issues/20474

The fix is in DHCP common layer, so it will work both with ISC and Infoblox
mentioned.

Workaround: Apply the patch on your instance or wait for 1.17.

Good candidates for backporting to a 1.16.1? Right now there’s only one fix so this would double that amount :slight_smile:

Reading this issue right now, the description seems to be different thant the case I’m refering to.
Basically, my problem is

a- start creating machine A in a lan
b- start creating machine B in the same lan while A is deploying (before the creation of DNS entries)

A and B gets the same IP on the lan which is the next free ip in the reservation.

Yes, that’s correct. Fix is sometimes more generic than bug report, and that’s this case:

This is exactly what you are suffering from.

The fix lzap is referring to is not applicable for infoblox dhcp provider, which uses infoblox API to retrieve free ip addresses.

I’m not sure this can be fixed (or they would be interested in such a change) on infoblox side, as this use case is somewhat unusual. Infoblox supports different modes of free ip lookups (ranges vs. networks), and at this point I’m not sure if it’s possible (or feasible) to replace infoblox implementation with smart-proxy one.

1 Like

In that case, you can try using Random DB IP IPAM which Foreman has from version I think 1.16 onwards. It’s basically a simple DB IPAM but it does not give you addresses in sequence, but in randomized order. Then you need to make sure all IPs in the subnet/range on Infoblox are managed only by Foreman (so there is no collision). That should work ™.

I don’t understand the point. My problem is two concurrent calls the create hosts API gets the same IP.
I’m not doing two reservations through different ways. Foreman should prevent this whatever DHCP is used.
Maybe the problem is that foreman creates the IP after creating the VM, leading to the IP already used problem.
Between the suggested IP in the creation form and the effective creation of the IP, the windows is rather large.