software-infrastructure/templates/qemu-vm.xml.j2
2024-10-25 10:25:04 -04:00

55 lines
3.8 KiB
Django/Jinja

<domain type='{{ item.domain.type }}'>
<name>{{ item.domain.name }}</name>
<memory unit='{{ item.domain.memory.unit }}'>{{ item.domain.memory.value }}</memory>
<vcpu placement='{{ item.domain.vcpu.placement }}'>{{ item.domain.bcpu.value }}</vcpu>
<os>
<type arch='{{ item.domain.os.type.arch }}' machine='{{ item.domain.os.type.machine }}'>{{ item.domain.os.type.value }}</type>
<boot dev='{{ item.domain.os.boot.dev }}'/>
</os>
<cpu mode='{{ item.domain.cpu.mode }}' check='{{ item.domain.cpu.check }}'/>
<devices>
<emulator>{{ item.domain.devices.emulator }}</emulator>
{% for disk in item.domain.devices.disks %}
<disk type='{{ disk.type }}' device='{{ disk.device }}'>
<driver name='{{ disk.driver.name }}' type='{{ disk.driver.type }}'/>
<source file='{{ disk.source.file }}'/>
<target dev='{{ disk.target.dev }}' bus='{{ disk.target.bus }}'/>
<address type='{{ disk.target.address.type }}' domain='{{ disk.target.address.domain }}' bus='{{ disk.target.address.bus }}' slot='{{ disk.target.address.slot }}' function='{{ disk.target.address.function }}'/>
</disk>
{% endfor %}
{% for interface in item.domain.devices.interfaces %}
<interface type='{{ interface.type }}'>
<source network='{{ interface.source.network }}'/>
<model type='{{ interface.model.type }}'/>
<address type='{{ interface.target.address.type }}' domain='{{ interface.target.address.domain }}' bus='{{ interface.target.address.bus }}' slot='{{ interface.target.address.slot }}' function='{{ interface.target.address.function }}'/>
</interface>
{% endfor %}
{% for channel in item.domain.devices.channels %}
<channel type='channel.type'>
<target type='{{ channel.target.type }}' name='{{ channel.target.name }}'/>
<address type='{{ channel.address.type }}' controller='{{ channel.address.controller }}' bus='{{ channel.address.bus }}' port='{{ channel.address.port }}'/>
</channel>
{% end for %}
{% for input in item.domain.devices.inputs %}
<input type='{{ input.type }}' bus='{{ input.bus }}'>
<address type='{{ input.address.type }}' bus='{{ input.address.bus }}' port='{{ input.address.port }}'/>
</input>
{% end for %}
<graphics type='{{ item.domain.devices.graphics.type }}' autoport='{{ item.domain.devices.graphics.autoport }}'>
<listen type='{{ item.domain.devices.graphics.listen.type }}'/>
<image compression='{{ item.domain.devices.graphics.image.compression }}'/>
</graphics>
<video>
<model type='{{ item.domain.devices.video.model.type }}' ram='{{ item.domain.devices.video.model.ram }}' vram='{{ item.domain.devices.video.model.vram }}' vgamem='{{ devices.video.model.vgamem }}' heads='{{ devices.video.model.heads }}' primary='{{ devices.video.model.primary }}'/>
<address type='{{ item.domain.devices.video.address.type }}' domain='{{ item.domain.devices.video.address.domain }}' bus='{{ item.domain.devices.video.address.bus }}' slot='{{ item.domain.devices.video.address.slot }}' function='{{ item.domain.devices.video.address.function }}'/>
</video>
<memballoon model='{{ item.domain.devices.memballoon.model }}'>
<address type='{{ item.domain.devices.memballoon.address.type }}' domain='{{ item.domain.devices.memballoon.address.domain }}' bus='{{ item.domain.devices.memballoon.address.bus }}' slot='{{ item.domain.devices.memballoon.address.slot }}' function='{{ item.domain.devices.memballoon.address.function }}'/>
</memballoon>
<rng model='virtio'>
<backend model='random'>/dev/urandom</backend>
<address type='{{ item.domain.devices.rng.address.type }}' domain='{{ item.domain.devices.rng.address.domain }}' bus='{{ item.domain.devices.rng.address.bus }}' slot='{{ item.domain.devices.rng.address.slot }}' function='{{ item.domain.devices.rng.address.function }}'/>
</rng>
</devices>
</domain>