Foreman fails to provision Openstack Instances with fixed IP address

Problem:
Foreman fails to provision Openstack Instances with fixed IP address

Expected outcome:
An instance provisioned , with a network port attached with a fixed IP address entered in the interface section of the Foreman host creation wizard.

Foreman and Proxy versions:
Foreman 3.13
Openstack Antelope

Foreman and Proxy plugin versions:
foreman-openstack-3.13.0-1.el9.noarch

Distribution and version:

Other relevant data:
Hi,

I am not very familiar with Foreman , but I fail to do something that seems obvious to me.
I have configured Foreman to provision instances on Openstack (Compute Resource, Images, Compute Profile , Networks , …).

I am able to connect Foreman to one project and provision new instances with the right flavor , on the right network. We use standard cloud images RHEL 9.6 + Katello. Everything works as expected.
However , the IP address of the network port attached to the instance is always allocated by (I guess) Openstack .
Since we manage our IP pool upstream , I want now to be able to specify one static IP address at the instance creation on Foreman side.

This features seems to be available in Foreman, and I have played with parameters in two sections :

  • in the Infrastructure → subnet definition->
    IPAM field to “None” or “Internal DB”
    Boot mode to “Static” vs DHCP
  • in the Host creation wizard → Interfaces Tab → edit :
    choose the IPV4 subnet
    entered a fixed IP in the subnet in the IPV4 Address field
    check or uncheck the Managed box

and on Openstack side :

  • enable or disable DHCP in the subnet details

In all cases, the port IP address is still allocated by Openstack .

I would expect Foreman to reproduce what I can do by hand on Openstack side :

  1. allocate a port in the subnet with one fixed IP address
  2. create an instance with this port attached.

Did I miss something on Foreman or Openstack ?

Hi,
@nofaralfasi Any advice, any clue about that issue ?
I guess some Foreman users have the similar need to allocate a fixed IP at VM creation.

An issue has been posted on : https://projects.theforeman.org/issues/38742 .
Thanks in advance for help.

Hi @HBD,

Thanks for reporting this bug! I’ve created a PR to try to fix it: #10704.

I don’t have an OpenStack instance to fully test it, so if you’re able to try it out on your environment and confirm it works, that would really help us speed up the review and get it merged.

Thanks a lot for your help!

CC: @lstejska

Hi @nofaralfasi
I confirm that replacing fixed_ip by v4_fixed_ip in your last patch as suggested by Loumy in Fixes #38742 - Add fixed IP address support for OpenStack by nofaralfasi · Pull Request #10704 · theforeman/foreman · GitHub makes it work .

Thanks a lot !

1 Like