This message was deleted.
# harvester
a
This message was deleted.
a
Assume you have only 1 nic on all your NODEs, this nic is used as management-network by default You can create Cluster network and vm network to share this nic; but don't change the IP in Harvester HOST directly.
s
This is a separate NIC from the management NIC. So you're saying it shouldn't matter and I should be able to assign IPs to a NIC that is also being used for a Cluster network.
I'll keep troubleshooting things further. Maybe something is going on with the physical network at this point, but I'm not sure why the IPs I had assigned got stripped from the NICs at some point. Should adding an IP via
ip 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.
a
Harvester HOST NODE IP or VM IP or ?
if you can diagram your current networking setting, we can have better understanding
normally, you do not need to touch any setting of Harvester NODE from Linux shell, you can do some configuration from Harvester WebUI; if not, then it's kind of Harvester BUG or infrastructure error/mis-config
t
Harvester doesn't have a way to assign an IP to a NIC other than the management node IP. You also can't use the /oem directory to assign an IP to the NIC because Harvester creates a bond and bridge using the NIC which makes any directly-assigned IP not work. I am in a similar situation where I need an IP on an interface which is also being used by Harvester for VMs and I had to come up with a script to watch for Harvester's startup to complete and then bring the IP up on the bridge that Harvester creates. Harvester is fine with that and doesn't mess with the IP. It would be nice if it was supported through the UI, but I haven't got around to adding an enhancement request. In my case, I also needed the IP to be up before Harvester startup, so my /oem YAML setup and script actually bring the IP up on the NIC itself and then move it to the bridge once the bridge is created by Harvester.
s
@ancient-pizza-13099 I’m trying to assign the IP to the HOST NODE to be used for backups. Our backup targets are on a separate network. I also need access to that same network from within VMs as well, so I have needed to create a Cluster/VM Network on the same NIC. I can add an additional NIC if necessary, was just hoping to use the same NIC. I’m going to try what @thousands-action-31843 is suggesting and assign it to the bridge.
@thousands-action-31843 Would you mind sharing the script you wrote to configure an IP on a bridge after it gets set up?
t
I can't post the whole script, but here are the relevant portions. It basically waits until Harvester brings up the bridge for the cluster network and once the bridge is up, it uses 'ip' to add an address.
Copy code
###########################################################
# /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
s
Thank you. Very helpful!