How to configure device files for SCSI media changers on Linux platforms

Ensure that device files for SCSI media changers, which provide access to Library Managers for TSLM servers that run on Linux® platforms, are properly configured. The configuration is critical for the correct operation of TSLM. This way, Library Managers can refer to the correct device files needed to handle the respective target libraries. The device files for the SCSI media changers are configured with the Linux Tape and Medium Changer Device Driver (lin_tape driver) and Linux udev service. The following important information and examples are provided to help avoid configuration errors for the device files on Linux platforms.

When you use multiple control paths to a target library

In most cases, a tape library has multiple tape drives, which can provide multiple control paths to the library through them. For higher availability, configure the tape library so that it has at least two control paths.

You must configure the lin_tape driver so that it can use the control path failover (CPF) function for the multiple control paths. With the CPF function, one of the control paths for the same SCSI media changer is used as the primary control path. Any other control paths are each used as an alternate path. This way, an application can continue to use the same SCSI media changer by referring to a device file on one of the control paths, even if the control path becomes unavailable.

Verify that the alternate_pathing=1 option is set for the lin_tape driver CPF function, and is included in the /etc/modprobe.conf directory, or the /etc/modprobe.conf.local directory. Or, if you are running RHEL 6 or higher, in a user-customized configuration file, for example lin_tape.conf under the /etc/modprobe.d directory.
options lin_tape alternate_pathing=1
Note: If another option is set, each option must be separated with space characters. If you change the configuration file, you must reload the lin_tape driver, as in the following command sequence:
  1. lin_taped stop
  2. modprobe -r lin_tape
  3. depmod
  4. modprobe lin_tape
  5. lin_taped

Also, verify that the primary and alternative control path can be referenced in the /proc/scsi/IBMchanger file.

When you create a Library Manager configuration file by using the ermmLmConfig command, you must specify the device file on the primary control path for the SCSI media changer of the target library. You must not create another configuration file for the same SCSI media changer by specifying a different device file because it can cause an inconsistent configuration in the TSLM database.

How to use persistent names for the device files

When a Library Manager is configured, the device file for the target SCSI media changer is tied with the serial number for the device. However, the device file name for the SCSI media changer (for example, /dev/IBMchanger0, /dev/IBMchanger1) might change when a system restart, a reload of the lin_tape driver, or changes in connected devices occur, because detecting connected devices is not done with the same sequence. Therefore, you must use persistent names for the device files to avoid this type of problem. Linux udev provides a dynamic device management function. You can make symbolic links with persistent names to the device files for the SCSI media changer by using a rule-based configuration file for the udev.

Before you make the rules file, use the udevadm info command (for RHEL 6 or SLES 11 systems) to look into the serial numbers for the devices that the udev handles.

For example, for /dev/IBMchanger0, run the following command:
udevadm info --attribute-walk --name /dev/IBMchanger0 | grep serial_num
The expected result is like the following example:
ATTR{serial_num}=="0000078A03810403"
This next example shows a Linux host that detects two SCSI media changer devices.
Note: Each device file (/dev/IBMchanger0 and /dev/IBMchanger2) in the following example refers to the same SCSI media changer, but with different control paths.
 
Device file        SCSI media changer serial number
/dev/IBMchanger0   0000078A03810403
/dev/IBMchanger1   0000078A03810405

For the preceding configuration, create a rules file named 98-lin_tape.rules under the /etc/udev/rules.d directory to describe the rules to make persistent names to corresponding serial numbers.

Describe one rule per line to create a symbolic link (SYMLINK=="...") for a device file (KERNEL=="...") that has a specific attribute (for example, SYSFS{serial_num}=="..."). Optionally, you can set the file attributes for owner (OWNER="..."), group (GROUP="..."), and access mode (MODE="...") to the device file. It is useful to ensure that the TSLM user ermm can access the devices.

For the preceding example, plan to create symbolic links and a rules file that are similar to the following examples:
  • Symbolic link with persistent name SCSI media changer serial number
    
    " /dev/lin_tape/by-id/IBMchanger0    0000078A03810403
     /dev/lin_tape/by-id/IBMchanger1    0000078A03810405"
    
  • The rule file includes the following rules. The rules must be described in two lines for respective symbolic links. Apply the rules by reloading the lin_tape driver.
     KERNEL=="IBMchanger*", SYSFS{serial_num}=="0000078A03810403",
      SYMLINK="lin_tape/by-id/IBMchanger0" OWNER="root" GROUP="root"
      MODE="666"
     KERNEL=="IBMchanger*", SYSFS{serial_num}=="0000078A03810405",
      SYMLINK="lin_tape/by-id/IBMchanger1" OWNER="root" GROUP="root"
      MODE="666"
After you create the symbolic links and a rules file, use the following command to verify that the symbolic links are created based on the rules:
ls -l /dev/lin_tape/by-id/
The expected result is like the following example:
lrwxrwxrwx 1 root root 17 Oct 24 22:18 IBMchanger0 -> ../../IBMchanger0
 lrwxrwxrwx 1 root root 17 Oct 24 22:18 IBMchanger1 -> ../../IBMchanger1
When you change the rules file later on, you can apply the change by the following command sequence (for RHEL 6 or SLES 11 systems):
udevadm control --reload-rules
udevadm trigger
When you configure a Library Manager, use the persistent names for the symbolic links (for example, /dev/lin_tape/by-id/IBMchanger0).
Note: Currently, TSLM can support persistent names only for SCSI media changers, which are referred to by Library Managers on the TSLM server. For tape drives, a TSLM client does not support persistent names, which are referred to by the Host Drive Manager (HDM). Every time the HDM restarts, it collects available tape drives (for example, /dev/IBMtape0, /dev/IBMtape1), on the TSLM client host. You can see the t/IBM/ermm/conf/hdmdrive.cfg file, which is generated at the HDM restart time. The tape drive configuration is sent to the Media Manager on the TSLM server. An impact is that any obsolete Drive Manager definitions remain if the tape device file name is changed on the TSLM client side.