How to define a persistent HSCI interface in SLES15 SP4

These instructions apply to SLES15 SP4 or later!
  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
  3. Configure the network

    • via YaST.

      • For the hsi0 interface:

        • yast > YaST Control Center > System > Network Settings

        • Tab Overview > Select Hipersocket (0.0.8000) > Edit

        • Tab Address > Select (x) No Link and IP Setup (Bond Port)

        • Press Next

      • For the eth1 interface:

        • yast > YaST Control Center > System > Network Settings

        • Tab Overview > Select OSA Express Network card (0.0.b000) > Edit

        • Tab Address > Select (x) No Link and IP Setup (Bond Port)

        • Press Next

        • Press OK

        • Press Quit

      • For the upcoming/future hsci8000 interface:

        • yast > YaST Control Center > System > Network Settings

        • Tab Overview > Add > Select Ethernet > Next

        • Tab Address > Select Statically Assigned IP Address > Insert <ip-address> > 10.30.83.24 > Insert <subnet-mask> > /16


          Switch Tab from here, YaST complains about an empty hostname that can be left empty.
        • Tab General > Insert Configuration name > hsci8000

        • Press Next

        • Press OK

      • Check the new network config in /etc/sysconfig/network.

        $ ls -1 /etc/sysconfig/network/ifcfg*
          /etc/sysconfig/network/ifcfg-encbd00
          /etc/sysconfig/network/ifcfg-eth1
          /etc/sysconfig/network/ifcfg-hsci8000
          /etc/sysconfig/network/ifcfg-hsi0
          /etc/sysconfig/network/ifcfg-lo
          /etc/sysconfig/network/ifcfg.template
    • via ifcfg-* files in /etc/sysconfig/network.

      Note

      ifcfg-files are more convenient and faster than via YaST.

      /etc/sysconfig/network/ifcfg-eth1:

      BOOTPROTO='none'
      STARTMODE='auto'
      # Example POST_UP_SCRIPT:
      # POST_UP_SCRIPT="wicked:post-up/100-hsci8000-mm-setup_sles15.4+.sh"
      /etc/sysconfig/network/ifcfg-hsi0:
      BOOTPROTO='none'
      STARTMODE='auto'
      # Example POST_UP_SCRIPT:
      # POST_UP_SCRIPT="wicked:post-up/100-hsci8000-mm-setup_sles15.4+.sh"
      /etc/sysconfig/network/ifcfg-hsci8000:
      IPADDR='10.30.83.24/16'
      BOOTPROTO='static'
      STARTMODE='auto'
      • Bring up all interfaces (except hsci8000).

        $ wicked ifup all
      • Check the new network config in /etc/sysconfig/network.

        $ ls -1 /etc/sysconfig/network/ifcfg*
          /etc/sysconfig/network/ifcfg-encbd00
          /etc/sysconfig/network/ifcfg-eth1
          /etc/sysconfig/network/ifcfg-hsci8000
          /etc/sysconfig/network/ifcfg-hsi0
          /etc/sysconfig/network/ifcfg-lo
          /etc/sysconfig/network/ifcfg.template
  4. Create the HSCI interface

    Add HSCI for hsi0 (HS dev) and eth1 (OSA dev)

    $ which hsci
      /sbin/hsci
    
    $ hsci -v
      hsci utility: version 2.19.0-150400.1.7
      Copyright IBM Corp. 2020
    
    $ hsci add hsi0 eth1
      Verifying net dev eth1 and HiperSockets dev hsi0
      Adding hsci8000 with a HiperSockets dev hsi0 and an external dev eth1
      Successfully added HSCI interface hsci8000
    
    $ hsci show
      HSCI      PNET_ID           HiperSockets     External
      ------------------------------------------------------------
      hsci8000  NET1              hsi0             eth1
  5. Enable the hsci8000, hsi0 and eth1 interfaces

    Note
    The IP configuration is not assigned to hsci8000 until wicked is called against it. 

    $ wicked ifup eth1
    $ wicked ifup hsi0
    $ wicked ifup hsci8000
  6. Prepare a persistent HSCI

    Notes 

    • Wicked supports running shell scripts after the network interfaces are set up, which helps you to create a persistent HSCI after reboot. You can run the hsci add command to enhance the newly created ifcfg-eth1 and ifcfg-hsi0 with a shell script that checks if both interfaces are in state UP and then creates the hsci8000.
    • Also see man ifcfg (5)
    1. Enhance the existing ifcfg-* files to run a script after starting the appropriate interface.

      echo 'POST_UP_SCRIPT="wicked:post-up/100-hsci8000-mm-setup_sles15.4+.sh"' >> ifcfg-eth1
      echo 'POST_UP_SCRIPT="wicked:post-up/100-hsci8000-mm-setup_sles15.4+.sh"' >> ifcfg-hsi0
    2. Create a directory to store the post-up script 100-hsci8000-mm-setup_sles15.4+.sh.

      mkdir -p /etc/wicked/scripts/post-up
    3. Create the 100-hsci8000-mm-setup_sles15.4+.sh-script in /etc/wicked/scripts/post-up.

      Note

      The script 100-hsci8000-mm-setup_sles15.4+.sh must be placed in /etc/wicked/scripts/post-up and serves as an example (with hsi0 and eth1), which you must adapt according to your network device names. It explicitly checks if the second parameter (interface name) equals hsi0 or eth1. It also checks if the other HSCI port is UP. If this is the case, it configures the HSCI interface by calling /sbin/hsci add hsi0 eth1.
      #!/usr/bin/env bash
      
      IFACE=$2
      
      HS_DEV=hsi0
      EXT_DEV=eth1
      HSCI_DEV=hsci8000
      
      ################################################################################
      # Check, if HSCI already exists
      
      if [[ $(hsci show | grep $HSCI_DEV | wc -l) -eq 1 ]];
      then
      	logger "hsci-post-up $0: $HSCI_DEV is already in STATE: UP and running. \
      Exit script here!" exit 0 fi ################################################################################ # Check, # if this script runs as POST-UP of HS_DEV ($IFACE == $HS_DEV) # if the OSA bridgport is UP # Then run "hsci add ..." if [[ $IFACE == $HS_DEV ]] && \ [[ $(ip link show $EXT_DEV | grep UP | wc -l) -eq 1 ]]; then logger "hsci-post-up $0: $IFACE matched $HS_DEV, and $EXT_DEV is UP. \
      Running /sbin/hsci add $HS_DEV $EXT_DEV"
      /sbin/hsci add $HS_DEV $EXT_DEV fi ################################################################################ # Check, # if this script runs as POST-UP of EXT_DEV ($IFACE == $EXT_DEV) # if the HS bridgport is UP # Then run "hsci add ..." if [[ $IFACE == $EXT_DEV ]] && \ [[ $(ip link show $HS_DEV | grep UP | wc -l) -eq 1 ]]; then logger "hsci-post-up $0: $IFACE matched $EXT_DEV, and $HS_DEV is UP. \
      Running /sbin/hsci add $HS_DEV $EXT_DEV"
      /sbin/hsci add $HS_DEV $EXT_DEV fi

No comments:

Post a Comment

Popular Posts