Bug 1911397
| Summary: | cannot reapply route rules without priority | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Mingyu Shi <mshi> |
| Component: | nmstate | Assignee: | Gris Ge <fge> |
| Status: | CLOSED ERRATA | QA Contact: | Mingyu Shi <mshi> |
| Severity: | low | Docs Contact: | |
| Priority: | low | ||
| Version: | 8.4 | CC: | ferferna, jiji, jishi, network-qe, till |
| Target Milestone: | rc | Keywords: | Triaged |
| Target Release: | 8.4 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | nmstate-1.2.1-0.1.alpha1.el8 | Doc Type: | No Doc Update |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2022-05-10 13:34:46 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: | |||
This is fixed on nmstatectl-rust. Please verify this bug on nmstatectl-rust. Thank you! Verified with versions:
nmstate-1.2.1-0.2.alpha2.el8.x86_64
nispor-1.2.2-1.el8.x86_64
Notice it is only fixed in nmstate-rust:
[15:14:44@mshi860 ~]0# nmstatectl-rust set rules.yaml
---
dns: {}
rules:
config:
- ip-from: 8.8.8.8/24
ip-to: 200.1.1.1/24
route-table: 100
routes:
config:
- destination: 0.0.0.0/0
next-hop-interface: dummy0
next-hop-address: 100.1.1.254
table-id: 100
interfaces:
- name: dummy0
type: dummy
state: up
ipv4:
enabled: true
address:
- ip: 100.1.1.1
prefix-length: 24
ovs-db: {}
[15:14:50@mshi860 ~]0# ip rule
0: from all lookup local
30000: from 8.8.8.8/24 to 200.1.1.1/24 lookup 100
32766: from all lookup main
32767: from all lookup default
[15:14:52@mshi860 ~]0# nmstatectl-rust set rules.yaml
---
dns: {}
rules:
config:
- ip-from: 8.8.8.8/24
ip-to: 200.1.1.1/24
route-table: 100
routes:
config:
- destination: 0.0.0.0/0
next-hop-interface: dummy0
next-hop-address: 100.1.1.254
table-id: 100
interfaces:
- name: dummy0
type: dummy
state: up
ipv4:
enabled: true
address:
- ip: 100.1.1.1
prefix-length: 24
ovs-db: {}
[15:14:54@mshi860 ~]0# ip rule
0: from all lookup local
30000: from 8.8.8.8/24 to 200.1.1.1/24 lookup 100
32766: from all lookup main
32767: from all lookup default
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/RHEA-2022:1772 |
Description of problem: User can add a route rule without priority, after that, nmstate or NM will write the real priority into NM connection. When apply again, nmstate will regard it as another rule and cause a failure. Notice when priority not mentioned, NM automatically sets it to 30000. I think we can follow this process. Version-Release number of selected component (if applicable): nmstate-1.0.0-1.el8.noarch nispor-1.0.1-2.el8.x86_64 NetworkManager-1.30.0-0.5.el8.x86_64 How reproducible: 100% Steps to Reproduce: cat << EOF > rules.yaml routes: config: - destination: 0.0.0.0/0 next-hop-address: 100.1.1.254 next-hop-interface: dummy0 table-id: 100 route-rules: config: - ip-from: 8.8.8.8/24 ip-to: 200.1.1.1/24 route-table: 100 interfaces: - name: dummy0 type: dummy state: up ipv4: enabled: true address: - ip: 100.1.1.1 prefix-length: 24 EOF nmstatectl set rules.yaml # ok nmstatectl set rules.yaml # failed Actual results: Failed at second applying Expected results: No failure Additional info: Traceback (most recent call last): File "/usr/bin/nmstatectl", line 11, in <module> load_entry_point('nmstate==1.0.0', 'console_scripts', 'nmstatectl')() File "/usr/lib/python3.6/site-packages/nmstatectl/nmstatectl.py", line 70, in main return args.func(args) File "/usr/lib/python3.6/site-packages/nmstatectl/nmstatectl.py", line 280, in apply args.save_to_disk, File "/usr/lib/python3.6/site-packages/nmstatectl/nmstatectl.py", line 309, in apply_state save_to_disk=save_to_disk, File "/usr/lib/python3.6/site-packages/libnmstate/netapplier.py", line 71, in apply _apply_ifaces_state(plugins, net_state, verify_change, save_to_disk) File "/usr/lib/python3.6/site-packages/libnmstate/netapplier.py", line 115, in _apply_ifaces_state _verify_change(plugins, net_state) File "/usr/lib/python3.6/site-packages/libnmstate/netapplier.py", line 120, in _verify_change net_state.verify(current_state) File "/usr/lib/python3.6/site-packages/libnmstate/net_state.py", line 67, in verify self._route_rule.verify(current_state.get(RouteRule.KEY)) File "/usr/lib/python3.6/site-packages/libnmstate/route_rule.py", line 175, in verify {RouteRule.KEY: {RouteRule.CONFIG: cur_rule_info}}, libnmstate.error.NmstateVerificationError: desired ======= --- route-rules: config: - ip-from: 8.8.8.0/24 ip-to: 200.1.1.0/24 route-table: 100 - ip-from: 8.8.8.0/24 ip-to: 200.1.1.0/24 priority: 30000 route-table: 100 - ip-from: 9.9.9.0/24 ip-to: '' priority: 29999 route-table: 100 current ======= --- route-rules: config: - ip-from: 8.8.8.0/24 ip-to: 200.1.1.0/24 priority: 30000 route-table: 100 - ip-from: 9.9.9.0/24 ip-to: '' priority: 29999 route-table: 100 difference ========== --- desired +++ current @@ -1,9 +1,6 @@ --- route-rules: config: - - ip-from: 8.8.8.0/24 - ip-to: 200.1.1.0/24 - route-table: 100 - ip-from: 8.8.8.0/24 ip-to: 200.1.1.0/24 priority: 30000