Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2207698 - The `Suggest new` link in the interface tab beside IPv4 Address while creating a host is not suggesting any new IP even if the hosts created are deleted to free up ip leases [NEEDINFO]
Summary: The `Suggest new` link in the interface tab beside IPv4 Address while creatin...
Keywords:
Status: POST
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Foreman Proxy
Version: 6.14.0
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: Unspecified
Assignee: nalfassi
QA Contact: Satellite QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-05-16 15:05 UTC by sganar
Modified: 2024-03-28 10:32 UTC (History)
11 users (show)

Fixed In Version: rubygem-smart_proxy_dhcp_infoblox-0.0.18
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:
rlavi: needinfo? (jpathan)
rlavi: needinfo? (ehelms)
sganar: needinfo? (ehelms)
sganar: needinfo? (jpathan)


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 37227 0 Normal New The `Suggest new` link in the interface tab beside IPv4 Address while creating a host is not suggesting any new IP even ... 2024-03-06 10:23:02 UTC
Red Hat Issue Tracker SAT-17785 0 None None None 2023-05-18 14:34:51 UTC

Description sganar 2023-05-16 15:05:08 UTC
Description of problem:
The `Suggest new` link in the interface tab beside IPv4 Address while creating a host is not suggesting any new IP even if there are many unused IPs in Infoblox

Version-Release number of selected component (if applicable):


How reproducible:
always

Steps to Reproduce:
1. Do the Satellite and Infoblox integration
2. Create host > Interfaces > IPV4 address 


Actual results:
The ip is not displayed after a number of tries of clicking `suggest new`

Expected results:
The ip should be displayed after a number of tries of clicking `suggest new`

Additional info:

Comment 1 Brad Buckingham 2023-05-18 14:34:09 UTC
Is this a regression from earlier Satellite release?

Comment 2 sganar 2023-05-18 14:47:35 UTC
No, this is not a regression

Comment 6 Leos Stejskal 2023-05-29 11:48:57 UTC
Can you try to reproduce the issue without Infoblox, I believe it won't be related just to the Infoblox,
but more to clean up of IPs in the Capsule.

Can you also upload logs from the Capsule? I quote Nalfassi here:
> I discovered that the `start` method mentioned in this link (https://github.com/theforeman/smart-proxy/blob/develop/modules/dhcp_common/free_ips.rb#L41) is not invoked anywhere, and this is the root cause of the problem.

After providing the information (test with different providers, logs), we should move it to the Capsule component.

Comment 16 Ewoud Kohl van Wijngaarden 2024-01-17 14:10:48 UTC
I'm pretty sure what happens is that the Foreman requests a free IP suggestion from the Smart Proxy. That is implemented via the Smart Proxy's free IPs service: https://github.com/theforeman/smart-proxy/blob/develop/modules/dhcp_common/free_ips.rb

The whole goal of this is that you can suggest an IP to the user and be reasonable sure that it will remain free while the user is filling in the rest of the host form.

What you can see is that it looks for an available IP by taking the set of IPs it's allowed to allocate within the subnet, subtract the already allocated. The IP it found is temporarily marked as allocated. This period is defined as the blacklist interval, defaulting to 30 * 60 (so 30 minutes). Cleanup of the reservations pool happens every minute. The is no mechanism to manually mark a previously suggested IP address as free again.

You can actually override this blacklist duration, though there is no installer option for it. This would be done in by adding :blacklist_duration_minutes to /etc/foreman-proxy/settings.d/dhcp_isc.yml

The other possibility is to increase the size of the pool. In a subnet you provide the Smart Proxy with a begin and end IP address. Increasing that to a larger number will allow to you provision more hosts.

Comment 18 Ewoud Kohl van Wijngaarden 2024-01-17 14:23:05 UTC
Apologies for the update shortly after. I missed that it was about Infoblox, not ISC DHCP.

(In reply to Leos Stejskal from comment #6)
> Can you try to reproduce the issue without Infoblox, I believe it won't be
> related just to the Infoblox,
> but more to clean up of IPs in the Capsule.

dhcp_isc uses the same FreeIps service:

https://github.com/theforeman/smart_proxy_dhcp_infoblox/blob/a71c1786fcec3cd79235acbbd8ee96a6c4d13075/lib/smart_proxy_dhcp_infoblox/plugin_configuration.rb#L22

(In reply to Leos Stejskal from comment #6)
> Can you try to reproduce the issue without Infoblox, I believe it won't be
> related just to the Infoblox,
> but more to clean up of IPs in the Capsule.
> 
> Can you also upload logs from the Capsule? I quote Nalfassi here:
> > I discovered that the `start` method mentioned in this link (https://github.com/theforeman/smart-proxy/blob/develop/modules/dhcp_common/free_ips.rb#L41) is not invoked anywhere, and this is the root cause of the problem.
> 
> After providing the information (test with different providers, logs), we
> should move it to the Capsule component.

Interestingly this never calls `start_services :unused_ips` so that may be the actual bug.

If we look at dhcp_isc, we see it does start the service. First it defines the free_ips dependency:

https://github.com/theforeman/smart-proxy/blob/2fb6db34f8726df3e8b276c4ced0542fd296bc6a/modules/dhcp_isc/configuration_loader.rb#L28

That is then called with start_services:

https://github.com/theforeman/smart-proxy/blob/2fb6db34f8726df3e8b276c4ced0542fd296bc6a/modules/dhcp_isc/dhcp_isc_plugin.rb#L18

Looking at the definition of start_services, that calls .start:

https://github.com/theforeman/smart-proxy/blob/2fb6db34f8726df3e8b276c4ced0542fd296bc6a/lib/proxy/plugin_initializer.rb#L253-L258

So I think Nofar's analysis of not starting the FreeIps service is correct and a very likely cause of the problem. Adding that start_services :unused_ips line to https://github.com/theforeman/smart_proxy_dhcp_infoblox/blob/master/lib/smart_proxy_dhcp_infoblox/dhcp_infoblox_plugin.rb likely resolves the issue.

Comment 22 nalfassi 2024-03-06 10:23:01 UTC
Created redmine issue https://projects.theforeman.org/issues/37227 from this bug

Comment 23 Bryan Kearney 2024-03-19 16:04:27 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/37227 has been resolved.


Note You need to log in before you can comment on or make changes to this bug.