Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-38998

[RHEL-10] pykickstart doesn't apply all options for "network" directive when the directive is specified in an included file

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • rhel-10.0.beta
    • rhel-10.0.beta
    • anaconda
    • None
    • anaconda-40.22.3.8-1.el10
    • None
    • Moderate
    • rhel-sst-installer
    • ssg_front_door
    • 22
    • 1
    • False
    • Hide

      None

      Show
      None
    • Yes
    • Red Hat Enterprise Linux
    • None
    • Bug Fix
    • Hide
      Cause (the user action or circumstances that trigger the bug):
      Application of kickstart configuration was moved from NetworkManager to Anaconda using NetworkManger API (previously only commands in %pre section were applied by Anaconda).
      Consequence (what the user experience is when the bug occurs):
      Option dhcpclass of kickstart network command was not applied by the installer.
      Fix (what has changed to fix the bug; do not include overly technical details):
      The application of the dhcpclass option in Anaconda via NetworkManager API was fixed.
      Result (what happens now that the patch is applied):
      The dhcpclass option defined in kickstart is now applied correctly.

      (doc text copied from RHEL-30406)
      Show
      Cause (the user action or circumstances that trigger the bug): Application of kickstart configuration was moved from NetworkManager to Anaconda using NetworkManger API (previously only commands in %pre section were applied by Anaconda). Consequence (what the user experience is when the bug occurs): Option dhcpclass of kickstart network command was not applied by the installer. Fix (what has changed to fix the bug; do not include overly technical details): The application of the dhcpclass option in Anaconda via NetworkManager API was fixed. Result (what happens now that the patch is applied): The dhcpclass option defined in kickstart is now applied correctly. (doc text copied from RHEL-30406 )
    • Proposed
    • None

      What were you trying to do that didn't work?

      A customer wants to use dhcpclass when requesting an IP address for installation.
      Initially he adds "inst.dhcpclass=RHEL" to the kernel command line, which works fine.
      Then in the kickstart he observed the following:

      • if "network" directive is directly written in the kickstart it works fine
        network ... --bootproto=dhcp --device=link --noipv6 --activate --dhcpclass=RHEL
      • however if "network" directive is added to an included file, dhcpclass is not taken into account
        %pre
        echo "network ... --bootproto=dhcp --device=link --noipv6 --activate --dhcpclass=RHEL" > /tmp/network.inc
        %end
        %include /tmp/network.inc

      I can reproduce the issue with both RHEL8.9 and RHEL9.3 DVD.

      Apparently when %include is specified, it's different code that evaluate the "network" directive, but I wasn't able to understand which code executes yet.

      For sure, I see a difference in network interface naming (independent of whether --dhcpclass is specified or not):

      • WITHOUT %include, interface is named System enp1s0:
        [anaconda root@localhost ~]# nmcli con show
        NAME              UUID                                  TYPE      DEVICE 
        System enp1s0     70af0392-783a-4e89-b104-d12a9c53f629  ethernet  enp1s0 
        Wired Connection  8b44ee13-ad17-4300-a16b-0f2ff06c3cb4  ethernet  --     
        [anaconda root@localhost ~]# nmcli con show "System enp1s0" | grep vendor
        ipv4.dhcp-vendor-class-identifier:      RHEL
      • WITH %include, interface is name enp1s0:
        [anaconda root@localhost ~]# nmcli con show
        NAME              UUID                                  TYPE      DEVICE 
        enp1s0            18e7ed12-f918-4e4b-976f-d364c2d035d4  ethernet  enp1s0 
        Wired Connection  76854734-08cf-41bb-b793-279fe041f4be  ethernet  --     
        [anaconda root@localhost ~]# nmcli con show enp1s0 | grep vendor
        ipv4.dhcp-vendor-class-identifier:      --

      This denotes different code handling for sure.

      Please provide the package NVR for which bug is seen:

      pykickstart 8.9 and 9.3

      How reproducible:

      Always

              rvykydal@redhat.com Radek Vykydal
              rhn-support-rmetrich Renaud Métrich
              anaconda-maint-list anaconda-maint-list
              Release Test Team Release Test Team
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: