Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 2044766

Summary: nmstate-rust cannot deal with same routes(only metric is different)
Product: Red Hat Enterprise Linux 8 Reporter: Mingyu Shi <mshi>
Component: nmstateAssignee: Gris Ge <fge>
Status: CLOSED DUPLICATE QA Contact: Mingyu Shi <mshi>
Severity: low Docs Contact:
Priority: low    
Version: 8.6CC: ferferna, jiji, jishi, network-qe, till
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: nmstate-1.3.1-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-07-27 07:56:02 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:

Description Mingyu Shi 2022-01-25 07:27:04 UTC
Description of problem:
According to this bug https://bugzilla.redhat.com/show_bug.cgi?id=1896934#c22
"if multiple same routes(only metric is different) are committed via nmstate, now only one route will be preserved(chosen randomly)"
nmstate(python) works fine, but this breaks in nmstate-rust

Version-Release number of selected component (if applicable):
nmstate-1.2.1-0.1.alpha1.el8.x86_64
nispor-1.2.3-1.el8.x86_64
NetworkManager-1.36.0-0.4.el8.x86_64

How reproducible:
100%

Steps to Reproduce:
cat << EOF > default_gateways.yaml
interfaces:
- name: dummy0
  type: dummy
  state: up
  ipv4:
    address:
    - ip: 192.0.2.251
      prefix-length: 24
    enabled: true
  ipv6:
    address:
    - ip: 192::251
      prefix-length: 64
    enabled: true
routes:
  config:
  - destination: 0.0.0.0/0
    next-hop-address: 192.0.2.1
    next-hop-interface: dummy0
    metric: 300
  - destination: 0.0.0.0/0
    next-hop-address: 192.0.2.1
    next-hop-interface: dummy0
    metric: 301
EOF
nmstatectl-rust apply default_gateways.yaml

Actual results:
[2022-01-25T07:25:35Z ERROR nmstate::route] VerificationError: Desired route RouteEntry { state: None, destination: Some("0.0.0.0/0"), next_hop_iface: Some("dummy0"), next_hop_addr: Some("192.0.2.1"), metric: Some(301), table_id: None } not found after apply
[2022-01-25T07:25:36Z ERROR nmstate::route] VerificationError: Desired route RouteEntry { state: None, destination: Some("0.0.0.0/0"), next_hop_iface: Some("dummy0"), next_hop_addr: Some("192.0.2.1"), metric: Some(301), table_id: None } not found after apply
[2022-01-25T07:25:37Z ERROR nmstate::route] VerificationError: Desired route RouteEntry { state: None, destination: Some("0.0.0.0/0"), next_hop_iface: Some("dummy0"), next_hop_addr: Some("192.0.2.1"), metric: Some(301), table_id: None } not found after apply
[2022-01-25T07:25:38Z ERROR nmstate::route] VerificationError: Desired route RouteEntry { state: None, destination: Some("0.0.0.0/0"), next_hop_iface: Some("dummy0"), next_hop_addr: Some("192.0.2.1"), metric: Some(301), table_id: None } not found after apply
[2022-01-25T07:25:39Z ERROR nmstate::route] VerificationError: Desired route RouteEntry { state: None, destination: Some("0.0.0.0/0"), next_hop_iface: Some("dummy0"), next_hop_addr: Some("192.0.2.1"), metric: Some(301), table_id: None } not found after apply
NmstateError: VerificationError: Desired route RouteEntry { state: None, destination: Some("0.0.0.0/0"), next_hop_iface: Some("dummy0"), next_hop_addr: Some("192.0.2.1"), metric: Some(301), table_id: None } not found after apply

Expected results:
PASS like in nmstate python, reserve one route

Additional info:

Comment 1 Gris Ge 2022-07-27 07:56:02 UTC
The rust API in RHEL 8 is just tech-preview.

But this has been fixed by the patch in bug 2094895

The fix is shipping at nmstate-1.3.1-1.el8

*** This bug has been marked as a duplicate of bug 2094895 ***