[Bug 2032824] Re: Veth pairs fail activation on Jammy

Lukas Märdian 2032824 at bugs.launchpad.net
Tue Dec 17 16:57:50 UTC 2024


I tested network-manager 1.36.6-0ubuntu2.1 from jammy-proposed and can
confirm things are working as expected.

root at j:~# apt -t jammy-proposed install network-manager
root at j:~# netplan set --origin-hint=50-cloud-init network.renderer=NetworkManager
root at j:~# netplan apply
WARNING:root:Cannot call Open vSwitch: ovsdb-server.service is not running.
root at j:~# nmcli con add type veth ifname veth0 peer veth1 ipv4.method disabled ipv6.method disabled
Connection 'veth-veth0' (e1c66088-b66b-405c-8c1f-10133aa06c16) successfully added.
root at j:~# nmcli con add type veth ifname veth1 peer veth0 ipv4.method disabled ipv6.method disabled
Connection 'veth-veth1' (aa65dd6b-d0aa-4091-a102-f641f510ea4f) successfully added.
root at j:~# netplan get
network:
  version: 2
  renderer: NetworkManager
  ethernets:
    enp5s0:
      dhcp4: true
root at j:~# nmcli c
NAME            UUID                                  TYPE      DEVICE 
netplan-enp5s0  e1419a5e-5e1d-3fff-a17c-b2fc6d2cef99  ethernet  enp5s0 
veth-veth0      e1c66088-b66b-405c-8c1f-10133aa06c16  veth      --     
veth-veth1      aa65dd6b-d0aa-4091-a102-f641f510ea4f  veth      --
root at j:~# nmcli c
NAME            UUID                                  TYPE      DEVICE 
netplan-enp5s0  e1419a5e-5e1d-3fff-a17c-b2fc6d2cef99  ethernet  enp5s0 
veth-veth0      e1c66088-b66b-405c-8c1f-10133aa06c16  veth      --     
veth-veth1      aa65dd6b-d0aa-4091-a102-f641f510ea4f  veth      --
root at j:~# reboot


$ lxc shell j
root at j:~# nmcli c
NAME            UUID                                  TYPE      DEVICE 
netplan-enp5s0  e1419a5e-5e1d-3fff-a17c-b2fc6d2cef99  ethernet  enp5s0 
veth-veth0      e1c66088-b66b-405c-8c1f-10133aa06c16  veth      veth0  
veth-veth1      aa65dd6b-d0aa-4091-a102-f641f510ea4f  veth      veth1
root at j:~# journalctl | grep veth | grep manager
Dec 17 16:51:46 j NetworkManager[2380]: <info>  [1734454306.5631] manager: (veth0): new Veth device (/org/freedesktop/NetworkManager/Devices/3)
Dec 17 16:51:46 j NetworkManager[2380]: <info>  [1734454306.5900] manager: (veth1): new Veth device (/org/freedesktop/NetworkManager/Devices/4)
Dec 17 16:54:31 j NetworkManager[432]: <info>  [1734454471.2093] manager: (veth1): new Veth device (/org/freedesktop/NetworkManager/Devices/3)
Dec 17 16:54:31 j NetworkManager[432]: <info>  [1734454471.2303] manager: (veth0): new Veth device (/org/freedesktop/NetworkManager/Devices/4)

=> veth0 and veth1 are activated and no error message in journal!

** Tags removed: foundations-todo verification-needed-jammy
** Tags added: verification-done-jammy

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/2032824

Title:
  Veth pairs fail activation on Jammy

Status in network-manager package in Ubuntu:
  Fix Released
Status in network-manager source package in Jammy:
  Fix Committed

Bug description:
  [ Impact ]

   * Network Manager 1.36 has a bug that prevents it to activate veth pairs.
   * The problem was found in the Netplan's CI with the new support for veths in Netplan v0.107.

   * We cherry-pick upstream patches to fix the issue:
  - https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/commit/4655b7c308461ae1f86d592ea6d45e00a2820423
  - https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/commit/07e0ab48d194b8bd6663a34887c2e753720ae4d3
  - https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/commit/50f738bde5b441b5ca52024c1a0998399b87337b

  [ Test Plan ]

   * Run netplan.io's autopkgtests against the new network-manager package and make sure it passes the veth tests, especially those two:
     - test_create_veth_pair (__main__.TestNetworkManager)
     - test_create_veth_pair_with_ip_address (__main__.TestNetworkManager)

   * In addition to that, reproduce the steps from this bug report:
  1) Launch a Jammy VM and install network-manager

  lxc launch  ubuntu:jammy jammy --vm
  lxc shell jammy
  apt -y install network-manager

  2) Set the default Netplan's renderer to NetworkManager so NM can
  manage interfaces (it will make Netplan create the file
  /var/run/NetworkManager/conf.d/10-globally-managed-devices.conf)

  netplan set --origin-hint=50-cloud-init network.renderer=NetworkManager
  netplan apply

  3) Create the veth pair

  nmcli con add type veth ifname veth0 peer veth1 ipv4.method disabled ipv6.method disabled
  nmcli con add type veth ifname veth1 peer veth0 ipv4.method disabled ipv6.method disabled

  4) Reboot

  5) Check with "nmcli con show" that the new connections were
  activated, and created in the system. Also, check the systemd journal
  and you should NOT see this error message:

  <error> [1692805758.9025] manager: (veth-veth0) couldn't create the
  device: Failed to create veth interface 'veth0' for 'veth-veth0':
  exists

  [ Where problems could occur ]

   * We're pulling upstream patchces to modify NetworkManager's
  src/core/devices/nm-device-veth.c file. This could have side-effects
  on veth functionality in general when NetworkManager is in use.

  [ Other Info ]

  * This issue appears to be fixed by this commit
  https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/commit/4655b7c308461ae1f86d592ea6d45e00a2820423

  * Danilo created a PPA with the fix here
  https://launchpad.net/~danilogondolfo/+archive/ubuntu/network-manager

  === Original bug report ===
  Network Manager 1.36 has a bug that prevents it to activate veth pairs. The problem was found in the Netplan's CI with the new support for veths in Netplan (because we run the tests on Jammy).

  How to reproduce the problem:

  1) Launch a Jammy VM and install network-manager

  lxc launch  ubuntu:jammy jammy --vm
  lxc shell jammy
  apt -y install network-manager

  2) Set the default Netplan's renderer to NetworkManager so NM can
  manage interfaces (it will make Netplan create the file
  /var/run/NetworkManager/conf.d/10-globally-managed-devices.conf)

  netplan set --origin-hint=50-cloud-init network.renderer=NetworkManager
  netplan apply

  3) Create the veth pair

  nmcli con add type veth ifname veth0 peer veth1 ipv4.method disabled ipv6.method disabled
  nmcli con add type veth ifname veth1 peer veth0 ipv4.method disabled ipv6.method disabled

  4) Reboot

  5) Check with "nmcli con show" that the new connections were not
  activated, even though both interfaces were created in the system.
  Also, check the systemd journal and you should see this error message:

  <error> [1692805758.9025] manager: (veth-veth0) couldn't create the
  device: Failed to create veth interface 'veth0' for 'veth-veth0':
  exists

  Try the very same steps on Lunar and you'll see that the connections
  will be activated just fine.

  This issue appears to be fixed by this commit
  https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/commit/4655b7c308461ae1f86d592ea6d45e00a2820423

  I created a PPA with the fix here
  https://launchpad.net/~danilogondolfo/+archive/ubuntu/network-manager

  If you run the same steps again on Jammy with this PPA you'll see it
  fixes this issue. In fact, Netplan's integration tests will work on
  Jammy using the PPA.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/2032824/+subscriptions




More information about the foundations-bugs mailing list