blob: 6034dd1c81cbf515f4dff5d030cd24813bf1a8bd [file] [log] [blame]
<domain type='kvm'>
<name>{{ hostname }}</name>
<memory unit='GiB'>{{ node.node.memory | regex_replace("G$", "") }}</memory>
<currentMemory unit='GiB'>{{ node.node.memory | regex_replace("G$", "") }}</currentMemory>
<vcpu placement='static'>{{ node.node.cores }}</vcpu>
<resource>
<partition>/machine</partition>
</resource>
<os>
<type arch='x86_64' machine='pc-i440fx-2.5'>hvm</type>
<boot dev='network'/>
<boot dev='hd'/>
<bootmenu enable='no'/>
<bios useserial='yes' rebootTimeout='10000'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<cpu mode='{{ node.node.cpu_cflags }}'>
<model fallback='allow'/>
</cpu>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
{% for disk in disks %}
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='unsafe'/>
<source file='{{ vm_vol_path_prefix }}-{{ disk.name }}.qcow2'/>
<backingStore/>
<target dev='{{ disk.dev }}' bus='virtio'/>
<alias name='virtio-disk0'/>
</disk>
{% endfor %}
<controller type='ide' index='0'>
<alias name='ide'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
</controller>
<controller type='usb' index='0'>
<alias name='usb'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
<controller type='pci' index='0' model='pci-root'>
<alias name='pci.0'/>
</controller>
{%- for net_key, net_name in networks.network_mapping.iteritems() -%}
<interface type='network'>
<source network='{{ net_name }}' bridge='br_{{ net_name }}'/>
<mac address='{{ node.interfaces[idf.net_config[net_name].interface].mac_address }}'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0{{idf.net_config[net_name].interface + 3 }}' function='0x0'/>
</interface>
{%- endfor -%}
<serial type='file'>
<source path='{{ vm_console_log_path }}/{{ hostname }}_console.log'/>
<target port='1'/>
<alias name='serial0'/>
</serial>
<console type='file'>
<source path='{{ vm_console_log_path }}/{{ hostname }}_console.log'/>
<target type='serial' port='1'/>
<alias name='serial0'/>
</console>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<graphics type='vnc' port='5902' autoport='yes' listen='127.0.0.1'>
<listen type='address' address='127.0.0.1'/>
</graphics>
<video>
<model type='cirrus' vram='16384' heads='1'/>
<alias name='video0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</video>
<memballoon model='virtio'>
<alias name='balloon0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
</memballoon>
</devices>
<seclabel type='dynamic' model='apparmor' relabel='yes'>
</seclabel>
</domain>