# hostdev_scsi vdsm hook


## Overview

When attaching host SCSI device to a VM, oVirt creates a hostdev device
using the "scsi_generic" interface. This interface provides full
implementation of the SCSI protocol and is useful for tapes or media
changer devices.

For disk drives other interfaces like "scsi_block" and "scsi_hd" perform
better, but oVirt does not provide a way to configure these interfaces.

This hook translates hostdev devices using "scsi_generic" to equivalent
disk devices using "scsi_block" or "scsi_hd".


## Supported interfaces.

The supported interfaces are "scsi_hd" and "scsi_block".

- The "scsi_block" interface supports the SCSI passthrough mode.
- The "scsi_hd" interface does not.

Depending on your setup (e.g. queue depth, usage of iothread), one
interface may be more performant than the other; both are expected to
perform better than "scsi_generic".


## Host installaion

Install the vdsm-hook-hostdev-scsi on all hosts in the cluster.


## Engine configuration

Configure engine UserDefinedVMProperties to support the 'hostdev_scsi' custom
property:

    engine-config -s UserDefinedVMProperties='hostdev_scsi=^(scsi_block|scsi_hd)$'

Restart the engine.


## VM configuration

On the VM configuration UI, add "hostdev_scsi" custom property and select
either "scsi_block" or "scsi_hd".

After restarting the VM, all hostdev devices will be translated to the
selected interface.
