Configuring a virtio block device as IPL device

Boot a guest from a virtio block device that is configured as a disk device.

Before you begin

Prepare your device with a root file system and a bootable kernel as described in the section for your device type.

Procedure

  1. Configure the disk with the root file system as a persistent device, see Configuring virtual block devices.
  2. Per default, the guest is booted from the first specified disk device in the current libvirt-internal configuration. To avoid possible errors, explicitly specify the boot device with the boot element in the disk device definition (see <boot>).


    The guest is booted from the disk with the lowest specified boot order value.

    If the specified device has a boot menu configuration, you can use the loadparm attribute of the boot element to specify a particular menu entry to be booted.


  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.

Example

The following domain configuration-XML configures V1, which is booted from the virtual block device 0xe714 on the virtual subchannel set "0x1":
<domain type="kvm">
    <name>V1</name>
    ...
    <devices>
        <emulator>/usr/bin/qemu-system-s390x</emulator>
        <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="0x1" devno="0xe714"/>
            <boot order="1"/>
        </disk>
        <disk type="block" device="disk">
            <driver name="qemu" type="raw" cache="none" io="native" iothread="1"/>
            <source dev="/dev/mapper/36005076305ffc1ae00000000000021d7"/>
            <target dev="vdb" bus="virtio"/>
            <address type="ccw" cssid="0xfe" ssid="0x0" devno="0xe716"/>
        </disk>
        ...
    </devices>
</domain>
The following domain configuration-XML configures V2, which is booted from a boot menu configuration on a virtual block device 0xe716:
<domain type="kvm">
    <name>V2</name>
    ...
    <devices>
        ...
        <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="0x1" devno="0xe714"/>
        </disk>
        <disk type="block" device="disk">
            <driver name="qemu" type="raw" cache="none" io="native" iothread="1"/>
            <source dev="/dev/mapper/36005076305ffc1ae00000000000021d7"/>
            <target dev="vdb" bus="virtio"/>
            <address type="ccw" cssid="0xfe" ssid="0x0" devno="0xe716"/>
            <boot order="1" loadparm="2"/>
        </disk>
        ...
    </devices>
</domain>
The loadparm attribute selects the second entry in the boot menu.