| 1 | <domain type='kvm'> |
| 2 | <name>{{ vm.name }}</name> |
| 3 | {% if 'uuid' in vm %} |
| 4 | <uuid>{{ vm.uuid }}</uuid> |
| 5 | {% endif %} |
| 6 | <memory unit='KiB'>{{ vm.memory }}</memory> |
| 7 | <vcpu placement='static'>{{ vm.vcpu }}</vcpu> |
| 8 | <os> |
| 9 | <type arch='x86_64' machine='pc-q35-4.2'>hvm</type> |
| 10 | {% if 'efi' in vm and vm.efi %} |
| 11 | <loader readonly="yes" type="pflash">/usr/share/OVMF/OVMF_CODE_4M.fd</loader> |
| 12 | <nvram>/var/lib/libvirt/qemu/nvram/{% vm.name %}_VARS.fd</nvram> |
| 13 | {% endif %} |
| 14 | <bootmenu enable='yes'/> |
| 15 | </os> |
| 16 | <features> |
| 17 | <acpi/> |
| 18 | <apic/> |
| 19 | <vmport state='off'/> |
| 20 | </features> |
| 21 | <cpu mode='host-model' check='partial'/> |
| 22 | <clock offset='utc'> |
| 23 | <timer name='rtc' tickpolicy='catchup'/> |
| 24 | <timer name='pit' tickpolicy='delay'/> |
| 25 | <timer name='hpet' present='no'/> |
| 26 | </clock> |
| 27 | <on_poweroff>destroy</on_poweroff> |
| 28 | <on_reboot>restart</on_reboot> |
| 29 | <on_crash>destroy</on_crash> |
| 30 | <pm> |
| 31 | <suspend-to-mem enabled='no'/> |
| 32 | <suspend-to-disk enabled='no'/> |
| 33 | </pm> |
| 34 | <devices> |
| 35 | <emulator>/usr/bin/qemu-system-x86_64</emulator> |
| 36 | <disk type='file' device='cdrom'> |
| 37 | <driver name='qemu' type='raw'/> |
| 38 | <target dev='sda' bus='sata'/> |
| 39 | {% if 'cdrom' in vm %} |
| 40 | <source file='{{vm.cdrom}}'/> |
| 41 | {% endif %} |
| 42 | <readonly/> |
| 43 | <address type='drive' controller='0' bus='0' target='0' unit='0'/> |
| 44 | <boot order='2'/> |
| 45 | </disk> |
| 46 | {% if 'disk' in vm %} |
| 47 | <disk type='file' device='disk'> |
| 48 | <driver name='qemu' type='qcow2' discard='unmap'/> |
| 49 | <source file='{{vm.disk}}'/> |
| 50 | <target dev='sdb' bus='sata'/> |
| 51 | <address type='drive' controller='0' bus='0' target='0' unit='1'/> |
| 52 | <boot order='1'/> |
| 53 | </disk> |
| 54 | {% endif %} |
| 55 | <controller type='usb' index='0' model='ich9-ehci1'> |
| 56 | <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x7'/> |
| 57 | </controller> |
| 58 | <controller type='usb' index='0' model='ich9-uhci1'> |
| 59 | <master startport='0'/> |
| 60 | <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x0' multifunction='on'/> |
| 61 | </controller> |
| 62 | <controller type='usb' index='0' model='ich9-uhci2'> |
| 63 | <master startport='2'/> |
| 64 | <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x1'/> |
| 65 | </controller> |
| 66 | <controller type='usb' index='0' model='ich9-uhci3'> |
| 67 | <master startport='4'/> |
| 68 | <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x2'/> |
| 69 | </controller> |
| 70 | <controller type='scsi' index='0' model='virtio-scsi'> |
| 71 | <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> |
| 72 | </controller> |
| 73 | <controller type='sata' index='0'> |
| 74 | <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> |
| 75 | </controller> |
| 76 | <controller type='pci' index='0' model='pcie-root'/> |
| 77 | <controller type='pci' index='1' model='pcie-root-port'> |
| 78 | <model name='pcie-root-port'/> |
| 79 | <target chassis='1' port='0x10'/> |
| 80 | <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/> |
| 81 | </controller> |
| 82 | <controller type='pci' index='2' model='pcie-root-port'> |
| 83 | <model name='pcie-root-port'/> |
| 84 | <target chassis='2' port='0x11'/> |
| 85 | <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/> |
| 86 | </controller> |
| 87 | <controller type='pci' index='3' model='pcie-root-port'> |
| 88 | <model name='pcie-root-port'/> |
| 89 | <target chassis='3' port='0x12'/> |
| 90 | <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/> |
| 91 | </controller> |
| 92 | <controller type='pci' index='4' model='pcie-root-port'> |
| 93 | <model name='pcie-root-port'/> |
| 94 | <target chassis='4' port='0x13'/> |
| 95 | <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x3'/> |
| 96 | </controller> |
| 97 | <controller type='pci' index='5' model='pcie-root-port'> |
| 98 | <model name='pcie-root-port'/> |
| 99 | <target chassis='5' port='0x14'/> |
| 100 | <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x4'/> |
| 101 | </controller> |
| 102 | <controller type='pci' index='6' model='pcie-root-port'> |
| 103 | <model name='pcie-root-port'/> |
| 104 | <target chassis='6' port='0x15'/> |
| 105 | <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x5'/> |
| 106 | </controller> |
| 107 | <controller type='virtio-serial' index='0'> |
| 108 | <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> |
| 109 | </controller> |
| 110 | <interface type='bridge'> |
| 111 | <mac/> |
| 112 | <source bridge='{{vm.net_bridge}}'/> |
| 113 | <model type='virtio'/> |
| 114 | <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> |
| 115 | </interface> |
| 116 | <serial type='pty'> |
| 117 | <target type='isa-serial' port='0'> |
| 118 | <model name='isa-serial'/> |
| 119 | </target> |
| 120 | </serial> |
| 121 | <console type='pty'> |
| 122 | <target type='serial' port='0'/> |
| 123 | </console> |
| 124 | <channel type='unix'> |
| 125 | <target type='virtio' name='org.qemu.guest_agent.0'/> |
| 126 | <address type='virtio-serial' controller='0' bus='0' port='1'/> |
| 127 | </channel> |
| 128 | <channel type='spicevmc'> |
| 129 | <target type='virtio' name='com.redhat.spice.0'/> |
| 130 | <address type='virtio-serial' controller='0' bus='0' port='2'/> |
| 131 | </channel> |
| 132 | <input type='tablet' bus='usb'> |
| 133 | <address type='usb' bus='0' port='1'/> |
| 134 | </input> |
| 135 | <input type='mouse' bus='ps2'/> |
| 136 | <input type='keyboard' bus='ps2'/> |
| 137 | <graphics type='spice' autoport='yes'> |
| 138 | <listen type='address' address='0.0.0.0'/> |
| 139 | </graphics> |
| 140 | <audio id='1' type='spice'/> |
| 141 | <video> |
| 142 | <model type='virtio' heads='1' primary='yes'/> |
| 143 | <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> |
| 144 | </video> |
| 145 | <redirdev bus='usb' type='spicevmc'> |
| 146 | <address type='usb' bus='0' port='2'/> |
| 147 | </redirdev> |
| 148 | <redirdev bus='usb' type='spicevmc'> |
| 149 | <address type='usb' bus='0' port='3'/> |
| 150 | </redirdev> |
| 151 | <memballoon model='virtio'> |
| 152 | <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/> |
| 153 | </memballoon> |
| 154 | <rng model='virtio'> |
| 155 | <backend model='random'>/dev/urandom</backend> |
| 156 | <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/> |
| 157 | </rng> |
| 158 | </devices> |
| 159 | </domain> |