Bug 1966944

Summary: changing a veth peer name, the old peer is removed but the new one is unmanaged
Product: Red Hat Enterprise Linux 9 Reporter: Mingyu Shi <mshi>
Component: nmstateAssignee: Fernando F. Mancera <ferferna>
Status: CLOSED ERRATA QA Contact: Mingyu Shi <mshi>
Severity: low Docs Contact:
Priority: medium    
Version: 9.2CC: ferferna, jiji, jishi, network-qe, sfaye, till
Target Milestone: betaKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: nmstate-2.2.1-1.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-09 07:30:59 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:
Attachments:
Description Flags
log none

Description Mingyu Shi 2021-06-02 08:12:30 UTC
Created attachment 1788638 [details]
log

Description of problem:
When creating a veth pair with nmstate, the local and the peer ifaces are both managed(even though you haven't explicitly listed the peer iface under `interfaces` key). But when changing the peer's name, the old peer is removed, while the new one is unmanaged.

Version-Release number of selected component (if applicable):
nmstate-1.1.0-0.1.el8.noarch
nispor-1.1.0-1.el8.x86_64
NetworkManager-1.32.0-0.4.el8.x86_64

How reproducible:
100%

Steps to Reproduce:
# At creation, both veth0 and veth0_ep are managed
echo "interfaces:
- name: veth0
  type: veth
  state: up
  veth:
    peer: veth0_ep" | nmstatectl apply -

# At changing, newpeer is created, unmanged
echo "interfaces:
- name: veth0
  type: veth
  state: up
  veth:
    peer: newpeer" | nmstatectl apply -
nmcli con
nmcli dev

# This is exactly same with the 1st step, but veth0_ep is managed
echo "interfaces:
- name: veth0
  type: veth
  state: up
  veth:
    peer: veth0_ep" | nmstatectl apply -
nmcli con
nmcli dev

Actual results:
The old peer is removed while the new one is unmanaged

Expected results:
IMHO:
1. Once created, the peer is not allowed to change
or
2. The peer can be changed and make the new one controlled automatically
or
3. Like #bz1932247 , in anytime, user should explicitly list peer iface under `interfaces` key, otherwise it won't been managed. It's not convenient but gives a consistent experience.

Additional info:

Comment 8 Mingyu Shi 2022-11-30 03:04:44 UTC
Verified with:
nmstate-2.2.1-1.el9.x86_64
NetworkManager-1.41.4-2.el9.x86_64
Linux dell-per740-80.rhts.eng.pek2.redhat.com 5.14.0-197.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 16 14:31:27 EST 2022 x86_64 x86_64 x86_64 GNU/Linux
DISTRO=RHEL-9.2.0-20221118.4

Nmstate removes the old veth pair, creates a new one and managed.

Comment 10 errata-xmlrpc 2023-05-09 07:30:59 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-2023:2190