An alternative to configuring storage pool volumes like image files is to configure them as virtual disks of type
volume. Use this variation only if you rely completely on the libvirt storage pool management, and
if you do not intend to migrate virtual servers accessing this
device to a different host.
Before you begin
Make sure that the storage pool and the volume are configured and defined.
Procedure
-
Configure the volume.
-
Configure the volume as virtual disk.
|
raw image file: |
qcow2 image file: |
| disk type attribute: |
volume |
volume |
| disk device attribute: |
disk |
disk |
(see
<disk>)
-
Specify the user space process that implements the device.
|
raw image file: |
qcow2 image file: |
| driver name attribute: |
qemu |
qemu |
| driver io attribute: |
native |
native |
| driver type attribute: |
raw |
qcow2 |
| driver cache attribute: |
<cache-mode> |
<cache-mode> |
(see
<driver> as child element of <disk>)
Where
<cache-mode> determines the QEMU caching strategy.
Tip: For most configurations, the none
value is appropriate.
- 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.
-
Specify virtio as the virtual server disk device
type.
-
Identify the image file on the host.
Specify the image file name.
-
Identify the device on the virtual server.
-
Specify a unique logical device name.
Logical device names are of the form vd<x>, where
<x> can be one or more letters. Do not confuse the logical device name with
the standard device name. The standard device name is assigned to the device on the virtual server in the order the device is detected. It is not
persistent across guest reboots.
- Optional:
Specify a device number.
You specify a device bus-ID of the form
fe.n.dddd
where
n
is the subchannel set-ID and
dddd is the device number. The channel subsystem-ID
0xfe is reserved to the virtual channel.
The virtual server sees the channel subsystem-ID
0x0 instead.
Example: KVM host
device bus-ID fe.0.0009 is seen by the virtual server as device bus-ID 0.0.0009.
If you do not specify a device number, a device bus-ID is automatically generated by using the
first available device bus-ID starting with subchannel set-ID 0x0 and device number
0x0000.
Example
This example configures logical volume blk-pool0-vol0 from the LVM pool blk-pool0 as a virtual
block device.
<disk type="volume" device="disk">
<driver name="qemu" type="raw" io="native" cache="none"/>
<source pool="blk-pool0" volume="blk-pool0-vol0"/>
<target dev="vdb" bus="virtio"/>
<address type="ccw" cssid="0xfe" ssid="0x0" devno="0x0009"/>
</disk>