How to define a persistent HSCI interface in Ubuntu 22.04

  1. Remove external/OSA and HiperSockets (HS) devices from the ignore list.

    $ cio_ignore -r 0.0.8000-0.0.8002
    $ cio_ignore -r 0.0.b000-0.0.b002
  2. Enable Layer2 for HS device and activate both devices.

    $ chzdev -e 0.0.8000 layer2=1
    $ chzdev -e 0.0.b000 vnicc/flooding=1 vnicc/mcast_flooding=1

    Create netplan entries for all devices - HiperSockets, OSA and HSCI.

    $/etc/netplan/10-enc8000-config.yaml
    network:
      ethernets:
        enc8000:
          dhcp4: false
          dhcp6: false
      version: 2
    $ /etc/netplan/11-encb000-config.yaml
    network:
      ethernets:
        encb000:
          dhcp4: false
          dhcp6: false
      version: 2
    $ /etc/netplan/99-hsci8000-config.yaml
    network:
      ethernets:
        hsci8000:
          addresses:
          - 10.30.83.24/16
          dhcp4: false
          dhcp6: false
      version: 2

    This hsci yaml file defines the network configuration for the hsci8000 device, which is generated at every (re)boot.
  3. Check the new network configuration under /etc/netplan.

    $ ls -1 /etc/netplan
      00-installer-config.yaml
      10-enc8000-config.yaml
      11-encb000-config.yaml
      99-hsci8000-config.yaml
  4. Apply the new created network configuration.

    $ netplan apply
  5. Persist HSCI using networkd-dispatcher.


    networkd-dispatcher is the counterpart to the nm-dispatcher of the NetworkManager and runs shell scripts in /etc/networkd-dispatcher/ (and /usr/lib/networkd-dispatcher/). There are subdirectories, which correspond to the possible states of the network interfaces and the scripts stored in these subdirectories run depending on the status of the interface.
    1. networkd-dispatcher states: https://wiki.ubuntuusers.de/systemd/networkd-dispatcher/.

    2. Create the 100-hsci8000-mm-setup_ubuntu22.04+.sh-script in /etc/networkd-dispatcher/degraded.d/.

      You don’t need to create the HSCI interface manually. Simply add the following script 100-hsci8000-mm-setup_ubuntu22.04+.sh and reboot the system.

      HSCI information
      $ which hsci
        /usr/sbin/hsci
      $ hsci --version
        hsci utility: version 2.20.0-build-20220413
        Copyright IBM Corp. 2020
      Do not forget to change interface names in the script to match your real interface names.
#!/usr/bin/env bash

HS_DEV=enc8000
EXT_DEV=encb000
HSCI_DEV=hsci8000

TMPFILE=/tmp/networkd-dispatcher-results
echo "$IFACE is in STATE: $STATE" >> $TMPFILE

################################################################################
# Check if HSCI already exists

if [[ $(ip link show $HSCI_DEV | grep UP | wc -l) -eq 1 ]]; then
        logger "hsci-networkd-dispatcher $0: $HSCI_DEV is already in STATE: UP and running. \
                Exit script here!"
exit 0 fi ################################################################################ # Check, # if received device is a HS bridgport # if the other HSCI bridgport (OSA) is UP # Then run "hsci add ..." if [[ $IFACE == $HS_DEV ]] && [[ $(ip link show $EXT_DEV | grep UP | wc -l) -eq 1 ]]; then logger "hsci-networkd-dispatcher $0: $IFACE matched $HS_DEV, and $EXT_DEV is UP " /usr/sbin/hsci add $HS_DEV $EXT_DEV fi ################################################################################ # Check, # if received device is a OSA bridgport # if the other HSCI bridgport (HS) is UP # Then run "hsci add ..." if [[ $IFACE == $EXT_DEV ]] && [[ $(ip link show $HS_DEV | grep UP | wc -l) -eq 1 ]]; then logger "hsci-networkd-dispatcher $0: $IFACE matched $EXT_DEV, and $HS_DEV is UP " /usr/sbin/hsci add $HS_DEV $EXT_DEV fi

No comments:

Post a Comment

Popular Posts