suse-edge / edge-image-builder

Tool for creating and configuring a set of images to automate the deployment of Edge environments
Apache License 2.0
39 stars 22 forks source link

Support installation of advanced network configuration #494

Closed pbronneberg closed 1 month ago

pbronneberg commented 1 month ago

Situation

At the moment, Edge Image Builder supports configuring network connections based on the new nmc format. This format supports basic settings to e.g. set static IP addresses, but is not yet feature equivalent to .nmconnection.

For our use-case, we e.g. create a bridge interface, set jumbo-frames, and connect our eth1 interface to the bridge (use-case for the bridge is to connect multiple physical networks to a container using multus-cni)

Current work-around

To work around this, we can create a custom combustion script, that copies .nmconnection files to a desired location. so that they are picked up at first boot. Given that, in our use-case, the network configuration of the 2nd physical network is identical for each device, we don't need node specific adaptations to our configuration.

Request

Example configuration we want to set

[connection]
id=br0
uuid={{bridge-uuid}}
type=bridge
interface-name=br0

[ethernet]
mtu=9000

[bridge]
stp=false

[ipv4]
address1={{bridge_network_address}}
method=manual

[ipv6]
addr-gen-mode=default
method=auto

[proxy]
[connection]
id=br0_eth1
uuid={{eth1-bridged-uuid}}
type=ethernet
interface-name=eth1
master=br0
slave-type=bridge

[ethernet]
mtu=9000

[bridge-port]
pbronneberg commented 1 month ago

Apparently, I missed an important bit in the documentation of nmc. Given that it is based on nmstate, it already supports advanced settings.

hardys commented 1 month ago

@pbronneberg as you mention nmc supports the https://nmstate.io/ API (other than the constraint that mac-address must be specified to match the configuration with the target host, except when using a unified configuration)

If there are specific gaps perhaps we can raise an upstream nmstate issue, otherwise can this issue now be closed?

pbronneberg commented 1 month ago

@hardys Indeed, Using nmstate solved it.

These are the steps I followed, to generate nmstate from my existing .nmconnection files.

Edge image builder nicely picked up the configuration, and after first boot my system had the desired network settings.

Issue can be closed!