RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2082042 - Support custom value for IP field may-fail
Summary: Support custom value for IP field may-fail
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: nmstate
Version: 9.1
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Gris Ge
QA Contact: Mingyu Shi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-05 09:43 UTC by Quique Llorente
Modified: 2023-02-20 09:52 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-15 10:00:44 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github nmstate nmstate pull 1967 0 None open ip: Introduce `BaseInterface.wait_ip` property 2022-07-13 08:47:37 UTC
Github openshift/machine-config-operator/blob/48d88a7f75e97c87b2a6f4b00862a091fccbdd72/templates/common/_base/files/configure-ovs-network.yaml#L304 0 None None None 2022-05-05 09:43:37 UTC
Red Hat Issue Tracker NMT-310 0 None None None 2023-02-20 09:52:04 UTC
Red Hat Issue Tracker RHELPLAN-121130 0 None None None 2022-05-05 09:46:27 UTC
Red Hat Product Errata RHBA-2022:7991 0 None None None 2022-11-15 10:00:56 UTC

Description Quique Llorente 2022-05-05 09:43:38 UTC
Description of problem:

As part of migration MCO configure-ovs to nmstate the attribute "may-fail" need to be set if interfaces has already a address assigned [1]

[1] https://github.com/openshift/machine-config-operator/blob/48d88a7f75e97c87b2a6f4b00862a091fccbdd72/templates/common/_base/files/configure-ovs-network.yaml#L304


Version-Release number of selected component (if applicable):


How reproducible: Always


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:
User can set the "may-fail" attribute at thir ipv4/ipv6 field options.


Additional info:

Comment 1 Quique Llorente 2022-05-05 12:05:11 UTC
u/s patch https://github.com/nmstate/nmstate/pull/1892

Comment 2 Gris Ge 2022-05-05 13:55:59 UTC
It is unclear what this property related to network __state__ . This is determine NM specific action on activation only.

If we would add this into nmstate, we need use case why this is needed.

Comment 3 Quique Llorente 2022-05-06 07:50:24 UTC
The behaviour is the one specified here https://bugzilla.redhat.com/show_bug.cgi?id=2082042#c2, that script is creating a ovs-bridge on top of the primary nic doing a clone of mac address.

The enforced behaviour is specified here https://github.com/openshift/machine-config-operator/pull/2929

"When activating the br-ex connection, NM would return success if only
one of the address families got an IP. We should wait for both families
in the case of dualstack."

So is needed for this use case, don't know if we can make it implicit at nmstate somehow instead of make it explicit at the scheme.

Comment 4 Gris Ge 2022-05-18 13:45:23 UTC
I am considering to introduce a backend specific configurations allowing arbitrary setting to this interface.

For example:

```yml
---
interfaces:
  - name: eth1
    type: ethernet
    networkmanager:
      connection.id: WAN
      ipv4.may-fail: no
```

I am coding on a demo so that user can add/override any settings after nmstate.

Comment 5 Till Maas 2022-05-18 14:24:33 UTC
(In reply to Gris Ge from comment #4)

> ```yml
> ---
> interfaces:
>   - name: eth1
>     type: ethernet
>     networkmanager:
>       connection.id: WAN
>       ipv4.may-fail: no
> ```

Since we are discussing to improve the situation in NM, it seems wrong to me to expose the API that needs improvement, directly.
IMHO this feature also requires clarity on the user stories, use cases etc regarding profile failures. Then the possibilities that make sense should be exposed in a sensible way in Nmstate.

Comment 6 Gris Ge 2022-05-18 14:48:46 UTC
The user would block the network connection activation for DHCPv4 or v6 on next OS boot up not the time when he/she call `nmstatectl apply`.

This is a future behaviour of NetworkManager, not final backend-neutral desire network state .

Comment 7 Gris Ge 2022-05-18 14:49:40 UTC
Hi Quique,

I have created a demo PR: https://github.com/nmstate/nmstate/pull/1902 
Could you take a look to see whether it fit your needs?

Comment 8 Gris Ge 2022-05-18 14:51:38 UTC
Hi Till,

In above demo PR, the `connection.id` is also considered as NetworkManager specific terminology which is not share-understanding of other network backends (e.g. systemd-network, wicked, netplan).

Comment 9 Gris Ge 2022-06-07 08:03:59 UTC
Patch posted to upstream: https://github.com/nmstate/nmstate/pull/1902


Example yaml:

```yaml
---
interfaces:
  - name: eth1
    type: ethernet
    backend-specific:
      networkmanager:
        ipv4.may-fail: False
        ipv6.may-fail: False
    ipv4:
      enabled: true
      dhcp: true
    ipv6:
      enabled: true
      dhcp: true
      autoconf: true

```

Comment 10 Gris Ge 2022-07-13 08:47:37 UTC
New patch send to upstream: https://github.com/nmstate/nmstate/pull/1967



This is the example yaml to force NM wait on both IP stack:

```yaml
---
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
```

The possible `wait-ip` values are: any, ipv4, ipv6, ipv4+ipv6.

Comment 13 Mingyu Shi 2022-08-19 06:30:21 UTC
Verified with:
nmstate-2.1.3-1.el9.x86_64
NetworkManager-1.39.12-1.el9.x86_64

The value of `wait-ip`:
any  -->  both `ipv4.may-fail` and `ipv6.may-fail` in NM connection are set to yes
ipv4 -->  `ipv6.may-fail` is set to yes
ipv6 -->  `ipv4.may-fail` is set to yes
ipv4+ipv6 --> both `ipv4.may-fail` and `ipv6.may-fail` are set to no

Comment 15 errata-xmlrpc 2022-11-15 10:00:44 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-2022:7991


Note You need to log in before you can comment on or make changes to this bug.