Use Vagrantfile to build virtual site
[icn.git] / deploy / metal3-vm / vm-setup / roles / libvirt / templates / baremetalvm.xml.j2
1 <domain type='{{ libvirt_domain_type }}'>
2   <name>{{ item.name }}</name>
3   <memory unit='MiB'>{{ flavors[item.flavor].memory }}</memory>
4   <vcpu>{{ flavors[item.flavor].vcpu }}</vcpu>
5
6   {{baremetal_vm_xml|default('')}}
7
8   <os>
9     <type arch='{{ libvirt_arch }}'>hvm</type>
10     <boot dev='network'/>
11     <bootmenu enable='no'/>
12   </os>
13   <features>
14     <acpi/>
15     <apic/>
16     <pae/>
17   </features>
18   <cpu mode='host-model'/>
19   <clock offset='utc'/>
20   <on_poweroff>destroy</on_poweroff>
21   <on_reboot>restart</on_reboot>
22   <on_crash>restart</on_crash>
23   <devices>
24     <disk type='volume' device='disk'>
25       <driver name='qemu' type='qcow2' cache='unsafe'/>
26       <source pool='{{ libvirt_volume_pool }}' volume='{{ item.name }}.qcow2'/>
27       <target dev='{{ libvirt_diskdev }}' bus='{{ libvirt_diskbus }}'/>
28     </disk>
29 {% if libvirt_diskbus == 'scsi' %}
30   <controller type='scsi' model='virtio-scsi' />
31 {% endif %}
32 {% for network in networks %}
33     <interface type='bridge'>
34       <mac address='{{ node_mac_map.get(item.name).get(network.name) }}'/>
35       <source bridge='{{ network.bridge }}'/>
36       <model type='{{ libvirt_nic_model }}'/>
37 {% if network.virtualport_type is defined %}
38       <virtualport type='{{ network.virtualport_type }}'/>
39 {% endif %}
40     </interface>
41 {% endfor %}
42     <serial type='pty'/>
43     <console type='pty'/>
44
45 {% if enable_vnc_console|bool %}
46     <input type='mouse' bus='ps2'/>
47     <graphics type='vnc' port='-1' autoport='yes'/>
48     <video>
49       <model type='cirrus' vram='9216' heads='1'/>
50     </video>
51 {% endif %}
52
53     {{baremetal_vm_device_xml|default('')}}
54
55   </devices>
56 </domain>