3f6565e9c28ed05fad3de1e66bffe0838edb48f9
[pti/rtp.git] / okd / roles / ocloud_infra_vm / templates / virt.xml.j2
1 <domain type='kvm'>
2   <name>{{ inventory_hostname }}</name>
3   <memory unit='KiB'>{{ ocloud_infra_vm_mem_gb * 1048576 }}</memory>
4   <currentMemory unit='KiB'>{{ ocloud_infra_vm_mem_gb * 1048576 }}</currentMemory>
5   <vcpu>{{ ocloud_infra_vm_cpus }}</vcpu>
6   <os>
7     <type arch='x86_64' machine='pc'>hvm</type>
8   </os>
9   <features>
10     <acpi/>
11     <apic/>
12     <vmport state='off'/>
13   </features>
14   <cpu mode='host-model' check='partial'/>
15   <clock offset='utc'>
16     <timer name='rtc' tickpolicy='catchup'/>
17     <timer name='pit' tickpolicy='delay'/>
18     <timer name='hpet' present='no'/>
19   </clock>
20   <on_poweroff>destroy</on_poweroff>
21   <on_reboot>restart</on_reboot>
22   <on_crash>destroy</on_crash>
23   <pm>
24     <suspend-to-mem enabled='no'/>
25     <suspend-to-disk enabled='no'/>
26   </pm>
27   <devices>
28     <emulator>/usr/libexec/qemu-kvm</emulator>
29     <disk type='file' device='disk'>
30       <driver name='qemu' type='qcow2'/>
31       <source file='{{ ocloud_infra_vm_disk_path }}'/>
32       <target dev='vda' bus='virtio'/>
33       <boot order='1'/>
34       <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
35     </disk>
36     <disk type='file' device='cdrom'>
37       <driver name='qemu' type='raw'/>
38       <source file='{{ ocloud_infra_vm_image }}'/>
39       <target dev='hdb' bus='ide'/>
40       <readonly/>
41       <boot order='2'/>
42       <address type='drive' controller='0' bus='0' target='0' unit='1'/>
43     </disk>
44     <controller type='usb' index='0' model='ich9-ehci1'>
45       <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x7'/>
46     </controller>
47     <controller type='usb' index='0' model='ich9-uhci1'>
48       <master startport='0'/>
49       <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0' multifunction='on'/>
50     </controller>
51     <controller type='usb' index='0' model='ich9-uhci2'>
52       <master startport='2'/>
53       <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x1'/>
54     </controller>
55     <controller type='usb' index='0' model='ich9-uhci3'>
56       <master startport='4'/>
57       <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x2'/>
58     </controller>
59     <controller type='pci' index='0' model='pci-root'/>
60     <controller type='ide' index='0'>
61       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
62     </controller>
63     <controller type='virtio-serial' index='0'>
64       <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
65     </controller>
66     <interface type='network'>
67 {% for ocloud_host in groups['ocloud'] %}
68 {% if ocloud_host == inventory_hostname %}
69       <mac address='{{ ocloud_net_mac_prefix }}:{{ loop.index + 10 }}'/>
70 {% endif %}
71 {% endfor %}
72       <source network='{{ ocloud_net_name }}'/>
73       <model type='virtio'/>
74       <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
75     </interface>
76     <serial type='pty'>
77       <target type='isa-serial' port='0'>
78         <model name='isa-serial'/>
79       </target>
80     </serial>
81     <console type='pty'>
82       <target type='serial' port='0'/>
83     </console>
84     <input type='tablet' bus='usb'>
85       <address type='usb' bus='0' port='1'/>
86     </input>
87     <input type='mouse' bus='ps2'/>
88     <input type='keyboard' bus='ps2'/>
89     <graphics type='vnc' port='5900' autoport='yes' listen='127.0.0.1'>
90       <listen type='address' address='127.0.0.1'/>
91     </graphics>
92     <audio id='1' type='none'/>
93     <video>
94       <model type='vga' vram='16384' heads='1' primary='yes'/>
95       <alias name='video0'/>
96       <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
97     </video>
98     <memballoon model='virtio'>
99       <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
100     </memballoon>
101   </devices>
102 </domain>