Bug 2153522

Summary: Dual stack profiles do not set may-fail correctly
Product: Red Hat Enterprise Linux 8 Reporter: Ben Nemec <bnemec>
Component: nmstateAssignee: Gris Ge <fge>
Status: CLOSED ERRATA QA Contact: Mingyu Shi <mshi>
Severity: high Docs Contact:
Priority: medium    
Version: 8.6CC: dhaupt, dphillip, fbaudin, ferferna, jiji, jishi, kkarampo, network-qe, sfaye, till
Target Milestone: rcKeywords: Triaged, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: nmstate-1.4.2-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2170078 2170079 (view as bug list) Environment:
Last Closed: 2023-05-16 08:26:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2170078, 2170079    

Description Ben Nemec 2022-12-14 17:12:02 UTC
Description of problem: When an interface is set to have both ipv4 and ipv6 dynamic addresses the ipv4.may-fail and ipv6.may-fail attributes should also be set so the interface waits for both addresses before being considered up. Currently this is not happening, which can cause problems for components that wait on interface status and need both addresses to be configured.

This was initially reported in https://issues.redhat.com/browse/OCPBUGS-3394 but since I think it needs to be fixed in NMState I'm moving it to a bz.


Version-Release number of selected component (if applicable): Reported against OCP 4.12, so I believe it would be based on RHEL 8.6.


How reproducible: Always


Steps to Reproduce:
1. Generate connection profiles with ipv4 and ipv6 both enabled on an interface. For example,
interfaces:
- name: eno3
  type: ethernet
  state: up
  ipv4:
    enabled: true
    dhcp: true
  ipv6:
    enabled: true
    dhcp: true

Actual results:
[connection]
id=eno3
uuid=ea4b2498-c55e-49b2-96d4-81cd18c1088c
type=ethernet
interface-name=eno3

[ethernet]

[ipv4]
dhcp-timeout=2147483647
method=auto

[ipv6]
addr-gen-mode=eui64
dhcp-iaid=mac
dhcp-timeout=2147483647
method=dhcp
ra-timeout=2147483647

[proxy]


Expected results:
[connection]
id=eno3
uuid=ea4b2498-c55e-49b2-96d4-81cd18c1088c
type=ethernet
interface-name=eno3

[ethernet]

[ipv4]
dhcp-timeout=2147483647
method=auto
may-fail=no

[ipv6]
addr-gen-mode=eui64
dhcp-iaid=mac
dhcp-timeout=2147483647
method=dhcp
ra-timeout=2147483647
may-fail=no

[proxy]


Additional info:

Comment 1 Gris Ge 2023-01-09 03:16:47 UTC
Hi Ben Nemec,

We have it supported in RHEL 9.1+, For example:


```
[fge@c9s eth]$ cat wait_ip.yml 
---
interfaces:
  - name: eth1
    type: ethernet
    state: up
    mtu: 1500
    wait-ip: ipv4+ipv6
    ipv4:
      enabled: true
      dhcp: true
      auto-dns: true
      auto-gateway: true
      auto-routes: true
      auto-route-table-id: 0
    ipv6:
      enabled: true
      dhcp: true
      autoconf: true
      auto-dns: true
      auto-gateway: true
      auto-routes: true
      auto-route-table-id: 0
[fge@c9s eth]$ ncl gc wait_ip.yml
NetworkManager:
- - eth1.nmconnection
  - |
    [connection]
    autoconnect=true
    autoconnect-slaves=-1
    id=eth1
    interface-name=eth1
    type=802-3-ethernet
    uuid=0523c0a1-5f5e-5603-bcf2-68155d5d322e

    [ipv4]
    dhcp-client-id=mac
    dhcp-timeout=2147483647
    ignore-auto-dns=false
    ignore-auto-routes=false
    may-fail=false
    method=auto
    never-default=false
    route-table=0

    [ipv6]
    addr-gen-mode=0
    dhcp-duid=ll
    dhcp-iaid=mac
    dhcp-timeout=2147483647
    ignore-auto-dns=false
    ignore-auto-routes=false
    may-fail=false
    method=auto
    never-default=false
    ra-timeout=2147483647
    route-table=0

    [ethernet]
    mtu=1500
```

Do you need me to done the python code in RHEL 8.8?

Comment 2 Ben Nemec 2023-01-09 20:36:14 UTC
I don't believe we're planning to ship any releases on 8.8, so we don't need it there. The OCP release this was reported against is based on 8.6 so if it's possible to backport to that release it would be helpful to us. The severity of the original bug is only moderate, however, so if that's a big hassle we can probably wait until 4.13, although that may be based on 9.0, in which case we'd still be missing this fix.

Comment 3 Gris Ge 2023-01-19 13:22:51 UTC
Let me try to draft out the 8.6 patch to see big impact would it be.

Comment 7 Gris Ge 2023-02-07 16:41:10 UTC
Patch send to upstream: https://github.com/nmstate/nmstate/pull/2224

Comment 13 Mingyu Shi 2023-02-20 09:35:35 UTC
Verified with:
nmstate-1.4.2-1.el8.x86_64
nispor-1.2.10-1.el8.x86_64
NetworkManager-1.40.14-1.el8.x86_64
DISTRO=RHEL-8.8.0-20230217.30

Comment 15 errata-xmlrpc 2023-05-16 08:26:40 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (nmstate bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:2772