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

Cannot delete network interface when altnames set

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

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • rhel-8.6.0
    • nmstate
    • None
    • None
    • None
    • rhel-net-mgmt
    • 2
    • 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 RHCOS node with Nmstate where ens1f0np0 currently has altname `existingaltname`,

      When a sysadmin applies a desired state that sets state: absent on ens1f0np0,

      Then the device transitions to down, the kernel no longer reports any alternative names for it, and ls /etc/systemd/network/98-nmstate-ens1f0np0.link returns exit code 1 because the file was removed.


      ( ) Integration test case is available upstream.


      ( ) Code is reviewed and merged upstream.


      ( ) Preliminary testing is done.


      ( ) Upstream documentation is written in the upstream MR.


      ( ) Release notes text is written in the RHEL issue.


      ( ) A demo is recorded

      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 RHCOS node with Nmstate where ens1f0np0 currently has altname `existingaltname`, When a sysadmin applies a desired state that sets state: absent on ens1f0np0, Then the device transitions to down, the kernel no longer reports any alternative names for it, and ls /etc/systemd/network/98-nmstate-ens1f0np0.link returns exit code 1 because the file was removed. ( ) Integration test case is available upstream. ( ) Code is reviewed and merged upstream. ( ) Preliminary testing is done. ( ) Upstream documentation is written in the upstream MR. ( ) Release notes text is written in the RHEL issue. ( ) A demo is recorded
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • None

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

      Delete (state:absent) a network interface with altnames set.

      What is the impact of this issue to you?

      Blocks CNF-18444

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

      nmstatectl-2.2.54

      How reproducible is this bug?:

      100%

      Steps to reproduce

      1. Configure network interface, including add altname
      apiVersion: nmstate.io/v1
      kind: NodeNetworkConfigurationPolicy
      metadata:
        name: altname-wo-identifier
      spec:
        nodeSelector:
          kubernetes.io/hostname: worker0
        desiredState:
          interfaces:
          - name: ens1f0np0
            state: up
            type: ethernet
            alt-names:
            - name: altnamewithoutidentifier
            ipv4:
              enabled: false
            ipv6:
              enabled: false 
      
      sh-5.1# ip addr show ens1f0np0
      4: ens1f0np0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
          link/ether b8:3f:d2:af:9a:84 brd ff:ff:ff:ff:ff:ff
          altname enp157s0f0np0
          altname altnamewithoutidentifier

      2. Delete network interface

      apiVersion: nmstate.io/v1
      kind: NodeNetworkConfigurationPolicy
      metadata:
        name: altname-wo-identifier
      spec:
        nodeSelector:
          kubernetes.io/hostname: worker0
        desiredState:
          interfaces:
          - name: ens1f0np0
            state: absent
            type: ethernet
            alt-names:
            - name: altnamewithoutidentifier
            ipv4:
              enabled: false
            ipv6:
              enabled: false 
      
      sh-5.1# ip addr show ens1f0np0
      4: ens1f0np0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
          link/ether b8:3f:d2:af:9a:84 brd ff:ff:ff:ff:ff:ff
          altname enp157s0f0np0
          altname altnamewithoutidentifier
          inet6 fe80::ba3f:d2ff:feaf:9a84/64 scope link noprefixroute
             valid_lft forever preferred_lft forever

      Expected results

      The network interface should have been deleted/unconfigured alongside with removing the added altname "altnamewithoutidentifier"

      Actual results

      No changes.

      Another scenario

      Another scenario that is not working as expected is setting `state:absent` to both altname and main interface:

      apiVersion: nmstate.io/v1
      kind: NodeNetworkConfigurationPolicy
      metadata:
        name: altname-wo-identifier
      spec:
        desiredState:
          interfaces:
          - alt-names:
            - name: existingaltname
              state: absent
            ipv4:
              enabled: false
            ipv6:
              enabled: false
            name: ens1f0np0
            state: absent
            type: ethernet
        nodeSelector:
          kubernetes.io/hostname: worker0 

      No changes whatsoever:

      4: ens1f0np0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
          link/ether b8:3f:d2:af:9a:84 brd ff:ff:ff:ff:ff:ff
          altname enp157s0f0np0
          altname existingaltname 

      The workaround is a 2-step process for users to remove interface and altname:

      • Step 1: remove altname only
      • Step 2: remove interface

              nm-team Network Management Team
              carlosgoncalves Carlos Goncalves
              Network Management Team Network Management Team
              Mingyu Shi Mingyu Shi
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated: