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

pykickstart doesn't apply all options for "network" directive when the directive is specified in an included file

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Undefined Undefined
    • rhel-9.5
    • rhel-8.9.0, rhel-9.3.0
    • anaconda
    • None
    • anaconda-34.25.5.5-1.el9
    • None
    • Moderate
    • rhel-sst-installer
    • ssg_front_door
    • 14
    • 3
    • False
    • Hide

      None

      Show
      None
    • Yes
    • Red Hat Enterprise Linux
    • None
    • Bug Fix
    • Hide
      .The Kickstart installations now applies the `dhcpclass` option correctly

      The application of the kickstart configuration is moved from NetworkManager to Anaconda by using the NetworkManager API. Previously, Anaconda handled only commands specified in the `%pre` section. During installation, this change had caused omission of the `dhcpclass` option in the kickstart network command, which led to incorrect application of network configuration. With this update, the handling of the `dhcpclass` option in Anaconda by using the NetworkManager API has been corrected. As a result, the `dhcpclass` option defined in kickstart configurations is now properly applied during the installation process.
      Show
      .The Kickstart installations now applies the `dhcpclass` option correctly The application of the kickstart configuration is moved from NetworkManager to Anaconda by using the NetworkManager API. Previously, Anaconda handled only commands specified in the `%pre` section. During installation, this change had caused omission of the `dhcpclass` option in the kickstart network command, which led to incorrect application of network configuration. With this update, the handling of the `dhcpclass` option in Anaconda by using the NetworkManager API has been corrected. As a result, the `dhcpclass` option defined in kickstart configurations is now properly applied during the installation process.
    • Done
    • 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
              Radek Vykydal
              anaconda-maint-list anaconda-maint-list
              Release Test Team Release Test Team
              Sagar Dubewar Sagar Dubewar
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

                Created:
                Updated:
                Resolved: