summaryrefslogtreecommitdiffstats
path: root/xci/playbooks/roles/create-vm-nodes/templates/vm.xml.j2
blob: e4e41edae3658f7b6d01707c494eae83262be1f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<domain type='{{ vm_domain_type }}'>
  <name>{{ vm_name }}</name>
  <memory unit='GiB'>{{ item.1.node.memory.rstrip('G') }}</memory>
  <vcpu>{{ item.1.node.cpus }}</vcpu>
  <os>
    <type arch='{{ item.1.node.arch }}' machine='{{ item.1.node.model }}'>hvm</type>
    {%- if 'opnfv' in vm_name -%}
    <boot dev='hd'/>
    {%- else -%}
    <boot dev='network'/>
    {% endif -%}
    <bootmenu enable='no'/>
    <bios useserial='yes' rebootTimeout='10000'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <cpu mode='{{ item.1.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>{{ vm_emulator }}</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='{{ vm_disk_cache }}'/>
      <source file='{{ vm_volume_path }}'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </disk>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <interface type='network'>
      <source network='{{ vm_network }}'/>
      <model type='{{ vm_nic }}'/>
      <mac address='{{ item.1.interfaces[opnfv_vm_idf.net_config.admin.interface].mac_address }}'/>
    </interface>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes'/>
    <video>
      <model type='cirrus' vram='9216' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <serial type='file'>
      <source path='{{ vm_log_file }}'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <serial type='pty'>
      <source path='/dev/pts/49'/>
      <target port='1'/>
      <alias name='serial1'/>
    </serial>
    <console type='file'>
      <source path='{{ vm_log_file }}'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </memballoon>
  </devices>
</domain>