Setting an FCP device online or offline

Ubuntu 22.04 LTS LPAR mode z/VM guest

By default, FCP devices are offline. Set an FCP device online before you perform any other tasks.

About this task

As of z14 and LinuxONE II in DPM mode:

For Linux in a DPM partition, FCP devices are set online automatically, see Device auto-configuration for Linux in LPAR mode.

DPM device auto-configuration with zfcp automatic LUN scan manages the zfcp configuration, including FCP devices, remote ports, and LUNs. This automation has the following requirements:
  • The SAN switches must use single-initiator zoning.
  • LUN masking (host mapping) must be in place on the storage systems.
  • Both the SAN switches and the LUN masking must use host NPIV WWPNs for access control.

See Working with newly available devices to avoid errors when you work with devices that have become available to a running Linux instance.

Important: Configuration changes can directly or indirectly affect information that is required to mount the root file system. Such changes require an update of the initramfs, followed by a re-write of the boot record (see Rebuilding the initial RAM disk image).

Setting an FCP device online registers it with the Linux SCSI stack and updates the symbolic port name for the device on the FC name server. For FCP setups that use NPIV mode, the device bus-ID and the host name of the Linux instance are added to the symbolic port name.

Setting an FCP device online also automatically runs the scan for ports in the SAN and waits for this port scan to complete.

To check if setting the FCP device online was successful, you can use a script that first sets the FCP device online and after this operation completes checks if the WWPN of a target port has appeared in sysfs.

When you set an FCP device offline, the port and LUN subdirectories are preserved. Setting an FCP device offline interrupts the communication between Linux and the FCP channel. After a timeout has expired, the port and LUN attributes indicate that the ports and LUNs are no longer accessible. The transition of the FCP device to the offline state is synchronous, unless the device is disconnected.

For disconnected devices, setting the device offline triggers an asynchronous deregistration process. When this process is completed, the device with its ports and LUNs is no longer represented in sysfs.

When the FCP device is set back online, the SCSI device names and minor numbers are freshly assigned. The mapping of devices to names and numbers might be different from what they were before the FCP device was set offline.

Procedure

For a persistent configuration, use the chzdev command.

For a non-persistent configuration, you can use the chzdev command with the -a option.

Examples

  • To set an FCP device with bus ID 0.0.3d0c online, issue:
    # chzdev -e zfcp-host 0.0.3d0c
    This setting persists across re-boots. For more details, see Persistent device configuration. To apply this setting to the running system only, use the chzdev command with the -a option:
    # chzdev -e -a zfcp-host 0.0.3d0c
  • To set an FCP device with bus ID 0.0.3d0c offline, issue:
    # chzdev -d zfcp-host 0.0.3d0c
    This setting persists across re-boots. For more details, see Persistent device configuration. To apply this setting to the running system only, use the chzdev command with the -a option:
    # chzdev -d -a zfcp-host 0.0.3d0c