adamant-kite-43734
10/05/2023, 9:38 PMancient-pizza-13099
10/06/2023, 6:54 AMancient-pizza-13099
10/06/2023, 6:55 AMswift-eve-48927
10/06/2023, 11:46 AMswift-eve-48927
10/06/2023, 12:01 PMip a add
stick through reboots, or do I need to add the IP another way? I didn't see anything mentioned in the docs about that.ancient-pizza-13099
10/06/2023, 1:40 PMancient-pizza-13099
10/06/2023, 1:41 PMancient-pizza-13099
10/06/2023, 1:47 PMthousands-action-31843
10/06/2023, 2:23 PMswift-eve-48927
10/09/2023, 8:27 PMswift-eve-48927
10/10/2023, 12:43 AMthousands-action-31843
10/10/2023, 3:32 PM###########################################################
# /oem/95_networking.yaml (name doesn't matter, 9*.yaml)
#
# This will bring up the IP before Harvester starts if you
# need it that early.
name: "enp2s0f1 network"
stages:
initramfs:
- files:
- path: /etc/sysconfig/network/ifcfg-enp2s0f1
permissions: 384
owner: 0
group: 0
content: |+
STARTMODE='onboot'
BOOTPROTO='static'
ETHERDEVICE=enp2s0f1
IPADDR=10.10.10.10/24
encoding: ""
ownerstring: ""
###########################################################
# This bash code needs to be run when the system starts. It
# could be run via a /oem YAML file or some other method.
# Cluster Network name used inside Harvester
CLUSTER_NETWORK=port-2
# The name of the bridge and bond that Harvester creates
BRIDGE=${CLUSTER_NETWORK}-br
BOND=${CLUSTER_NETWORK}-bo
# The physical interface the IP was originally running on
PHYSINTF=enp2s0f1
until [ -h /sys/class/net/${BRIDGE} ]
do
sleep 10
done
# Grab the IP out of the old config file. If not using one,
# harcode the IP here.
IPADDR=$(grep IPADDR /etc/sysconfig/network/ifcfg-${PHYSINTF} | cut -f2 -d= | sed -e "s/[^\.0-9\/]*//g")
# Force remove old IP from physical interface since it doesn't work
# once the bridge is created.
ip addr delete ${IPADDR} dev ${PHYSINTF}
# Remove wicked config file that was created by a /oem YAML file
rm /etc/sysconfig/network/ifcfg-${PHYSINTF}
# Tell wicked to stop managing the interface (it will stop when it
# doesn't see the config file)
wicked ifreload ${PHYSINTF}
# Manually start up the IP on the bridge. NOTE: this isn't
# guaranteed to stay up if you edit the cluster network inside
# Harvester, so you might want to have a monitor script to make
# sure the IP stays up.
ip addr add ${IPADDR} dev ${BRIDGE}
# Harvester creates a bond and a bridge, but the bond may have
# issues using the underlying physical port. I think I have seen this
# with tagged interfaces specifically so here we make sure the
# physical is part of the bond. Need to take the physical down to
# add it to the bond and then can re-up.
ip link set ${PHYSINTF} down
ip link set ${PHYSINTF} master ${BOND}
ip link set ${PHYSINTF} up
swift-eve-48927
10/10/2023, 5:16 PM