canonical / canonical/cloud-init

wrong HWADDR on interface when ethernet_mac_address is given on the bond

Open
#3,856 7 comments 0 reactions 0 assignees View on GitHub
bug launchpad
Dominant language
Python
Stars
3.8k
Forks
1.1k
Avg merge
2d 23h
Merged PRs (30d)
18

Description

This bug was originally filed in Launchpad as [LP: #1919045](https://bugs.launchpad.net/cloud-init/+bug/1919045)

Launchpad details

affected_projects = []

assignee = None
assignee_name = None
date_closed = None
date_created = 2021-03-13T21:52:47.007288+00:00
date_fix_committed = None
date_fix_released = None
id = 1919045
importance = undecided
is_complete = False
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1919045
milestone = None
owner = rigault-francois
owner_name = frigo
private = False
status = triaged
submitter = rigault-francois
submitter_name = frigo
tags = []
duplicates = []

_Launchpad user **frigo(rigault-francois)** wrote on 2021-03-13T21:52:47.007288+00:00_

creating a configuration for an active-backup bond:
```
cloud-init devel net-convert -p network_data.json -k network_data.json \
-d /tmp -D rhel -O sysconfig \
-m eno50,b2:35:4a:42:42:ed -m eno53,b2:35:4a:42:42:ee
```
with cloud-init (cloud-init-19.4-7.el7_9.3.x86_64, cloud-init-20.3-10.el8.noarch)
assuming there is a ethernet_mac_address defined on the bond:
```
    {
      "id": "bond0",
      "type": "bond",
      "ethernet_mac_address": "b2:35:4a:42:42:ed",
      "bond_mode": "active-backup"
      ...
```
we see cloud-init creates a file ifcfg-eno53 wrongly containing a HWADDR with the address of the bond.
For a bond, we expect both interfaces to display the same mac when running ip link (default behavior with fail_over_mac=0 bonding module parameter). However, the HWADDR in the ifcfg file must retain the original mac address of the interface, or the interface is not configured correctly. Practically, it is never configured as slave.

Workaround seems to just remove the "ethernet_mac_address" on the bond there (I originally added it because it is required according to https://github.com/openstack/nova/blob/master/doc/api_schemas/network_data.json, which I was using to validate my network_data file).

I would expect the ifcfg-eno53 mac address to not be impacted by the presence of ethernet_mac_address on the bond. For reference I attach my network_data.json if anyone wants to try.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.