Configuring a volume as storage device

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

  1. Configure the volume.
    1. Configure the volume as virtual disk.
      raw image file: qcow2 image file:
      disk type attribute: volume volume
      disk device attribute: disk disk
      (see <disk>)
    2. 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.
    3. 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.
    4. Specify virtio as the virtual server disk device type.
      target bus attribute: virtio
      (see <target> as child element of <disk>)
  2. Identify the image file on the host.

    Specify the image file name.

    source pool attribute: <pool-name>
    source volume attribute: <volume-name>
    (see <source> as child element of <disk>)
  3. Identify the device on the virtual server.
    1. 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.

      target dev attribute: <logical-device-name>
      (see <target> as child element of <disk>)
    2. 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.

      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: 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>