boards.io

kvm

Virtual / emulated Multiple (emulated or host)

Inheritance

  1. kvm
  2. base

Key facts

Vendor
Virtual / Generic
Bootloader family
Virtual / emulated
Architecture
Multiple (emulated or host) (guessed from the name)
Connections
serial

Deploy methods

image

Boot methods

qemu

Fixed settings (2)

VariableValue
base_guest_fs_sizeguestfs_size | default(512)
qemu_guest_fs_driveidguestfs_driveid | default('lavatest')
{# device_type: kvm #}
{% extends 'base.jinja2' %}
{% block body %}

# allow job context override - use a different variable name, undefined if not in job context
{% set base_guest_fs_size = guestfs_size | default(512) %}

{% set qemu_guest_fs_driveid = guestfs_driveid | default('lavatest') %}

actions:
  deploy:
    methods:
      image:
        parameters:
          guest:
            size: {{ base_guest_fs_size }}  # in Mb
            interface: {{ arch | qemu_guest_fs_interface(guestfs_interface) }}
            driveid: {{ qemu_guest_fs_driveid }}
  boot:
    connections:
      serial:
    methods:
      qemu:
        parameters:
          command:
{% if arch == 'arm64' %}
            qemu-system-aarch64
{% elif arch == 'amd64' %}
            qemu-system-x86_64
{% elif arch == 'i386' %}
            qemu-system-x86
{% endif %}
          boot_options:
{% if arch == 'arm64' %}
            {root: '{{ boot_root|default("/dev/vda2") }} rw rootwait', console: {{ boot_console|default('ttyAMA0 115200') }}, ip: dhcp, mem: 1024M}
{% elif arch == 'amd64' %}
            {root: {{ boot_root|default('/dev/sda1') }},
             console: {{ boot_console|default('ttyS0,115200') }},
             boot_order: {{ installer_boot_order }}}
{% else %}
            {root: {{ boot_root|default('/dev/sda1') }}, console: {{ boot_console|default('ttyS0,115200') }}}
{% endif %}
          options:
{% block qemu_options %}
          - -nographic
          - -enable-kvm
          - -cpu host
          - -net nic,model=virtio,macaddr={{ mac_addr|default('52:54:00:12:34:58') }} -net {{ netdevice|default('user') }}
          - -m {{ memory|default(512) }}
{% endblock qemu_options %}
{% endblock body %}

Rendered with the default values (no device dictionary), using LAVA's own template environment.