Bug 2149030

Summary: iPXE template for hosts are getting generated with two "ks=" kernel command line parameters in Satellite 6.11 and above
Product: Red Hat Satellite Reporter: Sayan Das <saydas>
Component: Provisioning TemplatesAssignee: Oleh Fedorenko <ofedoren>
Status: CLOSED ERRATA QA Contact: sganar
Severity: high Docs Contact:
Priority: high    
Version: 6.11.4CC: ahumbe, gtalreja, mhulan, pcreech
Target Milestone: 6.13.0Keywords: EasyFix, Triaged
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: foreman-3.4.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2158580 (view as bug list) Environment:
Last Closed: 2023-05-03 13:23:05 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 2022-11-28 15:56:35 UTC
Description of problem:

https://bugzilla.redhat.com/show_bug.cgi?id=2041457 has fixed many issues but 

It's missing fixes from a related Redmine https://projects.theforeman.org/issues/34975 which was expected to fix "Kickstart default iPXE" template.

Due to the unavailability of the same, the "Kickstart Default iPXE" template now renders in this way i.e.

~~
kernel http://satellite-fqdn/pulp/content/RedHat/Library/content/dist/rhel/server/7/7.9/x86_64/kickstart//images/pxeboot/vmlinuz initrd=initrd.img ks=http://satellite-fqdn/unattended/provision?token=7d732ee3-22e5-476c-adaa-ee2eb32074f4  network ksdevice=bootif ks.device=bootif BOOTIF=01-00-50-56-b4-ea-34 ks=http://satellite-fqdn/unattended/provision?token=7d732ee3-22e5-476c-adaa-ee2eb32074f4 kssendmac ks.sendmac ip=dhcp
~~

whether it's rhel 9 or below i.e. two ks= params. 

And for specifically rhel 9, we see one ks= and one inst.ks= entry 


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

Satellite 6.11 and 12 ( it's perhaps reproducible in 6.10 as well )


How reproducible:

100 %


Steps to Reproduce:
1. Create a satellite 6.11 or above

2. Setup the same for an PXE based deployment of RHEL 7 and RHEL 9

3. Create two baremetal host entries for RHEL 7 and RHEL 9 respectively and submit for build.

4. Go to https://<satellite-fqdm>/hosts/<host -fqdn> --> Templates --> From Edit Drop down review the "iPXE template" 


Actual results:

For RHEL 7

kernel http://satellite-fqdn/pulp/content/RedHat/Library/content/dist/rhel/server/7/7.9/x86_64/kickstart//images/pxeboot/vmlinuz initrd=initrd.img ks=http://satellite-fqdn/unattended/provision?token=7d732ee3-22e5-476c-adaa-ee2eb32074f4  network ksdevice=bootif ks.device=bootif BOOTIF=01-00-50-56-b4-ea-34 ks=http://satellite-fqdn/unattended/provision?token=7d732ee3-22e5-476c-adaa-ee2eb32074f4 kssendmac ks.sendmac ip=dhcp


For RHEL 9

kernel http://satellite-fqdn/pulp/content/RedHat/QA/RHEL9/content/dist/rhel9/9.0/x86_64/baseos/kickstart//images/pxeboot/vmlinuz initrd=initrd.img ks=http://satellite-fqdn/unattended/provision?token=887d2261-f47a-4196-957f-1bef01df0c13 net.ifnames=0 biosdevname=0 BOOTIF=01-00-11-22-33-55-66 inst.ks=http://satellite-fqdn/unattended/provision?token=887d2261-f47a-4196-957f-1bef01df0c13 inst.ks.sendmac ip=dhcp


Expected results:

Only one ks= option should be visible for < RHEL 9

Only one inst.ks= option should be visible for >= RHEL 9


Additional info:

Foreman 3.3.1 or above should already have that fix via https://projects.theforeman.org/issues/34975 and related PRs.

Comment 1 Bryan Kearney 2022-11-28 20:03:43 UTC
Upstream bug assigned to ofedoren

Comment 2 Bryan Kearney 2022-11-28 20:03:44 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/34975 has been resolved.

Comment 3 sganar 2022-12-27 07:49:36 UTC
Verified.

Tested on Satellite 6.13.0 Snap 3.0

Steps followed: 
1. Setup the satellite for an PXE based deployment of RHEL 7 and RHEL 9
2. Create two baremetal host entries for RHEL 7 and RHEL 9 respectively and submit for build.
3. Go to https://<satellite-fqdn>/hosts/<host -fqdn> --> Templates --> From Edit Drop down review the "iPXE template" 

Observation: 
For RHEL 7:
Only one `ks=` option present

kernel http://satellite-fqdn/pulp/content/Default_Organization/Library/content/dist/rhel/server/7/7.9/x86_64/kickstart//images/pxeboot/vmlinuz initrd=initrd.img  network ksdevice=bootif ks.device=bootif BOOTIF=01-56-6f-0d-72-06-d7 ks=http://satellite-fqdn:8000/unattended/provision?token=fd9d8e23-9662-43e9-8d1b-176704bc0df2 kssendmac ks.sendmac ip=dhcp

For RHEL 9:
only one `inst.ks=` option present

kernel http://satellite-fqdn/pulp/content/Default_Organization/Library/content/dist/rhel9/9.0/x86_64/baseos/kickstart//images/pxeboot/vmlinuz initrd=initrd.img  BOOTIF=01-56-6f-0d-72-06-da inst.ks=http://satellite-fqdn:8000/unattended/provision?token=a9fadd93-2c3b-4416-9c8b-ea056e52a513 inst.ks.sendmac ip=dhcp

Comment 6 errata-xmlrpc 2023-05-03 13:23:05 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Satellite 6.13 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:2097