Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 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 "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". 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 "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-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 2133053

Summary: [RHEL-9] parse-kickstart doesn't create expected information for bond ports
Product: Red Hat Enterprise Linux 9 Reporter: Jan Stodola <jstodola>
Component: anacondaAssignee: Radek Vykydal <rvykydal>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: high Docs Contact:
Priority: medium    
Version: 9.2CC: jkonecny, sbarcomb
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: anaconda-34.25.2.9-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1940919 Environment:
Last Closed: 2023-05-09 07:35:42 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:
Bug Depends On: 2153361    
Bug Blocks:    

Description Jan Stodola 2022-10-07 16:34:35 UTC
RHEL-9 fix needed as well.


+++ This bug was initially created as a clone of Bug #1940919 +++

Description of problem:

Upon boot, parse-kickstart parses the kickstart and searches for the first "network" stanza only. It then creates /tmp/ifcfg/ifcfg-* files. This works fine.
Additionally it generates an excerpt of cmdline, e.g. "bootdev=bond0 ip=...:bond0:...

Example:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
network  --hostname=vm-test8 --device=bond0 --mtu=1500 --bondslaves=enp1s0,enp2s0 --bondopts=mode=active-backup --bootproto=static --noipv6 --activate --ip=192.168.122.47 --netmask=255.255.255.0 --gateway=192.168.122.1
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Generated files by parse-kickstart:
 - /tmp/ifcfg/ifcfg-bond0
 - /tmp/ifcfg/ifcfg-bond0_slave_1
 - /tmp/ifcfg/ifcfg-bond0_slave_2

Generated stdout (then pushed to /etc/cmdline.d/80-kickstart.conf):
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
ip=192.168.122.47::192.168.122.1:255.255.255.0:vm-test8:bond0:none:1500 bootdev=bond0
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

This is then used by nm-initrd-generator to generate NM profiles.

Apparently nm-initrd-generator doesn't rely on /tmp/ifcfg/ifcfg-* files, but only the command line:

/usr/lib/nm-lib.sh:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
[...]
    /usr/libexec/nm-initrd-generator -- $(getcmdline)
[...]
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

From above, we can see that the generated stdout is broken and lacks the full definition of the bond, which causes an infinite hang to happen (well not exactly infinite, but almost):
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
[    7.369943] IPv6: ADDRCONF(NETDEV_UP): enp1s0: link is not ready
[    7.370838] 8021q: adding VLAN 0 to HW filter on device enp1s0
[    7.373143] IPv6: ADDRCONF(NETDEV_UP): enp2s0: link is not ready
[    7.373987] 8021q: adding VLAN 0 to HW filter on device enp2s0
---> nothing then
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

There are 2 solutions for this:
1. Generate the appropriate cmdline
or
2. Generate files in /etc/sysconfig/network-scripts (this works, but I fear this will collide with initial boot parameters, if any)


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

dracut-049-95.git20200804.el8


How reproducible:

Always

Steps to Reproduce: Boot with a kickstart hosted on a minimal DVD (don't setup the network initiallyà

1. Create a minimal DVD stub

  # mkdir rhel83.minimal && cd rhel83.minimal
  # cp -r /var/www/html/rhel83/{EFI,images,isolinux} .

2. Create a minimal kickstart

  # cat > ks.cfg << EOF
  url --url http://192.168.122.1/rhel83
  network  --hostname=vm-test8 --device=bond0 --mtu=1500 --bondslaves=enp1s0,enp2s0 --bondopts=mode=active-backup --bootproto=static --noipv6 --activate --ip=192.168.122.47 --netmask=255.255.255.0 --gateway=192.168.122.1
  EOF

3. Build the minimal DVD

  # mkisofs -o /tmp/rhel83.minimal.iso -b isolinux/isolinux.bin -J -R -l -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot -graft-points -V "RHEL-8-3-0-BaseOS-x86_64" .

4. Boot a VM with 2 NICs (enp1s0, enp2s0) and append "inst.ks=cdrom:/ks.cfg" to kernel command line


Actual results:

Hang before switching root, no way to get a dracut shell.


Expected results:

Network configuration and installation continues.

--- Additional comment from Beniamino Galvani on 2021-04-15 15:45:55 CEST ---

> There are 2 solutions for this:
> 1. Generate the appropriate cmdline
> or
> 2. Generate files in /etc/sysconfig/network-scripts (this works, but I fear this will collide with initial boot parameters, if any)

I think parse-kickstart should generate a kernel command line with all the networking parameters.

Options --bondslaves= and --bondopts= can be represented by a command line:

  bond=<bondname>[:<bondslaves>:[:<options>[:<mtu>]]]

Radek, do you think this is feasible?

--- Additional comment from Radek Vykydal on 2021-04-16 16:31:28 CEST ---

(In reply to Beniamino Galvani from comment #1)
> > There are 2 solutions for this:
> > 1. Generate the appropriate cmdline
> > or
> > 2. Generate files in /etc/sysconfig/network-scripts (this works, but I fear this will collide with initial boot parameters, if any)
> 
> I think parse-kickstart should generate a kernel command line with all the
> networking parameters.
> 
> Options --bondslaves= and --bondopts= can be represented by a command line:
> 
>   bond=<bondname>[:<bondslaves>:[:<options>[:<mtu>]]]
> 
> Radek, do you think this is feasible?

Yes, this should work, upstream PR:
https://github.com/rhinstaller/anaconda/pull/3296

Comment 2 Radek Vykydal 2022-11-02 10:21:38 UTC
https://github.com/rhinstaller/anaconda/pull/4412

Comment 8 Jan Stodola 2023-02-16 15:18:05 UTC
Should be fixed together with bug 2153361 in anaconda-34.25.2.3-1.el9, updating the bug.

Comment 9 Jan Stodola 2023-02-20 15:00:50 UTC
Reproduced on RHEL-9.2.0-20230220.9 with anaconda-34.25.2.8-1.el9 (due to bug 2153361).

Verified using anaconda-34.25.2.9-1.el9, the installation started successfully with the bond device specified in the kickstart file configured. The installation finished successfully and the bond device was usable on the installed system.

Marking as Verified:Tested

Comment 13 Jan Stodola 2023-02-23 14:49:07 UTC
Checked that anaconda-34.25.2.9-1.el9 is in nightly compose RHEL-9.2.0-20230223.23

Moving to VERIFIED

Comment 15 errata-xmlrpc 2023-05-09 07:35:42 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 (anaconda bug fix and enhancement update), 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/RHBA-2023:2223