Chapter 8. Configuring a Fibre Channel over an Ethernet Interface

Red Hat Enterprise Linux 8 ships with the following native FCoE drivers:

  • bnx2fc
  • fnic
  • qedf
  • lpfc

8.1. Configuring an Ethernet Interface to Use FCoE

As a system administrator, you can configure FCoE for bnx2fc driver.

Prerequisites

  • Setting up and deploying a FCoE interface requires the fcoe-utils package:

    # yum install fcoe-utils

Procedure

  1. To configure a new virtual LAN (VLAN), create a copy of an existing network script:

    # cp /etc/fcoe/cfg-ethx /etc/fcoe/cfg-ethX

    Replace /etc/fcoe/cfg-ethx with a network script and /etc/fcoe/cfg-ethX with an Ethernet device that supports FCoE.

    Modify the contents of the cfg-ethX file as required.

  2. If you want the device to automatically load during boot time, set the following parameter in the ifcfg-ethX file.

    # vi /etc/sysconfig/network-scripts/ifcfg-ethX
    
    ONBOOT=yes

    For example, if the FCoE device is eth2, edit the /etc/sysconfig/network-scripts/ifcfg-eth2 file accordingly.

  3. To load the FCoE device:

    # ip link set dev ethX up
  4. To start the FCoE:

    # systemctl start fcoe

    The FCoE device displays if all other settings on the fabric are correct.

  5. To view configured FCoE devices:

    # fcoeadm -i
  6. After correctly configuring the Ethernet interface to use FCoE, Red Hat recommends that you set FCoE service to run at startup.

    # systemctl enable fcoe
Note

To stop the daemon:

# systemctl stop fcoe

Stopping the daemon does not reset the configuration of FCoE interfaces. To reset the configuration:

# systemctl -s SIGHUP kill fcoe

Additional resources

8.2. Configuring an FCoE Interface to Automatically Mount at Boot

You can mount newly discovered disks via udev rules, autofs, and other similar methods. If a service requires the FCoE disk be mounted at boot-time, the FCoE disk should be mounted as soon as the fcoe service runs and before the initiation of any service that requires the FCoE disk. The FCoE mounting codes may differ depending on the system configuration, for example, a simple formatted FCoE disk, LVM, or a multipathed device node.

Procedure

  1. To configure an FCoE disk to automatically mount at boot, add appropriate FCoE mounting code to the startup script for the fcoe service. The fcoe startup script is in the /lib/systemd/system/fcoe.service file.

    Example: FCoE Mounting Code

    The following is a sample FCoE mounting code for mounting file systems specified via wild cards in the /etc/fstab file:

    mount_fcoe_disks_from_fstab()
    {
      local timeout=20
    	local done=1
    	local fcoe_disks=($(egrep 'by-path\/fc-.*_netdev' /etc/fstab | cut -d ' ' -f1))
    
    	test -z $fcoe_disks && return 0
    
    	echo -n "Waiting for fcoe disks . "
      while [ $timeout -gt 0 ]; do
    	 for disk in ${fcoe_disks[*]}; do
        if ! test -b $disk; then
    		  done=0
    			break
        fi
    	done
    
    	test $done -eq 1 && break;
    	sleep 1
    	echo -n ". "
    	done=1
    	let timeout--
    	done
    
    	if test $timeout -eq 0; then
    	 echo "timeout!"
    	else
    	 echo "done!"
    	fi
    
    	# mount any newly discovered disk
    	mount -a 2>/dev/null
    	}
  2. To start the FCoE:

    # systemctl start fcoe

    The mount_fcoe_disks_from_fstab function should be invoked after the fcoe service script starts the fcoemond daemon. This will mount FCoE disks specified by the following paths in the /etc/fstab file:

    /dev/disk/by-path/fc-0xXX:0xXX /mnt/fcoe-disk1 ext4  defaults,_netdev    0 0
    /dev/disk/by-path/fc-0xYY:0xYY /mnt/fcoe-disk2 ext3  defaults,_netdev    0 0

    Entries with fc- and _netdev sub-strings enable the mount_fcoe_disks_from_fstab function to identify FCoE disk mount entries.

Note

The fcoe service does not implement a timeout for FCoE disk discovery. The FCoE mounting code should implement its own timeout period.

Additional resources

  • The fcoe man page
  • The fstab man page.
  • The /usr/share/doc/fcoe-utils-version/README file.