Comment 8 for bug 1802322

OK, I can recreate.

The specific detail is that the bond macaddress matches one of the
physical interfaces and that the bond itself is down at the time of
the apply command.

# netplan apply --debug
WARK: matches: {'by-driver': {}, 'by-mac': {'00:16:3e:2c:4c:e5':
'eth0', '00:16:3e:c3:41:0a': 'eth1', '00:16:3e:b2:be:9a': 'eth2'}}
WARK: device lo operstate is unknown, not changing
WARK iface=bond1 link={'addr': '00:16:3e:c3:41:0a', 'broadcast':
'ff:ff:ff:ff:ff:ff'} mac=00:16:3e:c3:41:0a
WARK: device eth0 operstate is up, not changing
WARK iface=eth1 link={'addr': '00:16:3e:c3:41:0a', 'broadcast':
'ff:ff:ff:ff:ff:ff'} mac=00:16:3e:c3:41:0a
WARK interface=eth1 new_name=eth1
WARK iface=eth2 link={'addr': '00:16:3e:c3:41:0a', 'broadcast':
'ff:ff:ff:ff:ff:ff'} mac=00:16:3e:c3:41:0a
WARK process changes: {'bond1': {'name': 'eth1'}, 'eth2': {'name': 'eth1'}}
WARK: devices: ['lo', 'bond1', 'eth0', 'eth1', 'eth2']
WARK: changes: {'bond1': {'name': 'eth1'}, 'eth2': {'name': 'eth1'}}
Traceback (most recent call last):
  File "/usr/sbin/netplan", line 23, in <module>
  File "/usr/share/netplan/netplan/cli/", line 50, in main
  File "/usr/share/netplan/netplan/cli/", line 130, in run_command
  File "/usr/share/netplan/netplan/cli/commands/", line 43, in run
  File "/usr/share/netplan/netplan/cli/", line 130, in run_command
  File "/usr/share/netplan/netplan/cli/commands/", line 105,
in command_apply
  File "/usr/lib/python3.6/", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ip', 'link', 'set', 'dev',
'bond1', 'name', 'eth1']' returned non-zero exit status 2.

Two things here:

1) we shouldn't attempt to rename non-physical interfaces (lo and
bond1 can be skipped)
2) physical devices which are part of a bond should be skipped since
the mac changes

On Thu, Nov 8, 2018 at 10:35 AM Mihai Gheorghe
<email address hidden> wrote:
> # netplan --debug apply
> --
> You received this bug notification because you are subscribed to the bug
> report.
> Title:
> [regression] netplan apply is not idempotent and fails trying to
> rename a bond member interface
> To manage notifications about this bug go to: