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

Better handle creation when desired iface is in deactivated NM connection

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • rhel-9.5
    • nmstate
    • No
    • None
    • rhel-sst-network-management
    • ssg_networking
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • Hide

      Given a deactivated NM connection (e.g., br0 has a dependency vrf1 which no longer exists),

      When a user applies a new configuration using nmstate to create br0,

      Then nmstate should successfully override the deactivated connection and create br0 with the new configuration.

      Definition of Done:

      • The implementation meets the acceptance criteria
      • Integration tests are written and pass 
      • The code is part of a downstream build attached to an errata
      Show
      Given a deactivated NM connection (e.g., br0 has a dependency vrf1 which no longer exists), When a user applies a new configuration using nmstate to create br0, Then nmstate should successfully override the deactivated connection and create br0 with the new configuration. Definition of Done: The implementation meets the acceptance criteria Integration tests are written and pass  The code is part of a downstream build attached to an errata
    • None
    • None
    • None

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

      In a sequence of tests, the previous test failed (https://issues.redhat.com/browse/RHEL-19816) with some orphan NM connections unexpected leaving there.

      In a later test, nmstate is creating br0 which is in the deactivated NM connection. Instead of directly creating, nmstate tries to activate the NM connection and align/merge with the desired state. Since certain conditions don't exist anymore (in this case, br0 connection has a controller vrf1, which doesn't exist), nmstate fails.

      Though as a tester I can solve it with some failover in the test, IMHO, the error message is not clear enough, an inexperienced user may not know what is happening and has no clear insight to check NM connection.

      What is the impact of this issue to you?

      Please provide the package NVR for which the bug is seen:

      nmstate-2.2.38-1.el9.x86_64
      NetworkManager-1.51.4-1.el9.x86_64

      How reproducible is this bug?:

      100%

      Steps to reproduce

      This is a simplified reproducer:

      cat << EOF > br0-in-vrf1.yaml
      interfaces:
      - name: br0
        state: up
        type: linux-bridge
        bridge:
          options:
            stp:
              enabled: false
      - name: vrf1
        state: up
        type: vrf
        vrf:
          route-table-id: 100
          port:
          - br0
      EOF
      
      cat << EOF > br0-basic.yaml
      interfaces:
      - name: br0
        type: linux-bridge
        state: up
        bridge:
          port:
          - name: dummy0
      - name: dummy0
        state: up
        type: dummy
      EOF
      
      nmstatectl apply br0-in-vrf1.yaml
      nmcli con del vrf1 # this is a simplified step, it has the same result with https://issues.redhat.com/browse/RHEL-19816
      nmcli con # now br0 is orphan
      nmstatectl apply br0-basic.yaml
      

      Expected results

      In one nmstate transaction, maybe nmstate should override DEACTIVATED connections which already exists before "apply" (since in nmstate tool itself, user has no way to observe a deactivated connection, he or she doesn't know what configurations will be activated.), So nmstate can simply creates br0 with port dummy0
      If considered the compatibility in some cases, we should at least more clearly notify user to check the deactivated orphan connection.

      Actual results

      [2024-12-09T10:21:09Z INFO  nmstatectl] Nmstate version: 2.2.38
      Using 'set' is deprecated, use 'apply' instead.
      [2024-12-09T10:21:09Z INFO  nmstate::query_apply::net_state] Created checkpoint /org/freedesktop/NetworkManager/Checkpoint/18
      [2024-12-09T10:21:09Z INFO  nmstate::nm::profile] Skipping activation of dummy0 as its controller br0 will automatically activate it
      [2024-12-09T10:21:09Z INFO  nmstate::nm::query_apply::profile] Modifying connection UUID Some("13f44535-d4b6-441b-b06b-afc10a49cee0"), ID Some("br0"), type Some(Bridge) name Some("br0")
      [2024-12-09T10:21:09Z INFO  nmstate::nm::query_apply::profile] Creating connection UUID Some("c53099da-5b47-4217-809c-646d8687c4bf"), ID Some("dummy0"), type Some(Dummy) name Some("dummy0")
      [2024-12-09T10:21:09Z INFO  nmstate::nm::query_apply::profile] Got activation failure Bug: Manager(DependencyFailed): Can not find a controller for br0: Connection or device vrf1 not found
      [2024-12-09T10:21:09Z INFO  nmstate::nm::query_apply::profile] Will retry activation 2 seconds
      [2024-12-09T10:21:11Z INFO  nmstate::nm::query_apply::profile] Got activation failure Bug: Manager(DependencyFailed): Can not find a controller for br0: Connection or device vrf1 not found
      [2024-12-09T10:21:11Z INFO  nmstate::nm::query_apply::profile] Will retry activation 4 seconds
      [2024-12-09T10:21:15Z INFO  nmstate::nm::query_apply::profile] Got activation failure Bug: Manager(DependencyFailed): Can not find a controller for br0: Connection or device vrf1 not found
      [2024-12-09T10:21:15Z INFO  nmstate::nm::query_apply::profile] Will retry activation 8 seconds
      [2024-12-09T10:21:23Z INFO  nmstate::nm::query_apply::profile] Got activation failure Bug: Manager(DependencyFailed): Can not find a controller for br0: Connection or device vrf1 not found
      [2024-12-09T10:21:23Z INFO  nmstate::nm::query_apply::profile] Will retry activation 16 seconds
      [2024-12-09T10:21:39Z INFO  nmstate::nm::query_apply::profile] Got activation failure Bug: Manager(DependencyFailed): Can not find a controller for br0: Connection or device vrf1 not found
      [2024-12-09T10:21:39Z INFO  nmstate::nm::query_apply::profile] Will retry activation 32 seconds
      [2024-12-09T10:22:11Z INFO  nmstate::query_apply::net_state] Retrying on: Bug: Manager(DependencyFailed): Can not find a controller for br0: Connection or device vrf1 not found
      [2024-12-09T10:22:13Z INFO  nmstate::nm::query_apply::profile] Modifying connection UUID Some("13f44535-d4b6-441b-b06b-afc10a49cee0"), ID Some("br0"), type Some(Bridge) name Some("br0")
      [2024-12-09T10:22:13Z INFO  nmstate::nm::query_apply::profile] Modifying connection UUID Some("c53099da-5b47-4217-809c-646d8687c4bf"), ID Some("dummy0"), type Some(Dummy) name Some("dummy0")
      [2024-12-09T10:22:13Z INFO  nmstate::nm::query_apply::profile] Skip connection activation as its controller already activated its ports: c53099da-5b47-4217-809c-646d8687c4bf: dummy0/dummy
      [2024-12-09T10:22:13Z INFO  nmstate::nm::query_apply::profile] Got activation failure Bug: Manager(DependencyFailed): Can not find a controller for br0: Connection or device vrf1 not found
      [2024-12-09T10:22:13Z INFO  nmstate::nm::query_apply::profile] Will retry activation 2 seconds
      [2024-12-09T10:22:16Z INFO  nmstate::nm::query_apply::profile] Got activation failure Bug: Manager(DependencyFailed): Can not find a controller for br0: Connection or device vrf1 not found
      [2024-12-09T10:22:16Z INFO  nmstate::nm::query_apply::profile] Will retry activation 4 seconds
      [2024-12-09T10:22:20Z INFO  nmstate::nm::query_apply::profile] Got activation failure Bug: Manager(DependencyFailed): Can not find a controller for br0: Connection or device vrf1 not found
      [2024-12-09T10:22:20Z INFO  nmstate::nm::query_apply::profile] Will retry activation 8 seconds
      [2024-12-09T10:22:28Z INFO  nmstate::nm::query_apply::profile] Got activation failure Bug: Manager(DependencyFailed): Can not find a controller for br0: Connection or device vrf1 not found
      [2024-12-09T10:22:28Z INFO  nmstate::nm::query_apply::profile] Will retry activation 16 seconds
      [2024-12-09T10:22:44Z INFO  nmstate::nm::query_apply::profile] Got activation failure Bug: Manager(DependencyFailed): Can not find a controller for br0: Connection or device vrf1 not found
      [2024-12-09T10:22:44Z INFO  nmstate::nm::query_apply::profile] Will retry activation 32 seconds
      [2024-12-09T10:23:16Z INFO  nmstate::query_apply::net_state] Rollbacked to checkpoint /org/freedesktop/NetworkManager/Checkpoint/18
      NmstateError: Bug: Manager(DependencyFailed): Can not find a controller for br0: Connection or device vrf1 not found

       

              rh-ee-sfaye Stanislas Faye
              rh-ee-mshi1 Mingyu Shi
              Network Management Team Network Management Team
              Mingyu Shi Mingyu Shi
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated: