Bug 2001818

Summary: renaming veth device is not consistent
Product: Red Hat Enterprise Linux 8 Reporter: Vladimir Benes <vbenes>
Component: systemdAssignee: Michal Sekletar <msekleta>
Status: CLOSED WONTFIX QA Contact: Frantisek Sumsal <fsumsal>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.5CC: msekleta, systemd-maint-list
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-03-07 07:27:19 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 Vladimir Benes 2021-09-07 09:15:21 UTC
Description of problem:
I have an udev rule to have veth devices managed by NM 
    echo 'ENV{ID_NET_DRIVER}=="veth", ENV{INTERFACE}=="eth[0-9]|eth[0-9]*[0-9]", ENV{NM_UNMANAGED}="0"' >/etc/udev/rules.d/99-nm.rules
    udevadm control --reload-rules
    udevadm settle --timeout=5
    sleep 1

but then when I rename a device AND BACK the back doesn't happen and the device stays DOWN and unmanaged by NM


Version-Release number of selected component (if applicable):
systemd-239-50.el8.x86_64

How reproducible:
always

Steps to Reproduce:
reproducer seems to be this:
#/bin/bash

ip netns add namespace
ip link add eth11 type veth peer name eth11p
ip link set eth11p netns vethsetup

ip link set dev eth11 down
ip link set name ethZ eth11


sleep 1
ip link add eth11 type veth peer name eth11peer

sleep 1

ip link del eth11
ip link set dev ethZ down
ip link set name eth11 ethZ
ip link set dev eth11 up

systemctl stop NetworkManager

ip link set dev eth11 down
ip addr flush dev eth11

rm -rf /var/run/NetworkManager

sleep 1
systemctl restart NetworkManager


Actual results:
[root@n10 ~]# udevadm info -q property -x /sys/class/net/eth11
DEVPATH='/devices/virtual/net/ethZ'
ID_MM_CANDIDATE='1'
ID_NET_DRIVER='veth'
ID_NET_LINK_FILE='/usr/lib/systemd/network/99-default.link'
IFINDEX='428'
INTERFACE='ethZ'
NM_UNMANAGED='1'
SUBSYSTEM='net'
SYSTEMD_ALIAS='/sys/subsystem/net/devices/eth11 /sys/subsystem/net/devices/ethZ /sys/subsystem/net/devices/eth11'
TAGS=':systemd:'
UDEV_BIOSDEVNAME='0'
USEC_INITIALIZED='20677350359'
biosdevname='0'


Expected results:
[root@n10 ~]# udevadm info -q property -x /sys/class/net/eth11
DEVPATH='/devices/virtual/net/eth11'
ID_MM_CANDIDATE='1'
ID_NET_DRIVER='veth'
ID_NET_LINK_FILE='/usr/lib/systemd/network/99-default.link'
IFINDEX='428'
INTERFACE='eth11'
NM_UNMANAGED='1'
SUBSYSTEM='net'
SYSTEMD_ALIAS='/sys/subsystem/net/devices/eth11'
TAGS=':systemd:'
UDEV_BIOSDEVNAME='0'
USEC_INITIALIZED='20677350359'
biosdevname='0'


Additional info:

Comment 2 RHEL Program Management 2023-03-07 07:27:19 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.