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

Network is not getting enabled when configuring a VLAN in %pre script and using %include directive

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • rhel-8.6.0
    • anaconda
    • None
    • Important
    • rhel-anaconda
    • ssg_front_door
    • 0
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • If docs needed, set a value
    • None
    • 57,005

      Description of problem:

      A customer boots a custom DVD of RHEL8.4 or 8.6 rebuilt to include a kickstart.
      The kickstart configures a VLAN in a %pre script, then makes use of %include directive, as shown below:
      -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
      %pre
      echo "network --hostname=vlantest" > /tmp/network-include
      echo "network --ip=10.31.102.169 --nameserver=10.218.128.140,10.201.119.225 --netmask=255.255.255.224 --gateway=10.31.102.161 --device=enp1s0 --vlanid=3700 --bootproto=static --activate" >> /tmp/network-include
      %end

      %include /tmp/network-include
      -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

      When using such directive, the network is configured but not automatically enabled.
      The customer then needs to use "nmcli con enp1s0.vlan3700 up" to bring up the network.

      Investigation showed that specifying directly the network configuration in the kickstart works, e.g.:
      -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
      network --hostname=vlantest
      network --ip=10.31.102.169 --nameserver=10.218.128.140,10.201.119.225 --netmask=255.255.255.224 --gateway=10.31.102.161 --device=enp1s0 --vlanid=3700 --bootproto=static --activate
      -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

      Also, not using a VLAN while configuring in %pre script works, e.g.:
      -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
      %pre
      echo "network --hostname=vlantest" > /tmp/network-include
      echo "network --ip=10.31.102.169 --nameserver=10.218.128.140,10.201.119.225 --netmask=255.255.255.224 --gateway=10.31.102.161 --device=enp1s0 --bootproto=static --activate" >> /tmp/network-include
      %end

      %include /tmp/network-include
      -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

      It's only problematic when %include points to a file containing network directives related to a vlan (initial configuration block).

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

      RHEL8.4 and later DVD, didn't try with older DVDs.

      How reproducible:

      Always

      Steps to Reproduce:
      1. Download the BOOT DVD and extract it

      1. mkdir rhel-8.6-x86_64-boot.iso.orig rhel-8.6-x86_64-boot.iso.fixed
      2. mount /tmp/rhel-8.6-x86_64-boot.iso rhel-8.6-x86_64-boot.iso.orig
      3. cp -avRf rhel-8.6-x86_64-boot.iso.orig/* rhel-8.6-x86_64-boot.iso.fixed/
      4. cd rhel-8.6-x86_64-boot.iso.fixed/

      2. Create a basic kickstart configuring a vlan through a %pre script

      1. vim ks.cfg
                    • 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
                      %pre
                      echo "network --hostname=vlantest" > /tmp/network-include
                      echo "network --ip=10.31.102.169 --nameserver=10.218.128.140,10.201.119.225 --netmask=255.255.255.224 --gateway=10.31.102.161 --device=enp1s0 --vlanid=3700 --bootproto=static --activate" >> /tmp/network-include
                      %end

      %include /tmp/network-include
      -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

      3. Add the kickstart to the kernel command line

      1. sed -i 's/linuxefi (.*)/linuxefi \1 inst.ks=cdrom:\/ks.cfg/g' EFI/BOOT/grub.cfg
      2. sed -i 's/append (.*)/append \1 inst.ks=cdrom:\/ks.cfg/g' isolinux/isolinux.cfg

      4. Rebuild the DVD

      1. mkisofs -o /tmp/rhel-8.6-x86_64-boot.iso.fixed -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-6-0-BaseOS-x86_64" .

      5. Boot the DVD

      Actual results:

      No network configured, but configuration present in "nmcli con show"

      Expected results:

      Network activated

              anaconda-maint-list anaconda-maint-list
              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:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: