Bug 2214821

Summary: The "fdi.pxauto" option always works in automatic mode even if we oass the value as 0
Product: Red Hat Satellite Reporter: Sayan Das <saydas>
Component: Discovery ImageAssignee: satellite6-bugs <satellite6-bugs>
Status: NEW --- QA Contact: addubey
Severity: high Docs Contact:
Priority: high    
Version: 6.13.1CC: gtalreja, shwsingh
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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-06-13 18:06:12 UTC
Description of problem:

Going through https://access.redhat.com/documentation/en-us/red_hat_satellite/6.13/html-single/provisioning_hosts/index#Unattended_Use_Customization_and_Image_Remastering_provisioning , I assumed that , I will be able to customize the discovery ISO with some options but still be able to control few things while discovery starts but It seems the "fdi.pxauto" option does not works exactly the same way as explained in the documentation. 


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

Satellite 6.13 ( and 6.12\6.11\6.10\6.9 )

How reproducible:

100%

Steps to Reproduce:
1. Install a Satellite 6.13 and configure discovery service on the same
2. Install foreman-discovery-image package
3. Execute the following steps to remaster the ISO:

# cd /usr/share/foreman-discovery-image
# discovery-remaster foreman-discovery-image-x86_64-4.1.0-10.el8sat.iso "proxy.url=https://satellite.example.com:9090 proxy.type=proxy fdi.pxauto=0 fdi.ipv6.method=ignore" my_discovery_image.iso

4. Use that my_discovery_image.iso image discover a system i.e. attach the ISO to a system and boot with it.


Actual results:

The discovery ISO boots up and starts performing Automatic Discovery on it's own. There are no menu\seletable options provided to mention any custom facts or perhaps switch to a different smart-proxy discovery server.


Expected results:

Either "fdi.pxauto=0" should deliver a semi-automatic mode of Discovery process or We should correct our documentation about 

A) How fdi.pxauto is actually expected to work ?
B) Under which specific circumstances, The discovery-remaster is expected to be used
C) Is it mandatory to pass the "proxy.url" and "proxy.type" with discovery-remaster while using "fdi.pxauto" option ?

   ( Without that, Discovery will even not begun and say proxy_url declaration is missing or something like that )

Additional info:

From Documentation:

fdi.pxauto:

To set automatic or semi-automatic mode. If set to 0, the image uses semi-automatic mode, which allows you to confirm your choices through a set of dialog options. If set to 1, the image uses automatic mode and proceeds without any confirmation.

fdi.pxmac:

The MAC address of the primary interface in the format of AA:BB:CC:DD:EE:FF. This is the interface you aim to use for communicating with Capsule Server. In automated mode, the first NIC (using network identifiers in alphabetical order) with a link is used. In semi-automated mode, a screen appears and requests you to select the correct interface.


But I don't see that happening at all.

Moreover https://github.com/theforeman/foreman-discovery-image/blob/master/root/usr/share/ruby/vendor_ruby/discovery/menu.rb#L169-L208 tells me, 

* We don't need to pass 0 or 1 as a value. Just using "fdi.pxauto" option is good enough to start completely unattended PXEless provisioning. No semi-automatic mode at all.

* Following tells me that It will either use the interface whose MAC is defined by pxmac or else the first interface that has a link

mac = cmdline('fdi.pxmac') || detect_first_nic_with_link

So even here also, I don't see how the semi-automatic mode works ( as mentioned in the definition of fdi.pxmac ).

Comment 1 Sayan Das 2023-06-13 18:07:27 UTC
This is not a regression as I can reproduce this exact same behavior from Satellite 6.9 to 6.13. I am just wondering why this was never reported.

Comment 2 Sayan Das 2023-06-14 07:30:47 UTC
One more thing to add:

If I don't use fdi.pxauto and just use these args to remaster the image i.e. 

'proxy.url=https://satellite.example.com:9090 proxy.type=proxy fdi.ipv6.method=ignore fdi.ipv4.method=auto'

I would hope that booting from resulted in ISO, would not ask me to choose if I want to do manual IP addressing or DHCP-based discovery and will use DHCP-based discovery by default but it's not the case. 

So if "fdi.ipv4.method" or "fdi.ipv6.method" depends on "fdi.pxauto" somehow, then that should be clearly mentioned.