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 2173992 - [Regression] Anaconda doesn't configure the network specified in a kickstart prior to executing %pre script
Summary: [Regression] Anaconda doesn't configure the network specified in a kickstart ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: doc-Release_Notes-9-en-US
Version: 9.1
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: 9.2
Assignee: Gabi Fialová
QA Contact: RHEL DPM
Sagar Dubewar
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-02-28 15:38 UTC by Renaud Métrich
Modified: 2024-01-03 13:45 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Known Issue
Doc Text:
.Kickstart installations fail to configure the network connection Anaconda performs the Kickstart network configuration only through the NetworkManager API. Anaconda processes the network configuration after the `%pre` Kickstart section. As a consequence, some tasks from the Kickstart `%pre` section are blocked. For example, downloading packages from the `%pre` section fails due to unavailability of the network configuration. To work around this problem: * Configure the network, for example using the `nmcli` tool, as a part of the `%pre` script. * Use the installer boot options to configure the network for the `%pre` script. As a result, it is possible to use the network for tasks in the `%pre` section and the Kickstart installation process completes.
Clone Of:
Environment:
Last Closed: 2023-05-11 08:06:41 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-150080 0 None None None 2023-02-28 15:39:27 UTC

Description Renaud Métrich 2023-02-28 15:38:50 UTC
Description of problem:

With RHEL9 DVD, booting a system on the DVD while specifying a kickstart (e.g. using a OEMDRV disk), shows that even though the kickstart contains a "network" directive, the network doesn't get configured prior to executing %pre script, causing it impossible to download kickstart "includes" for example.

Before switching root, we can see that "parse-kickstart" generates the /etc/cmdline.d/80-kickstart.conf snippet properly:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
switch_root:/# cat /etc/cmdline.d/80-kickstart.conf 
ip=192.168.0.250::192.168.0.1:255.255.255.0:test:enp1s0:none: nameserver=192.168.0.1 bootdev=enp1s0
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

After switching root, the network is configured, but after %pre executed, as shown with the kickstart below:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
network --noipv6 --bootproto static --ip 192.168.0.250 --netmask 255.255.255.0 --gateway 192.168.0.1 --nameserver 192.168.0.1 --device=enp1s0 --hostname=test

%pre --log=/tmp/ks-pre.log
echo HELLO
ip r
echo DONE
%end
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

%pre execution output:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
[anaconda root@localhost ~]# cat /tmp/ks-pre.log 
HELLO
DONE
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

After %pre execution, we have the network configured properly:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
[anaconda root@localhost ~]# ip r
default via 192.168.0.1 dev enp1s0 proto static metric 100 
192.168.0.0/24 dev enp1s0 proto kernel scope link src 192.168.0.250 metric 100 
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Additionally (and related somehow): if DHCP is present on the network, at time of %pre execution, we have an IP address, but this is an IP address delivered by the DHCP server, not what got specified as "network" directive!

This works fine on RHEL8. The main difference with RHEL8 is "ifcfg-xxx" snippets are not created anymore by parse-kickstart.

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

RHEL9/RHEL9.1

How reproducible:

Always

Steps to Reproduce:
1. Create a OEMDRV disk with kickstart above
2. Start the installation using the DVD

Actual results:

No IP address in %pre configured / Unexpected IP address if DHCP is on the network

Expected results:

IP address specified by "network" directive

Comment 1 Radek Vykydal 2023-03-01 09:49:28 UTC
The root cause of the issue is a change in RHEL 9: https://github.com/rhinstaller/anaconda/pull/2870
In RHEL 8 kickstart configuration was parsed into ifcfg files in dracut and after switch root NetworkManger (before %pre section in anaconda) applied the ifcfg configuration. Then the kickstart configuration was applied one more time in Anaconda via NM dbus API after %pre section (for the case of kickstart network configuration created in %pre section).
In RHEL 9 we apply kickstart configuration only in Anaconda via NM dbus API. Generating NM config files directly from kickstart configuration (as in RHEL 8) became unmaintainable, especially with NM now using keyfile format as new default. Also this approach required ugly hacks for ONBOOT setting.

The cause of the automatic DHCP configuration is this change in RHEL 9: https://bugzilla.redhat.com/show_bug.cgi?id=1978264. The automatic configuration should be disabled in case kickstart is used but this is determined by presence of inst.ks boot option which is not used in the OEMDRV case. (Note: we have added option to explicitly turn the DHCP autoconfigration off in Fedora/upstream: https://bugzilla.redhat.com/show_bug.cgi?id=2033231).

There is still one case where network is activated form kickstart early - in intitramfs/dracut. The case was fixed in RHEL 9.2 in https://bugzilla.redhat.com/show_bug.cgi?id=2153361. However this case is limited: network must not be activated via boot options; and installer image (stage2) is fetched from network location based on kickstart "url" command. Also it applies only the first network command.

Comment 3 Jiri Konecny 2023-03-16 10:36:34 UTC
After SST team discussion we decided to close this bug with documenting this behavior. As explained in comment 1 it is not a regression but impact of change done on purpose.

Switching to the documentation component so the bug could be closed after it's documented.

Comment 5 Radek Vykydal 2023-03-24 08:46:21 UTC
We should update the documentation: https://pykickstart.readthedocs.io/en/latest/kickstart-docs.html#chapter-4-pre-installation-script


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