Device configuration-XML

Devices that are configured with separate device configuration-XML files can be attached to an already defined virtual server.

The element that delimits a device configuration within the domain configuration-XML file varies by device type. For example, this element can be hostdev, disk, controller, or interface. In the domain configuration-XML file, all these elements are specified as children of the devices element. In separate device configuration-XML files these elements are the root elements.

<disk>: Virtual block device
Use the disk element to configure virtual block devices. On the host, the source could be a DASD, a SCSI disk, a logical volume, or a file in the host file system.
Root element
disk
Selected child elements
driver, source, target, address
Example: SCSI disk
<disk type="block" device="disk">
    <driver name="qemu" type="raw" cache="none" io="native" iothread="1"/>
    <source dev="/dev/mapper/36005076305ffc1ae00000000000021d5"/>
    <target dev="vda" bus="virtio"/>
    <address type="ccw" cssid="0xfe" ssid="0x0" devno="0x3c1b"/>
</disk>
Example: NVMe device
<disk type="block" device="disk">
    <driver name="qemu" type="raw" cache="none" io="native" iothread="1"/>
    <source dev="/dev/disk/by-path/pci-1003:00:00.0-nvme-1"/>
    <target dev="vdc" bus="virtio"/>
</disk>
Related information:
Configuring virtual block devices
<hostdev>: VFIO or SCSI pass-through devices
Use the hostdev element to configure host resources as pass-through devices. SCSI disks can be configured as pass-through devices, but the preferred configuration is as virtual block devices. Do not configure VFIO cryptographic adapter resources as hotplug devices.
Root element
hostdev
Selected child elements
source, address
Example: VFIO pass-through DASD
<hostdev mode="subsystem" type="mdev" model="vfio-ccw">
   <source>
      <address uuid="90c6c135-ad44-41d0-b1b7-bae47de48627"/>
   </source>
   <address type="ccw" cssid="0xfe" ssid="0x0" devno="0x00a1"/>
</hostdev>
Example: pass-through device for cryptographic adapter resources
<hostdev mode="subsystem" type="mdev" model="vfio-ap">
   <source>
      <address uuid="99e714ec-8eee-40fd-a26e-80ff3b1a2564"/>
   </source>
</hostdev>
Example: pass-through SCSI
<hostdev mode="subsystem" type="scsi">
    <source>
       <adapter name="scsi_host0"/>
       <address bus="0" target="0" unit="0"/>
    </source>
    <address type="drive" controller="0" bus="0" target="1" unit="1"/>
</hostdev>
Related information:
<controller>: Virtual host bus adapter
Use the controller element to configure a virtual host bus adapter for pass-through SCSI devices.
Root element
controller
Selected child elements
address
Example
<controller type="scsi" model="virtio-scsi" index="0">
    <address type="ccw" cssid="0xfe" ssid="0" devno="0x0002"/>
</controller>
Related information:
Configuring virtual SCSI devices
<interface>: Virtual Ethernet devices
Root element
interface
Selected child elements
mac, source, model
Example
<interface type="direct">
    <source dev="bond0" mode="bridge"/>
    <model type="virtio"/>
</interface>   
Related information:
Configuring virtual Ethernet devices