We have recently added management of our 100Gb data network bonds for most hardware to our provision script, which we run just before deployment. This configures the machine in MAAS, so that cloud-init configures netplan accordingly. Some sample bash code which might be helpful:
INTERFACES=$(maas "$MAAS_USER" interfaces read "$SYSTEM_ID")
INTERFACE_SPEED=100000
DATA_IF_IDS=( $(echo "$INTERFACES" | jq -r ".[] | \
select(.interface_speed == $INTERFACE_SPEED and \
.link_connected == true).id") )
PARENTS=()
for PARENT in "${DATA_IF_IDS[@]}"; do
PARENTS+=( "parents=$PARENT" );
done
DATA_IF_ID=$(maas "$MAAS_USER" interfaces create-bond "$SYSTEM_ID" \
name=bond0 ${PARENTS[*]} bond_mode=802.3ad | jq -r .id)
We then create VLANs on the bond[1], then bridges on the VLAN with similar commands such as
IP_CONFIGURED=$(maas "$MAAS_USER" interface link-subnet "$SYSTEM_ID" \
"$BRIDGE_ID" subnet="$SUBNET_ID" mode=STATIC)
I’m happy to share more - this is just a snippet of the things in our script in case it’s of assistance.
HTH,
Greg.
[1] This only works if the fabric matches between VLAN and physical device - understandable but not always suitable for us. I don’t think an error is emitted when it fails, so I guess it might be a bug to follow up on at some stage. For now we simply don’t use this process for test & dev cluster machines, given that the devices are all on the prod fabric.