Bug 1929132
| Summary: | copy-mac-from failed when changing targeted subordinate port's mac at the same time in balance-alb/tlb mode | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Mingyu Shi <mshi> |
| Component: | nmstate | Assignee: | Gris Ge <fge> |
| Status: | CLOSED WONTFIX | QA Contact: | Mingyu Shi <mshi> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | low | ||
| Version: | 8.4 | CC: | bperkins, ferferna, fge, jiji, jishi, network-qe, till |
| Target Milestone: | rc | Keywords: | Triaged |
| Target Release: | 8.5 | Flags: | pm-rhel:
mirror+
|
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | No Doc Update | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2022-01-11 15:26:06 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: | |||
Hi Mingyu, Could you check whether this works for real NIC instead of veth or dummy? The use case of `copy-mac-from` is designed for pre-exist interface instead of creating them in the same transaction. Gris, I tried on physical interfaces, nmstate-1.2.0-0.1.alpha1.el8.noarch
Set bond0 with enp5s0f0 and enp5s0f1, copy mac from enp5s0f1 and change the mac of enp5s0f1 in one transaction.
nmstate prompted applied, however the mac of bond0 wasn't copied from the new mac of enp5s0f1:
[10:19:51@dell-per730-03 ~]0# nmcli d
DEVICE TYPE STATE CONNECTION
eno1 ethernet connected System eno1
eno2 ethernet disconnected --
eno3 ethernet disconnected --
eno4 ethernet disconnected --
enp5s0f0 ethernet disconnected --
enp5s0f1 ethernet disconnected --
lo loopback unmanaged --
[10:19:58@dell-per730-03 ~]0# code 1.yaml
[10:20:09@dell-per730-03 ~]0# nmstatectl set 1.yaml
/tmp/nmstatelog/2021-10-25-10:21:20-543135941.log
Desired state applied:
---
interfaces:
- name: bond0
type: bond
state: up
copy-mac-from: enp5s0f1
link-aggregation:
mode: balance-tlb
port:
- enp5s0f0
- enp5s0f1
- name: enp5s0f1
type: ethernet
state: up
mac-address: d4:ee:07:25:42:5a
/tmp/nmstatelog/2021-10-25-10:21:20-543135941.0.log nmstatectl set 1.yaml return 0
### changed enp5s0f1 to d4:ee:07:25:42:5a, while the bond0 was a0:36:9f:ab:36:b6
[10:21:23@dell-per730-03 ~]0# ip link show bond0
8: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether a0:36:9f:ab:36:b6 brd ff:ff:ff:ff:ff:ff
[10:21:35@dell-per730-03 ~]0# ip link show enp5s0f1
7: enp5s0f1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP mode DEFAULT group default qlen 1000
link/ether d4:ee:07:25:42:5a brd ff:ff:ff:ff:ff:ff permaddr a0:36:9f:ab:36:b6
[10:21:54@dell-per730-03 ~]0# ip link show enp5s0f0
6: enp5s0f0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP mode DEFAULT group default qlen 1000
link/ether a0:36:9f:ab:36:b6 brd ff:ff:ff:ff:ff:ff permaddr a0:36:9f:ab:36:b4
[10:22:01@dell-per730-03 ~]0# nmcli c
NAME UUID TYPE DEVICE
System eno1 e3c87730-fa85-4ac5-871c-90afef5f87d8 ethernet eno1
bond0 374cc3e8-9455-4f35-b8a7-26914cfc12c7 bond bond0
enp5s0f0 9913dc41-6d74-44a4-8230-a083fc8559e6 ethernet enp5s0f0
enp5s0f1 bd4d81b6-3946-4296-a26e-72e8021d4df7 ethernet enp5s0f1
As nmstate refers to both `permaddr` and `perm_hwaddr`, I did another test and found something tricky:
# I've changed the mac of physical eno4 to d4:ee:07:25:42:5a, while it has kept the original 44:a8:42:49:41:f7 as `permaddr`:
[10:40:15@dell-per730-03 ~]0# ip -d link show eno4
5: eno4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether d4:ee:07:25:42:5a brd ff:ff:ff:ff:ff:ff permaddr 44:a8:42:49:41:f7 promiscuity 0 minmtu 60 maxmtu 9000 addrgenmode none numtxqueues 5 numrxqueues 5 gso_max_size 65536 gso_max_segs 65535
[10:40:22@dell-per730-03 ~]0# cat 3.yml
interfaces:
- name: bond2
type: bond
state: up
copy-mac-from: eno4
link-aggregation:
mode: balance-rr
port:
- eno4
[10:40:26@dell-per730-03 ~]0# nmstatectl set 3.yml
/tmp/nmstatelog/2021-10-25-10:40:30-998687107.log
Desired state applied:
---
interfaces:
- name: bond2
type: bond
state: up
copy-mac-from: eno4
link-aggregation:
mode: balance-rr
port:
- eno4
/tmp/nmstatelog/2021-10-25-10:40:30-998687107.0.log nmstatectl set 3.yml return 0
# after copy-mac-from eno4, bond2 read the mac 44:a8:42:49:41:f7, which was the `permaddr` of eno4
[10:40:31@dell-per730-03 ~]0# ip -d link show bond2
16: bond2: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 44:a8:42:49:41:f7 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535
bond mode balance-rr miimon 100 updelay 0 downdelay 0 peer_notify_delay 0 use_carrier 1 arp_interval 0 arp_validate none arp_all_targets any primary_reselect always fail_over_mac none xmit_hash_policy layer2 resend_igmp 1 num_grat_arp 1 all_slaves_active 0 min_links 0 lp_interval 1 packets_per_slave 1 lacp_rate slow ad_select stable tlb_dynamic_lb 1 addrgenmode none numtxqueues 16 numrxqueues 16 gso_max_size 65536 gso_max_segs 65535
[10:40:40@dell-per730-03 ~]0# ip -d link show eno4
5: eno4: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond2 state UP mode DEFAULT group default qlen 1000
link/ether 44:a8:42:49:41:f7 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 60 maxmtu 9000
bond_slave state ACTIVE mii_status UP link_failure_count 0 perm_hwaddr d4:ee:07:25:42:5a queue_id 0 addrgenmode none numtxqueues 5 numrxqueues 5 gso_max_size 65536 gso_max_segs 65535
in this case, permaddr != perm_hwaddr. So, looks like for nmstate, there is no chance to copy mac from a user-defined-mac physical interface, nmstate will always copy `permaddr` when it exists.
Nmstate will always use permaddr when it exists. This is design choice to make sure nmstate is idempotent. I am closing this as won't fix as there is no customer case and it is low risk. Thank you for reporting this, please if you consider this issue is important, re-open it. |
Description of problem: When using balance-alb/tlb mode, it will fail if use copy-mac-from and modify targeted slave's mac in one transaction. 2 conditions: Version-Release number of selected component (if applicable): nmstate-1.0.2-0.3.el8.noarch nispor-1.0.1-3.el8.x86_64 NetworkManager-1.30.0-0.10.el8.x86_64 How reproducible: 100% Steps to Reproduce: ip link add dummy0 type dummy ip link add dummy1 type dummy echo "interfaces: - name: bond0 type: bond state: up copy-mac-from: dummy1 link-aggregation: mode: balance-tlb #or balance-alb port: - dummy0 - dummy1 - name: dummy1 state: up type: dummy mac-address: d4:ee:07:25:42:5a" | nmstatectl set - Actual results: failed Expected results: no failure Additional info: 1. copy-mac-from dummy0 and changing dummy0 work well, as dummy0 is in 1st order by name 2. to reproduce: dummy1 should be created before apply the above desired state(in contrast, using slave as 'type: veth' will always fail, whatever a veth slave was created first or created in one transaction)