During cloud-init init --local; the network configuration is rendered and brought up
bond0 is a virtual interface which uses the MAC from one of the slaves.
In cloud-init init (net) mode, we check if the interfaces are named properly;
When cloud-init collects the current_rename_info, it reads the MAC address of
each device listed in /sys/class/net; this includes *virtual* devices, like bonds/bridges
Then it looks up an interface name by MAC, however the bond and one of the interfaces
have the same value which results in cloud-init attempting to rename bond0
The solution is to not collect MACs of virtual interfaces for rename-purpose since
virtual devices do not ever get renamed; their name is defined by the config.
diff --git a/cloudinit/net/__init__.py b/cloudinit/net/__init__.py
index ea649cc..e2a50ad 100755
--- a/cloudinit/net/__init__.py
+++ b/cloudinit/net/__init__.py
@@ -14,6 +14,7 @@ from cloudinit import util
@@ -205,7 +206,11 @@ def _get_current_rename_info(check_downable=True):
"""Collect information necessary for rename_interfaces."""
names = get_devicelist()
bymac = {}
+ virtual = os.listdir(SYS_DEV_VIRT_NET)
for n in names:
+ # do not attempt to rename virtual interfaces
+ if n in virtual:
+ continue bymac[get_interface_mac(n)] = { 'name': n, 'up': is_up(n), 'downable': None}
1. Zesty amd64 gc81ea53- 0ubuntu1
2. cloud-init 0.7.9-47-
3. cloud-init boots with a bond network config and does not attempt to rename bond0
4. cloud-init init (net mode) fails when it attempts to rename a bond interface
Running with the following network config (2 nics)
bond_miimon: 100
bond_xmit_ hash_policy: layer3+4
netmask: 0.0.0.0
network: 0.0.0.0 78ff:1b: be76:4eff: fe06:96b3 ffff:ffff: :' 78ff:1b: :1
netmask: '::'
network: '::'
netmask: 255.240.0.0
network: 10.176.0.0
netmask: 255.240.0.0
network: 10.208.0.0
config:
- mac_address: bc:76:4e:06:96:b3
name: interface0
type: physical
- mac_address: bc:76:4e:04:88:41
name: interface1
type: physical
- bond_interfaces:
- interface0
- interface1
name: bond0
params:
bond_mode: 802.3ad
type: bond
- name: bond0.108
subnets:
- address: 65.61.151.38
netmask: 255.255.255.252
routes:
- gateway: 65.61.151.37
type: static
- address: 2001:4800:
netmask: 'ffff:ffff:
routes:
- gateway: 2001:4800:
type: static
type: vlan
vlan_id: '108'
vlan_link: bond0
- name: bond0.208
subnets:
- address: 10.184.225.122
netmask: 255.255.255.252
routes:
- gateway: 10.184.225.121
- gateway: 10.184.225.121
type: static
type: vlan
vlan_id: '208'
vlan_link: bond0
- address: 72.3.128.240
type: nameserver
- address: 72.3.128.241
type: nameserver
During cloud-init init --local; the network configuration is rendered and brought up
bond0 is a virtual interface which uses the MAC from one of the slaves.
In cloud-init init (net) mode, we check if the interfaces are named properly; rename_ info, it reads the MAC address of
When cloud-init collects the current_
each device listed in /sys/class/net; this includes *virtual* devices, like bonds/bridges
Then it looks up an interface name by MAC, however the bond and one of the interfaces
have the same value which results in cloud-init attempting to rename bond0
The solution is to not collect MACs of virtual interfaces for rename-purpose since
virtual devices do not ever get renamed; their name is defined by the config.
diff --git a/cloudinit/ net/__init_ _.py b/cloudinit/ net/__init_ _.py net/__init_ _.py net/__init_ _.py
index ea649cc..e2a50ad 100755
--- a/cloudinit/
+++ b/cloudinit/
@@ -14,6 +14,7 @@ from cloudinit import util
LOG = logging. getLogger( __name_ _) virtual/ net/" PRIMARY_ INTERFACE = 'eth0'
SYS_CLASS_NET = "/sys/class/net/"
+SYS_DEV_VIRT_NET = "/sys/devices/
DEFAULT_
@@ -205,7 +206,11 @@ def _get_current_ rename_ info(check_ downable= True): interfaces. """ SYS_DEV_ VIRT_NET)
bymac[ get_interface_ mac(n)] = {
' name': n, 'up': is_up(n), 'downable': None}
"""Collect information necessary for rename_
names = get_devicelist()
bymac = {}
+ virtual = os.listdir(
for n in names:
+ # do not attempt to rename virtual interfaces
+ if n in virtual:
+ continue
Log file of a failure: paste.ubuntu. com/24084999/
http://