{% extends 'base.jinja2' %} {% block vland %} {% endblock vland %} {% block body %} device_type: qemu # 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_interface = guestfs_interface | default('ide') %} available_architectures: - arm64 - arm - aarch64 - amd64 - x86_64 - i386 actions: deploy: methods: nfs: image: parameters: guest: size: {{ base_guest_fs_size }} # in Mb interface: {{ qemu_guest_fs_interface }} boot: connections: serial: ssh: methods: qemu: {% block qemu_method %} parameters: command: {% if arch == 'arm64' or arch == 'aarch64' %} qemu-system-aarch64 {% elif arch == 'arm' %} qemu-system-arm {% elif arch == 'amd64' or arch == 'x86_64' %} qemu-system-x86_64 {% elif arch == 'i386' %} qemu-system-i386 {% endif %} # used by installers to relate to the empty target device boot_options: {% if arch == 'arm64' or arch == 'aarch64' %} {root: '{{ boot_root|default("/dev/vda2") }} rw rootwait', console: {{ boot_console|default('ttyAMA0 115200') }}, ip: dhcp, mem: 1024M} {% elif arch == 'arm' %} {% elif arch == 'amd64' %} {root: {{ boot_root|default('/dev/sda1') }}, console: '{{ boot_console|default('ttyS0,115200') }}', boot_order: c} {% else %} {root: {{ boot_root|default('/dev/sda1') }}, console: {{ boot_console|default('ttyS0,115200') }}} {% endif %} options: {% block qemu_options %} {% if arch == 'arm64' or arch == 'aarch64' or arch == 'arm' %} - -cpu {{ cpu|default('cortex-a57') }} - -machine {{ machine|default('virt') }} {% if vga %} - {{ vga }} {% endif %} {% if serial %} - {{ serial }} {% endif %} {% else %} {% if not no_kvm %} - -cpu host - -enable-kvm {% endif %} {% endif %} - -nographic - -net nic,{{ model|default('model=virtio') }},macaddr={{ mac_addr|default('52:54:00:12:34:58') }} -net {{ netdevice|default('user') }} - -m {{ memory|default(512) }} - -monitor {{ monitor|default('none') }} {# If you need to pass -soundhw in extra_options, then see doc/v2/qemu_options.rst for how to set the environment var QEMU_AUDIO_DRV=none #} {% if extra_options %} extra: {{ extra_options }} {% endif %} {% endblock qemu_options -%} {% endblock qemu_method %} qemu-nfs: {{ self.qemu_method() }} append: console: {{ console_device|default('ttyAMA0') }} root: /dev/nfs nfsrootargs: {{ base_nfsroot_args }} ipargs: {{ base_ip_args }} {% endblock body %}