Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 2170908

Summary: No proper documentation is present that explains how to use iPXE for Foreman Discovery method
Product: Red Hat Satellite Reporter: Sayan Das <saydas>
Component: ProvisioningAssignee: Zuzana Lena Ansorgova <zuansorg>
Status: CLOSED CURRENTRELEASE QA Contact: sganar
Severity: high Docs Contact:
Priority: medium    
Version: 6.13.0CC: lstejska, sganar, sshtein, zuansorg
Target Milestone: UnspecifiedKeywords: Documentation, Triaged
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-02-27 15:04:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sayan Das 2023-02-17 15:46:37 UTC
Document URL: 

https://dxp-docp-prod.apps.ext-waf.spoke.prod.us-west-2.aws.paas.redhat.com/documentation/en-us/red_hat_satellite/6.13/html-single/provisioning_hosts/index?lb_target=preview#


Section Number and Name: 

Chapter 5. Configuring iPXE to Reduce Provisioning Times

4th point in last Procedure section , just above "5.1. Booting Virtual Machines" 


Describe the issue: 

We mention this:

~~
Optionally, configure Foreman discovery. For more information, see Chapter 7, Configuring the Discovery Service.

* In the Satellite web UI, navigate to Administer > Settings, and click the Provisioning tab.

* Locate the Default PXE global template entry row and in the Value column, change the value to discovery.
~~

That link takes us to https://dxp-docp-prod.apps.ext-waf.spoke.prod.us-west-2.aws.paas.redhat.com/documentation/en-us/red_hat_satellite/6.13/html-single/provisioning_hosts/index?lb_target=preview#Configuring_the_Discovery_Service_provisioning and in has no relevant details about iPXE with Discovery at all.


Let's say we have completed the other prerequisites and also tested the "5.1. Booting Virtual Machines" successfully, The Discovery via iPXE itself will fail when attempting and selecting the Discovery option from iPXE global menu. 

as port 8000 has no services running but iPXE\Httpboot will try to use that with httpboot endpoint to fetch fdi-image vmlinuz file. 


Suggestions for improvement: 

* First, Please decide if we will be fully supporting the Foreman DIscovery over iPXE for BIOS-based systems.

* If yes, Then we need to ensure that we have proper steps documented about it. 


Additional information: 

Consider fixing 6.12 and 6.11 as well

Comment 1 Sayan Das 2023-02-17 15:54:55 UTC
Some notes:

A) We can get the discovery successfully completed, by additionally running "satellite-installer --foreman-proxy-http true" on the satellite and opening port 8000 in firewall. 

B) While point A sorts the issue with Discovery itself, Once the host is discovered, I can't create the host from Satellite UI due to this Nasty BUG https://bugzilla.redhat.com/show_bug.cgi?id=2069324#c4 which we haven't fixed ( I don't know why )

C) So I use hammer command and now I can create a host profile from Discovered hosts and Submit it for build i.e.

hammer discovery provision --name mac525400fea371 --hostgroup-id 1 --organization-id 1 --location-id 2 --new-name rhel79 --subnet-id 1 --pxe-loader 'iPXE Embedded' --build true


And that continues to build the host via iPXE approach.

Comment 2 Sayan Das 2023-02-19 17:37:25 UTC
One more thing I discovered as a part of the same testing. 

After enabling the http feature in Comment 1, Everything works fine when the deployment is happening via Satellite.

But When we try to discover the system ( using iPXE ) within a Capsules network, It will fail at the very first Network Boot.


Reason: Capsule's IP is not in the list of trusted_proxies of Satellite\Foreman

Solution: ON satellite add the IP of the capsule ( 192.168.124.3/24 ) as a trusted proxy along with the other localhost entries. 

satellite-installer --foreman-trusted-proxies 127.0.0.1/8 --foreman-trusted-proxies ::1 --foreman-trusted-proxies 192.168.124.3/24

The discovery still fails at some later stage but for now, These much are good enough

Comment 3 Sayan Das 2023-02-19 17:59:34 UTC
(In reply to Sayan Das from comment #2)
> One more thing I discovered as a part of the same testing. 
> 
> After enabling the http feature in Comment 1, Everything works fine when the
> deployment is happening via Satellite.
> 
> But When we try to discover the system ( using iPXE ) within a Capsules
> network, It will fail at the very first Network Boot.
> 
> 
> Reason: Capsule's IP is not in the list of trusted_proxies of
> Satellite\Foreman
> 
> Solution: ON satellite add the IP of the capsule ( 192.168.124.3/24 ) as a
> trusted proxy along with the other localhost entries. 
> 
> satellite-installer --foreman-trusted-proxies 127.0.0.1/8
> --foreman-trusted-proxies ::1 --foreman-trusted-proxies 192.168.124.3/24
> 
> The discovery still fails at some later stage but for now, These much are
> good enough


FYI https://bugzilla.redhat.com/show_bug.cgi?id=2171295

Comment 6 Zuzana Lena Ansorgova 2024-02-26 21:07:58 UTC
We do not officially support iPXE: https://access.redhat.com/solutions/2674001
I've discussed this with other stakeholders and we don't want to extend support for iPXE.

We do support iPXE only with bootdisk.

@lstejska Does it make sense to use Discovery with bootdisk?

Comment 8 Sayan Das 2024-02-27 10:14:30 UTC
Discovery should not need a bootdisk. We already have something called PXE-Less Discovery which is also an ISO based operation and happens via Discovery + kexec process. 

The sole purpose of this BZ was to confirm whether we will officially support Discovery via iPXE or not and 

If yes, then document the relevant steps
If no, then remove any trace of **Discovery** from iPXE section

Comment 9 Zuzana Lena Ansorgova 2024-02-27 12:29:40 UTC
Oki, thank you both for clarifying. 
In that case, I'll remove traces of Discovery from iPXE section.

Comment 10 Zuzana Lena Ansorgova 2024-02-27 12:36:02 UTC
https://github.com/theforeman/foreman-documentation/pull/2833