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

nmstate nmpolicy capture MAC fails if interface down [rhel-9.7]

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

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Major Major
    • rhel-9.7
    • None
    • nmstate
    • None
    • nmstate-2.2.46-1.el9
    • No
    • Important
    • rhel-net-mgmt
    • ssg_networking
    • 1
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • Hide

      Definition of Done:

      Please mark each item below with ( / ) if completed or ( x ) if incomplete:

      ( ) The acceptance criteria defined below are met.

      Given a system administrator using Nmstate for automated OCP cluster deployment and defining an nmpolicy, 

      When they define an Nmspolicy  "capture" expression that selects interfaces by description and one or more matching interfaces are in a "down" state, 

      Then Nmstate must still retrieve necessary attributes like "name" and "mac-address" from system state and allow policy execution to proceed without error when attempting to resolve the capture expressions. 


      ( ) Code changes are included in a downstream build attached to an errata.


      ( ) All required testing (manual and/or automated) passes successfully.


      ( ) Related documentation updates (if applicable) have been completed.


      ( ) All necessary backports to the related RHEL streams (linked as 'relates' in this issue) have been completed and verified.

      Show
      Definition of Done: Please mark each item below with ( / ) if completed or ( x ) if incomplete: ( ) The acceptance criteria defined below are met. Given a system administrator using Nmstate for automated OCP cluster deployment and defining an nmpolicy,  When they define an Nmspolicy  "capture" expression that selects interfaces by description and one or more matching interfaces are in a "down" state,  Then Nmstate must still retrieve necessary attributes like "name" and "mac-address" from system state and allow policy execution to proceed without error when attempting to resolve the capture expressions.  ( ) Code changes are included in a downstream build attached to an errata. ( ) All required testing (manual and/or automated) passes successfully. ( ) Related documentation updates (if applicable) have been completed. ( ) All necessary backports to the related RHEL streams (linked as 'relates' in this issue) have been completed and verified.
    • Pass
    • Automated
    • Unspecified
    • Unspecified
    • Unspecified
    • None

      When using

      capture:
        primary-nic: interfaces.description == "primary"
        secondary-nic: interfaces.description == "secondary"
      

      The capture will fail if one of the links is down, NO-CARRIER

      We are using capture to select bonding NICs.

      The link is down to prevent duplicate DHCP addresses.

      This is a common case when using DHCP with bonding, because each of the bond slaves will get DHCP before the bond is created.

      We need to be able to create the bond even if a link is down.

          Message:               failure generating desiredState and capturedStates: failed to generate state, err: failed expanding desired state: failed to resolve capture entry path expression: failed walking path: invalid path: step not found at map state map[]
      | capture.secondary-nic.interfaces.0.name
      

      Full nmstate

      capture:
        primary-nic: interfaces.description == "primary"
        secondary-nic: interfaces.description == "secondary"
      desiredState:
        interfaces:
        - name: brcnv
          type: ovs-interface
          state: up
          mac-address: "{{ capture.primary-nic.interfaces.0.mac-address }}"
          ipv4:
            enabled: true
            dhcp: true
        - name: brcnv
          type: ovs-bridge
          state: up
          bridge:
            options:
              stp: false
              mcast-snooping-enable: false
              rstp: false
            port:
            - name: bond0
              link-aggregation:
                mode: balance-slb
                port:
                - name: "{{ capture.primary-nic.interfaces.0.name }}"
                - name: "{{ capture.secondary-nic.interfaces.0.name }}"
            - name: brcnv
      
      
      /etc/NetworkManager/system-connections/ethernet-enx30d0425666c9-8544.nmconnection:nmstate.interface.description=primary
      /etc/NetworkManager/system-connections/ethernet-enx30d0425666ca-25984.nmconnection:nmstate.interface.description=secondary
      

      nmstate 2.2.33. OCP 4.15

              rh-ee-sfaye Stanislas Faye
              rbrattai@redhat.com Ross Brattain
              Network Management Team Network Management Team
              Mingyu Shi Mingyu Shi
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: