Configuring a SCSI tape or medium changer device

Configure FC-attached SCSI tape devices and SCSI medium changers as host devices for a virtual server.

Before you begin

Make sure that, as described in Preparing SCSI tape and medium changer devices:
  • The SCSI tape or medium changer device is set up.
  • You provide the SCSI device name of the SCSI tape or medium changer device.
You need a virtual HBA to connect to.
  • Either use a configured virtual HBA (see Configuring a virtual HBA), or
  • Connect to a new virtual HBA which will be automatically configured for you.

About this task

SCSI device names are freshly assigned after a host reboot or when a device is set offline and back online. This means that you have to verify an FC-attached SCSI tape or medium changer device configuration after one of these events. This limitation is also important if you plan a live migration.

Tip: Configure both FC-attached SCSI tape and medium changer devices in separate device configuration-XML files. Attach these devices only when necessary, and detach them before you migrate the virtual server, or set one of the devices in the configuration path offline.

Procedure

  1. Configure the SCSI tape or medium changer device using the hostdev element (see <hostdev>).


  2. Specify the SCSI tape or medium changer device on the host as child of the source element.


    (see <adapter> as child element of <source> and <address> as child element of <source>)
  3. Optional: Connect to a virtual HBA and specify a freely selectable SCSI device name on the virtual server.


    (see <address> as child element of <hostdev> or <disk>)
    Where
    <controller-index>
    specifies the virtual HBA to which the SCSI device is connected.

    Enter the value of the controller index attribute of a configured virtual HBA or a new index value. The allocated index values must be contiguous without gaps. If you specify a new index value, a new virtual HBA is automatically configured.

    The virtual HBA is also called the SCSI host of the SCSI device on the virtual server.

    <target>
    is a freely selectable natural number: 0 ≤ <target> < 256
    <unit>
    determines the SCSI LUN on the virtual server according to the rules specified in the SCSI Architecture Model (SAM):
    0 ≤ <unit> < 256
    SCSI LUN := <unit>
    256 ≤ <unit> ≤ 16383
    SCSI LUN := 0x<unit> ∨ 0x4000
    Tip: Choose a value between 0 and 255, because these values are identically mapped to the SCSI LUN on the virtual server.

Example

Obtain the SCSI host number, the SCSI ID, and the SCSI LUN of the FC-attached SCSI tape or medium changer device:
# lszfcp -D
0.0.1cc8/0x5005076044840242/0x0000000000000000 3:0:8:0

where:

0.0.1cc8
Is the device bus-ID of the FCP device
0x5005076044840242
Is the WWPN
0x0000000000000000
Is the FCP LUN
3
The first position of the quadruple indicates the SCSI host number
8
The third position of the quadruple indicates the SCSI ID
0
The fourth position of the quadruple indicates the SCSI LUN
This graphic shows how the SCSI stack address is used in the configuration.
Assign a SCSI device name to the virtual SCSI device on the virtual server. The controller attribute of the address element refers to the index attribute of the controller element.
  • Domain configuration-XML file:
    <domain type="kvm">
      <name>VM1</name>
      ...
      <devices>
         ...
        <controller type="scsi" model="virtio-scsi" index="0">
           <address type="ccw" cssid="0xfe" ssid="0" devno="0x0002"/>
        </controller>
    
        ...
      </devices>
    </domain>
    
  • Device configuration-XML file:
    <hostdev mode="subsystem" type="scsi">
        <source>
           <adapter name="scsi_host3"/>
           <address bus="0" target="8" unit="0"/>
        </source>
        <address type="drive" controller="0" bus="0" target="1" unit="1"/>
    </hostdev>
    
Display the SCSI tape on the host:
# lsscsi
[3:0:8:0] tape IBM 03592E07 35CD
On the virtual server, the SCSI tape will be displayed like this:
[root@guest:] # lsscsi
[0:0:1:1] tape IBM 03592E07 35CD