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

NetworkManager to delete extra unused profiles created by dracut

    • sst_network_management
    • ssg_networking
    • False
    • Hide

      None

      Show
      None
    • No
    • Red Hat Enterprise Linux
    • Hide

      Given a system administrator has configured a system to use `clevis` and specified networking parameters at the dracut level via kernel command line,
      When the system boots and NetworkManager initiates,
      Then NetworkManager should automatically delete or hide all initrd-generated connection profiles that were not used during the boot process. This behavior should be enabled through a new option in `NetworkManager.conf`.

      Definition of Done:

      • The implementation meets the acceptance criteria
      • Unit test and integration test are written and pass
      • The code is part of a downstream build attached to an errata
      Show
      Given a system administrator has configured a system to use `clevis` and specified networking parameters at the dracut level via kernel command line, When the system boots and NetworkManager initiates, Then NetworkManager should automatically delete or hide all initrd-generated connection profiles that were not used during the boot process. This behavior should be enabled through a new option in `NetworkManager.conf`. Definition of Done : The implementation meets the acceptance criteria Unit test and integration test are written and pass The code is part of a downstream build attached to an errata
    • Unspecified Release Note Type - Unknown

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

      Customer is using  'clevis' with' Network Bound disk entryption' and passing below kernel command line parameter to enable networking at dracut level:

      ip=192.168.124.10::192.168.124.1:255.255.255.0::ens3:none:192.168.5.1:8.8.8.8"

       

      After reboot, we see two NM profiles created:

      1. nmcli co show
        NAME  UUID                                  TYPE      DEVICE 
        ens3  5046af43-bf4a-4518-8eae-bef1300d4b70  ethernet  ens3   
        ens3  ca12c4fa-bccc-449d-9e88-1cf09291e10c  ethernet  --     

       

      1. nmcli -f FILENAME,NAME c
        FILENAME                                                  NAME 
        /etc/sysconfig/network-scripts/ifcfg-ens3                 ens3  <----- active profile.
        /run/NetworkManager/system-connections/ens3.nmconnection  ens3  <--- unused

       

      Issue is similar to what's mentiond in https://bugzilla.redhat.com/show_bug.cgi?id=2093050.

      We followed below conf file to control this behaviour:

      1. cat /etc/NetworkManager/conf.d/disable_initrd_connectivity.conf
        [device]
        match-device=interface-name:ens3
        keep-configuration=no
        allowed-connections=except:origin:nm-initrd-generator

       

      Looks like its helping to control which profile to be active after switchroot.  But customer wishes to automatically remove the inactive profile after booting.

       

      Please provide the package NVR for which bug is seen:

      NetworkManager-tui-1.40.16-1.el8.x86_64

      NetworkManager-libnm-1.40.16-1.el8.x86_64
      NetworkManager-config-server-1.40.16-9.el8.noarch
      NetworkManager-1.40.16-1.el8.x86_64
      NetworkManager-team-1.40.16-1.el8.x86_64

      How reproducible:

      Always

      Steps to reproduce

      1. pass 'rd.neednet=1' as kernel command line and boot the system

      Expected results

      'nmcli co show' reports only a single profile  matching /etc/sysconfing/network-scripts/ifcfg-<dev-name>

      1. nmcli co show
        NAME              UUID                                  TYPE      DEVICE 
        ens3              5046af43-bf4a-4518-8eae-bef1300d4b70  ethernet  ens3   

        Actual results

      We see extra 'Wired Connection' profile which is not used.  Customer wish to delete such profiles automatically.

       

      1. nmcli co show
        NAME              UUID                                  TYPE      DEVICE 
        ens3              5046af43-bf4a-4518-8eae-bef1300d4b70  ethernet  ens3    <--- active
        Wired Connection  7c98b4fe-a829-4a3a-b35f-a746a07f8931  ethernet  --     

       

      1. cat /etc/sysconfig/network-scripts/ifcfg-ens3 
        NAME="ens3"
        DEVICE="ens3"
        ONBOOT=yes
        NETBOOT=yes
        UUID="5046af43-bf4a-4518-8eae-bef1300d4b70"
        BOOTPROTO=none
        IPADDR="192.168.124.11"
        NETMASK="255.255.255.0"
        GATEWAY="192.168.124.1"
        TYPE=Ethernet
        DNS1="192.168.5.1"
        DNS2="8.8.8.8"
      1. ip a
        1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
            link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
            inet 127.0.0.1/8 scope host lo
               valid_lft forever preferred_lft forever
            inet6 ::1/128 scope host 
               valid_lft forever preferred_lft forever
        2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
            link/ether 00:50:00:00:02:00 brd ff:ff:ff:ff:ff:ff
            altname enp0s3
            inet 192.168.124.11/24 brd 192.168.124.255 scope global noprefixroute ens3
               valid_lft forever preferred_lft forever
            inet6 fe80::250:ff:fe00:200/64 scope link 
               valid_lft forever preferred_lft forever

            rh-ee-sfaye Stanislas Faye
            rhn-support-surkumar Suresh Kumar
            Suresh Kumar
            Network Management Team Network Management Team
            Vladimir Benes Vladimir Benes
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: