Preparing SCSI disks

Consider these aspects when setting up FC-attached SCSI disks for the use of a virtual server.

Before you begin

  1. If you want to allow a migration of a virtual server to another host, use unique names for the virtualized SCSI disks, which can be used from different hosts.

    Device-mapper multipathing groups two or more paths to the same SCSI disk, thus providing failover redundancy and load balancing. It assigns unique device mapper-created device nodes to SCSI disks, which are valid for all hosts that access the SCSI disks.

    According to your product or distribution mechanism:
    1. Make sure that multipath support is enabled.
    2. Configure the multipath device mapper not to use user-friendly names. User friendly names are symbolic names, which are not necessarily equal on different hosts.

    See your host administration documentation to find out how to prepare multipath support.

  2. Provide either of the following information:
    • The device bus-IDs of the FCP devices, target WWPNs, and the FCP LUNs of the SCSI disk.
    • The device mapper-created device node of the SCSI disk.

About this task

The following publications describe in detail how to configure, prepare, and work with FC-attached SCSI disks:
  • Fibre Channel Protocol for Linux® and z/VM® on IBM® System z®, SG24-7266
  • How to use FC-attached SCSI devices with Linux on z Systems®, SC33-8413
  • Device Drivers, Features, and Commands, SC33-8411

Procedure

The following steps describe a SCSI disk setup on the host that does not persist across host reboots.

For a persistent setup, see your host administration documentation.

  1. Linux senses the available FCP devices.

    You can use the lscss command to display the available FCP devices.

    The -t option can be used to restrict the output to a particular device type. FCP devices are listed as 1732/03 devices with control unit type 1731/03.

  2. Set the FCP device online.

    You can use the chccwdev command to set an FCP device online or offline.

  3. Configure the SCSI disks on the host.

    For details about this step, refer to your host administration documentation and Device Drivers, Features, and Commands, SC33-8411.

    If your FCP setup uses N_Port ID virtualization (NPIV), the SCSI LUNs are automatically detected. If you do not use NPIV or if automatic LUN scanning is disabled, write the LUN to the sysfs unit_add attribute of the applicable target port:
    # echo <fcp_lun> > /sys/bus/ccw/drivers/zfcp/<device_bus_id>/<wwpn>/unit_add
  4. Verify the configuration and display the multipath device mapper-created device node of the SCSI disk.
  5. Do not partition SCSI disks for a virtual server, because the virtual server user might want to partition its virtual block devices.

Example

For one example path, you provide the device bus-ID of the FCP device, the target WWPN, and the FCP LUN of the SCSI disk:

/sys/bus/ccw/drivers/zfcp/0.0.1700/0x500507630513c1ae/0x402340bc00000000 provides the information:
  1. Display the available FCP devices.
    # lscss -t 1732/03 | fgrep '1731/03'
    0.0.1700 0.0.06d4  1732/03 1731/03      80  80  ff   50000000 00000000 
    0.0.1740 0.0.0714  1732/03 1731/03      80  80  ff   51000000 00000000 
    0.0.1780 0.0.0754  1732/03 1731/03 yes  80  80  ff   52000000 00000000 
    0.0.17c0 0.0.0794  1732/03 1731/03 yes  80  80  ff   53000000 00000000 
    0.0.1940 0.0.08d5  1732/03 1731/03      80  80  ff   5c000000 00000000 
    0.0.1980 0.0.0913  1732/03 1731/03      80  80  ff   5d000000 00000000 
  2. Set the FCP device online.
    # chccwdev -e 0.0.1700
    Setting device 0.0.1700 online
    Done
  3. Configure the SCSI disk on the host.
    # echo 0x402340bc00000000 > /sys/bus/ccw/drivers/zfcp/0.0.1700/0x500507630513c1ae/unit_add
  4. Figure out the device mapper-created device node of the SCSI disk.
    1. You can use the lszfcp command to display the SCSI device name of a SCSI disk:
      # lszfcp -D -b 0.0.1700 -p 0x500507630513c1ae -l 0x402340bc00000000
      0.0.1700/0x500507630513c1ae/0x402340bc00000000 2:0:17:1086079011
    2. The lsscsi -i command displays the multipathed SCSI disk related to the SCSI device name:
      # lsscsi -i
      ...
      [1:0:16:1086144547]disk   IBM   2107900   .166  /dev/sdg   36005076305ffc1ae00000000000023bd
      [1:0:16:1086210083]disk   IBM   2107900   .166  /dev/sdk   36005076305ffc1ae00000000000023be
      [1:0:16:1086275619]disk   IBM   2107900   .166  /dev/sdo   36005076305ffc1ae00000000000023bf
      [2:0:17:1086079011]disk   IBM   2107900   2440  /dev/sdq   36005076305ffc1ae00000000000023bc
      ...
      The device mapper-created device node that you can use to uniquely reference the multipathed SCSI disk 36005076305ffc1ae00000000000023bc is:
      /dev/mapper/36005076305ffc1ae00000000000023bc

What to do next

Configure the SCSI disks as described in Configuring a DASD, SCSI, or NVMe disk.