Preparing SCSI tape and medium changer devices

Consider these aspects when setting up FC-attached SCSI tapes and SCSI medium changers for the use of a virtual server.

Before you begin

Provide the device bus-IDs of the FCP devices, the target WWPNs, and the FCP LUNs of the SCSI tape or medium changer devices.

You can use the information that is provided as directory names:

/sys/bus/ccw/drivers/zfcp/<device_bus_id>/<wwpn>/<fcp_lun>

The virtual server user can install and use the IBM® lin_tape package on the virtual server for actions such as the mounting and unmounting of tape cartridges into the affected tape drive. The use of the lin_tape device driver is documented in the IBM Tape Device Drivers Installation and User's Guide, GC27-2130.

About this task

The following publications describe in detail how to configure, prepare, and work with FC-attached SCSI devices:
  • 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
Note: In the libvirt documentation, the term LUN is often referenced as unit.

Procedure

The following steps describe a SCSI tape or medium changer setup on the host that does not persist across host reboots.

For a persistent setup, see your host administration documentation (see also ldva_c_conventions.html#ldva_c_conventions__persistentConfig ).

  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 to which your SCSI device is attached online.

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

  3. Register the SCSI tape or medium changer device on the host.

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

    If your LUN is not automatically detected, you might add the LUN of the SCSI tape or medium changer device to the file system by issuing:
    # echo <fcp_lun> > /sys/bus/ccw/devices/<device_bus_id>/<wwpn>/unit_add

    This step registers the SCSI tape or medium changer device in the Linux SCSI stack and creates a sysfs entry for it in the SCSI branch.

  4. Obtain the following information to be able to configure the SCSI tape or medium changer device:
    • The SCSI host number that corresponds to the FCP device
    • The SCSI ID of the target port
    • The SCSI LUN
    You obtain this information by issuing:
    # lszfcp -D -b <device_bus_ID> -p <wwpn> -l <fcp_lun>
    This command displays the SCSI device name of the SCSI tape or the SCSI medium changer:
    <scsi_host_number>:0:<scsi_ID>:<scsi_lun>

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 tape or medium changer device:

/sys/bus/ccw/drivers/zfcp/0.0.1cc8/0x5005076044840242/0x0000000000000000 provides the information:
Device bus-ID of the FCP device 0.0.1cc8
WWPN 0x5005076044840242
FCP LUN 0x0000000000000000
  1. Display the available FCP devices:
    # lscss -t 1732/03 | fgrep '1731/03'
    0.0.1cc8 0.0.0013  1732/03 1731/03      80  80  ff  f0000000 00000000
    0.0.1f08 0.0.0015  1732/03 1731/03 yes  80  80  ff  1e000000 00000000
    0.0.3b58 0.0.0016  1732/03 1731/03      80  80  ff  68000000 00000000
    
  2. Bring the FCP device online:
    # chccwdev -e 0.0.1cc8
    Setting device 0.0.1cc8 online
    Done
  3. Register the SCSI tape device on the host:
    # echo 0x0000000000000000 > /sys/bus/ccw/devices/0.0.1cc8/0x5005076044840242/unit_add
  4. Obtain the SCSI host number, the SCSI ID, and the SCSI LUN of the registered SCSI tape device:
    # lszfcp -D -b 0.0.1cc8 -p 0x5005076044840242 -l 0x0000000000000000
     0.0.1cc8/0x5005076044840242/0x0000000000000000 1:0:2:0
    where:
    SCSI host number 1
    SCSI channel 0 (always)
    SCSI ID 2
    SCSI LUN 0

What to do next

Configure the SCSI tape and medium changer devices as described in Configuring a SCSI tape or medium changer device.