Open xiachen-rh opened 1 month ago
I modified the network-config and set the value of interfaces under bridges same as "set-name" under ethernets , then the "duplicated" connections were gone and the bridges were up successfully.
network:
bridges:
baremetal:
addresses:
- fc00:1:1::2/64
interfaces:
- baremetal0
nameservers:
addresses:
- fc00:1:1::1
routes:
- on-link: true
to: ::/0
via: fc00:1:1::1
provisioning:
addresses:
- fc00:1:2::2/64
interfaces:
- provisioning0
routes: []
ethernets:
baremetalport:
match:
macaddress: 52:54:00:bd:8f:cb
set-name: baremetal0
provisioningport:
match:
macaddress: 52:54:00:25:ae:12
set-name: provisioning0
renderer: NetworkManager
version: 2
the result details of network configuration
[kni@provisioner ~]$ ls /sys/class/net/
baremetal baremetal0 lo provisioning provisioning0
[kni@provisioner ~]$ sudo su -
[root@provisioner ~]# for file in $(find /etc/sysconfig/network-scripts/ -type f -name "ifcfg-*"); do echo "#### FILE: $file"; cat $file; done
#### FILE: /etc/sysconfig/network-scripts/ifcfg-baremetal0
# Created by cloud-init automatically, do not edit.
#
AUTOCONNECT_PRIORITY=120
BOOTPROTO=none
BRIDGE=baremetal
DEVICE=baremetal0
HWADDR=52:54:00:bd:8f:cb
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
#### FILE: /etc/sysconfig/network-scripts/ifcfg-baremetal
# Created by cloud-init automatically, do not edit.
#
AUTOCONNECT_PRIORITY=120
BOOTPROTO=none
DEFROUTE=yes
DEVICE=baremetal
DNS1=fc00:1:1::1
IPV6ADDR=fc00:1:1::2/64
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6_DEFAULTGW=fc00:1:1::1
IPV6_FORCE_ACCEPT_RA=no
ONBOOT=yes
TYPE=Bridge
USERCTL=no
#### FILE: /etc/sysconfig/network-scripts/ifcfg-provisioning0
# Created by cloud-init automatically, do not edit.
#
AUTOCONNECT_PRIORITY=120
BOOTPROTO=none
BRIDGE=provisioning
DEVICE=provisioning0
HWADDR=52:54:00:25:ae:12
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
#### FILE: /etc/sysconfig/network-scripts/ifcfg-provisioning
# Created by cloud-init automatically, do not edit.
#
AUTOCONNECT_PRIORITY=120
BOOTPROTO=none
DEVICE=provisioning
IPV6ADDR=fc00:1:2::2/64
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6_FORCE_ACCEPT_RA=no
ONBOOT=yes
TYPE=Bridge
USERCTL=no
I reviewed the cloud-init document https://cloudinit.readthedocs.io/en/latest/reference/network-config-format-v2.html, it does not provide an example of interfaces under bridges and set-name under ethernets, so is it an issue of cloud-init or a configuration data problem?
cc: @TheRealFalcon @holmanb @blackboxsw
Ping on this ...
so is it an issue of cloud-init or a configuration data problem?
This is an issue. Cloud-init should work as you expect given the first configuration.
so is it an issue of cloud-init or a configuration data problem?
This is an issue. Cloud-init should work as you expect given the first configuration.
OK can we have a fix @TheRealFalcon ?
Yes, though I can't make any guarantees about timelines.
Bug report
Creating two bridges on top of two interfaces using Network-Config version 2 for cloud-init, but it seems that sysconfig creates "duplicated" ifcfg-* files and the bridge status is down. https://issues.redhat.com/browse/RHEL-38927
Environment details
How reproducible: 100%
Steps to reproduce the problem
Create a config drive ISO file with files: meta-data instance-id: local-hostname:
user-data
network-config
Command used to build config-drive ISO image: genisoimage -output config-drive.iso -volid CIDATA -joliet \ -rock user-data meta-data \ network-config
Create a VM in libvirt with two network interfaces, match MAC address of network-config. Boot the VM
Expected results The VM should boot and correctly configure the network interfaces and bridges.
Actual results In total 6 ifcfg-* file were created, but existence of these four files seems suspicious: /etc/sysconfig/network-scripts/ifcfg-provisioning0 /etc/sysconfig/network-scripts/ifcfg-provisioningport /etc/sysconfig/network-scripts/ifcfg-baremetal0 /etc/sysconfig/network-scripts/ifcfg-baremetalport Is set-name not being processed correctly by sysconfig renderer?
$ nmcli -f NAME,FILENAME c show NAME FILENAME
Bridge provisioning /etc/sysconfig/network-scripts/ifcfg-provisioning
System provisioning0 /etc/sysconfig/network-scripts/ifcfg-provisioning0
System provisioningport /etc/sysconfig/network-scripts/ifcfg-provisioningport
Bridge baremetal /etc/sysconfig/network-scripts/ifcfg-baremetal
lo /run/NetworkManager/system-connections/lo.nmconnection System baremetal0 /etc/sysconfig/network-scripts/ifcfg-baremetal0
System baremetalport /etc/sysconfig/network-scripts/ifcfg-baremetalport
cloud-init log
cloud-init.log