- virtio-scsi-pci - PCI bus storage device
- virtio-9p-pci - PCI bus storage device
- virtio-blk-pci - PCI bus storage device
- virtio-net-pci - PCI bus network device also known as virtio-net
- virtio-serial-pci - PCI bus input device
- virtio-balloon-pci - PCI bus memory balloon device
- virtio-rng-pci - PCI bus virtual random number generator device
vectorvalue to be greater than 32. All virtio devices with the exception of virtio-balloon-pci and virtio-rng-pci will accept a
... <devices> <emulator>/usr/lib/xen/bin/qemu-dm</emulator> </devices> ...
Figure 20.22. Devices - child elements
<emulator>element specify the fully qualified path to the device model emulator binary. The capabilities XML specifies the recommended default emulator to use for each particular domain type or architecture combination.
20.16.1. Hard Drives, Floppy Disks, CDROMs
... <devices> <disk type='file' snapshot='external'> <driver name="tap" type="aio" cache="default"/> <source file='/var/lib/xen/images/fv0' startupPolicy='optional'> <seclabel relabel='no'/> </source> <target dev='hda' bus='ide'/> <iotune> <total_bytes_sec>10000000</total_bytes_sec> <read_iops_sec>400000</read_iops_sec> <write_iops_sec>100000</write_iops_sec> </iotune> <boot order='2'/> <encryption type='...'> ... </encryption> <shareable/> <serial> ... </serial> </disk> ... <disk type='network'> <driver name="qemu" type="raw" io="threads" ioeventfd="on" event_idx="off"/> <source protocol="sheepdog" name="image_name"> <host name="hostname" port="7000"/> </source> <target dev="hdb" bus="ide"/> <boot order='1'/> <transient/> <address type='drive' controller='0' bus='1' unit='0'/> </disk> <disk type='network'> <driver name="qemu" type="raw"/> <source protocol="rbd" name="image_name2"> <host name="hostname" port="7000"/> </source> <target dev="hdd" bus="ide"/> <auth username='myuser'> <secret type='ceph' usage='mypassid'/> </auth> </disk> <disk type='block' device='cdrom'> <driver name='qemu' type='raw'/> <target dev='hdc' bus='ide' tray='open'/> <readonly/> </disk> <disk type='block' device='lun'> <driver name='qemu' type='raw'/> <source dev='/dev/sda'/> <target dev='sda' bus='scsi'/> <address type='drive' controller='0' bus='0' target='3' unit='0'/> </disk> <disk type='block' device='disk'> <driver name='qemu' type='raw'/> <source dev='/dev/sda'/> <geometry cyls='16383' heads='16' secs='63' trans='lba'/> <blockio logical_block_size='512' physical_block_size='4096'/> <target dev='hda' bus='ide'/> </disk> <disk type='volume' device='disk'> <driver name='qemu' type='raw'/> <source pool='blk-pool0' volume='blk-pool0-vol0'/> <target dev='hda' bus='ide'/> </disk> </devices> ...
Figure 20.23. Devices - Hard drives, floppy disks, CDROMs
188.8.131.52. Disk element
<disk>element is the main container for describing disks. The attribute
typecan be used with the
<disk>element. The following types are allowed:
184.108.40.206. Source element
<disk type='file''>, then the
fileattribute specifies the fully-qualified path to the file holding the disk. If the
<disk type='block'>, then the
devattribute specifies the path to the host physical machine device to serve as the disk. With both
block, one or more optional sub-elements
seclabel, described below, can be used to override the domain security labeling policy for just that source file. If the disk type is
dir, then the
dirattribute specifies the fully-qualified path to the directory to use as the disk. If the disk type is
network, then the protocol attribute specifies the protocol to access to the requested image; possible values are
gluster, an additional attribute
nameis mandatory to specify which volume and or image will be used. When the disk type is
sourcemay have zero or more
hostsub-elements used to specify the host physical machines to connect, including:
type='network'. For a
filedisk type which represents a cdrom or floppy (the device attribute), it is possible to define policy what to do with the disk if the source file is not accessible. This is done by manipulating the
startupPolicyattribute, with the following values:
mandatorycauses a failure if missing for any reason. This is the default setting.
requisitecauses a failure if missing on boot up, drops if missing on migrate/restore/revert
optionaldrops if missing at any start attempt
220.127.116.11. Mirror element
BlockCopyoperation, where the
<mirror>location in the attribute file will eventually have the same contents as the source, and with the file format in attribute format (which might differ from the format of the source). If an attribute ready is present, then it is known the disk is ready to pivot; otherwise, the disk is probably still copying. For now, this element only valid in output; it is ignored on input.
18.104.22.168. Target element
<target>element controls the bus / device under which the disk is exposed to the guest virtual machine OS. The dev attribute indicates the logical device name. The actual device name specified is not guaranteed to map to the device name in the guest virtual machine OS. The optional bus attribute specifies the type of disk device to emulate; possible values are driver specific, with typical values being
sata. If omitted, the bus type is inferred from the style of the device name. eg, a device named
'sda'will typically be exported using a SCSI bus. The optional attribute
trayindicates the tray status of the removable disks (such as CD-ROM or Floppy disk), the value can be either
closed. The default setting is
closed. For more information, see target Elements
<iotune>element provides the ability to provide additional per-device I/O tuning, with values that can vary for each device (contrast this to the
blkiotuneelement, which applies globally to the domain). This element has the following optional sub-elements. Note that any sub-element not specified or at all or specified with a value of
0implies no limit.
<total_bytes_sec>- the total throughput limit in bytes per second. This element cannot be used with
<read_bytes_sec>- the read throughput limit in bytes per second.
<write_bytes_sec>- the write throughput limit in bytes per second.
<total_iops_sec>- the total I/O operations per second. This element cannot be used with
<read_iops_sec>- the read I/O operations per second.
<write_iops_sec>- the write I/O operations per second.
<driver>element allows specifying further details related to the hypervisor driver that is used to provide the disk. The following options may be used:
- If the hypervisor supports multiple back-end drivers, then the
nameattribute selects the primary back-end driver name, while the optional type attribute provides the sub-type. For a list of possible types refer to Driver Elements
- The optional
cacheattribute controls the cache mechanism, possible values are:
writethrough, but it bypasses the host physical machine page cache) and
unsafe(host physical machine may cache all disk io, and sync requests from guest virtual machine virtual machines are ignored).
- The optional
error_policyattribute controls how the hypervisor behaves on a disk read or write error, possible values are
enospace. The default setting of
report. There is also an optional
rerror_policythat controls behavior for read errors only. If no
error_policyis used for both read and write errors. If
rerror_policyis given, it overrides the
error_policyfor read errors. Also note that
enospaceis not a valid policy for read errors, so if
error_policyis set to
no rerror_policyis given, the read error the default setting,
reportwill be used.
- The optional
ioattribute controls specific policies on I/O;
qemuguest virtual machine virtual machines support
native. The optional
ioeventfdattribute allows users to set domain I/O asynchronous handling for disk device. The default is left to the discretion of the hypervisor. Accepted values are
off. Enabling this allows the guest virtual machine virtual machine to be executed while a separate thread handles I/O. Typically guest virtual machine virtual machines experiencing high system CPU utilization during I/O will benefit from this. On the other hand, an overloaded host physical machine can increase guest virtual machine virtual machine I/O latency. Unless you are absolutely certian that the
ioneeds to be manipulated, it is highly recommended that you not change the default setting and allow the hypervisor to dictate the setting.
- The optional
event_idxattribute controls some aspects of device event processing and can be set to either
off- if it is on, it will reduce the number of interrupts and exits for the guest virtual machine virtual machine. The default is determined by the hypervisor and the default setting is
on. In cases that there is a situation where this behavior is suboptimal, this attribute provides a way to force the feature
off. Unless you are absolutely certian that the
event_idxneeds to be manipulated, it is highly recommended that you not change the default setting and allow the hypervisor to dictate the setting.
- The optional
copy_on_readattribute controls whether to copy the read backing file into the image file. The accepted values can be either
copy-on-readavoids accessing the same backing file sectors repeatedly and is useful when the backing file is over a slow network. By default
22.214.171.124. Additional device elements
<boot>- Specifies that the disk is bootable.
Additional boot values
<order>- Determines the order in which devices will be tried during boot sequence.
<per-device>boot elements cannot be used together with general boot elements in BIOS boot loader section
<encryption>- Specifies how the volume is encrypted. See the Storage Encryption page for more information.
<readonly>- Indicates the device cannot be modified by the guest virtual machine virtual machine. This setting is the default for disks with
shareableIndicates the device is expected to be shared between domains (as long as hypervisor and OS support this). If
cache='no'should be used for that device.
<transient>- Indicates that changes to the device contents should be reverted automatically when the guest virtual machine virtual machine exits. With some hypervisors, marking a disk
transientprevents the domain from participating in migration or snapshots.
<serial>- Specifies the serial number of guest virtual machine virtual machine virtual machine's hard drive. For example,
<wwn>- Specifies the WWN (World Wide Name) of a virtual hard disk or CD-ROM drive. It must be composed of 16 hexadecimal digits.
<vendor>- Specifies the vendor of a virtual hard disk or CD-ROM device. It must not be longer than 8 printable characters.
<product>- Specifies the product of a virtual hard disk or CD-ROM device. It must not be longer than 16 printable characters
<host>- Supports 4 attributes:
socket, which specify the host name, the port number, transport type and path to socket, respectively. The meaning of this element and the number of the elements depend on the
protocolattribute as shown here:
Additional host attributes
nbd- Specifies a server running nbd-server and may only be used for only one host physical machine
rbd- Monitors servers of RBD type and may be used for one or more host physical machines
sheepdog- Specifies one of the sheepdog servers (default is localhost:7000) and can be used one or none of the host physical machines
gluster- Specifies a server running a glusterd daemon and may be used for only only one host physical machine. The valid values for transport attribute are
unix. If nothing is specified,
tcpis assumed. If transport is
socketattribute specifies path to unix socket.
<address>- Ties the disk to a given slot of a controller. The actual
<controller>device can often be inferred by but it can also be explicitly specified. The
typeattribute is mandatory, and is typically
drive. For a
pcicontroller, additional attributes for
functionmust be present, as well as optional
multifun ctiondefaults to
off. For a
drivecontroller, additional attributes
unitare available, each with a default setting of
auth- Provides the authentication credentials needed to access the source. It includes a mandatory attribute
username, which identifies the user name to use during authentication, as well as a sub-element
secretwith mandatory attribute
type. More information can be found here at Device Elements
geometry- Provides the ability to override geometry settings. This mostly useful for S390 DASD-disks or older DOS-disks.
cyls- Specifies the number of cylinders.
heads- Specifies the number of heads.
secs- Specifies the number of sectors per track.
trans- Specifies the BIOS-Translation-Modus and can have the following values:
blockio- Allows the block device to be overridden with any of the block device properties listed below:
logical_block_size- reports to the guest virtual machine virtual machine OS and describes the smallest units for disk I/O.
physical_block_size- reports to the guest virtual machine virtual machine OS and describes the disk's hardware sector size which can be relevant for the alignment of disk data.