Configuring a virtual HBA

Configure virtual Host Bus Adapters (HBAs) for virtual SCSI devices.

Procedure

  1. Use the controller element, which is a child of the devices element.
    controller type attribute: scsi
    controller model attribute: virtio-scsi
    controller index attribute: <index>

    Where <index> is a unique decimal integer designating in which order the virtual HBA is set online.

    Example:
    <devices>
        <controller type="scsi" model="virtio-scsi" index="0"/>
    </devices>
  2. For guests that are to run in IBM® Secure Execution mode and cannot use the launchSecurity element in the virtual server configuration, ensure that the device uses the guest's bounce buffer, see Preparing the virtual server.
  3. Optional: To attain good performance, assign an I/O thread for I/O operations on the device.
    Use the driver element, which is a child of the controller element:
    driver iothread attribute: <IOthread-ID>

    <IOthread-ID> specifies the I/O thread to be used for I/O operations on all virtual SCSI devices that are attached to the virtual HBA. Specify a value between 1 and the number of I/O threads configured by the iothreads element in the domain configuration-XML file.

    See also I/O threads.

    Example:
    <domain>
        ...
        <iothreads>2</iothreads>
        ...
        <devices>
            <controller type="scsi" model="virtio-scsi" index="0">
                <driver iothread="2"/>
            </controller>
        </devices>
        ....
    </domain>
    In this example, the I/O thread with ID 2 is assigned for I/O operations on the device.
  4. Optional: Specify the address of the device to be created.

    The controller element creates the virtual device and subchannel numbers sequentially. This can be overwritten by expanding the controller element to include an address element. The device number is used to create the virtual HBA.

    address type attribute: ccw
    address cssid attribute: 0xfe

    (reserved channel subsystem-ID)

    address ssid attribute: <subchannel-set-ID>
    address devno attribute: <device-number>
    (see <address> as child element of <controller>, <disk>, <filesystem>, and <memballoon>)
    Example:
    <devices>
        <controller type="scsi" model="virtio-scsi" index="0">
            <address type="ccw" cssid="0xfe" ssid="0" devno="0x1111"/>
        </controller>
    </devices>

Example

If you do not configure an address for an HBA, libvirt creates an address for you. You can retrieve this address with the virsh dumpxml command.
  1. Domain configuration-XML file:
    <domain type="kvm">
        ...
        <devices>
            <controller type="scsi" model="virtio-scsi" index="0"/>
            ...
        </devices>
    </domain>
  2. Define the virtual server to libvirt.
  3. Issue the command:
    # virsh dumpxml vserv1
    The current libvirt-internal configuration is displayed:
    <domain type="kvm">
        ...
        <devices>
            <controller type="scsi" model="virtio-scsi" index="0">
                <address type="ccw" cssid="0xfe" ssid="0" devno="0x0000"/>
            </controller>
            ...
        </devices>
    </domain>