Foreman with efficient IP

Hi,

I’m running foreman 1.18.3, we have an efficient IP solution in place for IP management.
Is there a way to tell foreman to get an IP from efficient IP when creating a virtual machine ?

Best regards,

Hello,
There isn’t currently (as far as I’m aware) integration with Efficient IP. However, there is work on integration with external IPAM providers currently being done (with phpIPAM specifically in mind) by @grizzthedj and @lzap, I believe once that is done adding an additional provider should be fairly simple.

As a side note, 1.18 is a very old version of Foreman (over a year old). It contains multiple bugs and security issues that have been resolved since and is no longer supported, I highly recommend planning an upgrade to a more recent version (1.24.1 is the latest).

Please refer the ansible module Ansible-EfficientIP

The module can be used with ansible(presume your foreman has ansible support) for building the configuration, once the OS installation completed, the ansible run will start where the ansible will fetch next free ip(ip_address_find_free subnet_id task from the module) from the subnet in efficient IP DDI and register it as a variable, on the next task you can use that IP address in interface configuration teamplate, finally restart the network to make it work.
If you don’t have ansible support instead have puppet, the efficient IP api can be used to create custom resource ( may be).

Apart from the straight forward methods, we could use the Efficient IP API with a script under foreman hook points.

It’s not possible, Ansible or even hooks won’t help you in this case. Foreman does not provide any stable API to modify the IP address during the provisioning process. After a host has been provisioned, yes it IP address can be changed and then in Foreman too. That’s a bit clunky.

We are working on a brand new API called External IPAM where this could be easily implemented. Maybe we could actually provide a reference implementation in Smart Proxy core called “shellipam” that would implement the API using set of user-configurable shell scripts. Alternatively, we could add webhooks extension points too.

hi Izap,

I haven’t tried the direct api in Foreman hook points, however ansible method is working for me in redhat satellite, Isn’t the same thing should be working in Foreman as well? Just curious :slight_smile:

Thanks,
Karthik

You probably change the IP after host is provisioned, that works fine if it is what you want. But during provisioning, I assume the host has a different IP, assuming you do PXE booting. If not, disregard.

yeah, that’s correct. I change the IP after host provisioning. For host provisioning we use internal DHCP to lease an IP for new host which then get the discovery image from TFTP server(DHCP points to TFTP). Once the OS installation completed, ansible generates network configuration, then network restarted.

That’s a nice workaround by using ansible, but could you use https://github.com/theforeman/foreman-ansible-modules to provision the host with the right IP immediately rather than going through the restart dance? foreman_host – Manage Foreman hosts — Foreman Ansible Modules documentation doesn’t list an IP field.

cc @evgeni who might know if there’s a plan to implement the the interfaces

Plans, yes, Code, sadly not yet :frowning:

I haven’t tried foreman-ansible-modules, I’ll take a look and see how it can be used for my requirement. Thanks :smiley: for the suggestion.

Karthik

seems that efficentip build something: efficientip / Foreman Smart Proxy Plugin · GitLab

1 Like

I saw that, too.

I wonder how such a plugin is “wired” into the smart proxy so that it knows it’s there?

from user perspective its quite simple:

  1. install the gem
  2. copy the plugins configfile into the smartproxys settings.d folder and adjust it to your needs
  3. adjust the dhcp.yml config file inside the settings.d folder, so that the line :use_provider: shows the name of the gem. in this case dhcp_efficient_ip

Hi. I’m with the University of Minnesota. We contracted with Efficient IP in January of '21 to have a Satellite 6 plugin built for EIP since we previously had been using Infoblox and the associated Smart Proxy.

It has been working well for us since we cut over in December of '21.

We’d be delighted to converse with others who use Satellite and are using Efficient IP or considering doing so.

While it’s not directly on-topic, I’d still like to know what prompted you to switch DDI-vendors?

And how “good” is the integration?

The integration is working as well as the integration used to work with the Infoblox with 1 flaw - the update of the DHCP server isn’t as quick as it was with the OMAPI immediate update that the Infoblox supported.