Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
65 lines (52 sloc) 1.76 KB
<domain type='kvm'>
<name>{{ vm_name }}</name>
<memory unit='KiB'>4194304</memory>
<vcpu placement='static'>2</vcpu>
<resource>
<partition>/machine</partition>
</resource>
<os>
<type arch='x86_64' machine='pc'>hvm</type>
<boot dev='hd'/>
</os>
<devices>
{% if ansible_distribution == "CentOS" %}
<emulator>/usr/libexec/qemu-kvm</emulator>
{% endif %}
{% if ansible_distribution == "Fedora" %}
<emulator>/usr/bin/qemu-kvm</emulator>
{% endif %}
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='{{ netlab_virt_vm_path }}/{{ vm_name }}/{{ node.vm_disk }}'/>
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
<source file='{{ netlab_virt_vm_path }}/{{ vm_name }}/{{ node.vm_config }}'/>
<target dev='hdb' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
<interface type='bridge'>
<mac address='{{ node.mac_address }}'/>
<source bridge='{{ node.netlab_mgmt_source_bridge }}'/>
<model type='virtio'/>
</interface>
{% for link in node.connections | default([]) %}
{% if link.type | default('udp') == 'udp' %}
<interface type='udp'>
<source address='127.0.0.1' port='{{ link.s_port }}'>
<local address='127.0.0.1' port='{{ link.d_port }}'/>
</source>
<model type='virtio'/>
</interface>
{% endif %}
{% endfor %}
<serial type='tcp'>
<source mode='bind' host='0.0.0.0' service='{{ node.console_port }}' tls='no'/>
<protocol type='telnet'/>
</serial>
</devices>
</domain>