File tree Expand file tree Collapse file tree 3 files changed +16
-4
lines changed Expand file tree Collapse file tree 3 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,12 @@ attempt to auto-detect the correct emulator to use.
2929
3030` libvirt_vm_arch ` : CPU architecture, default is ` x86_64 ` .
3131
32+ ` libvirt_vm_machine ` : Virtual machine type. Default is ` None ` if
33+ ` libvirt_vm_engine ` is ` kvm ` , otherwise ` pc-1.0 ` .
34+
35+ ` libvirt_vm_cpu_mode ` : Virtual machine CPU mode. Default is ` host-passthrough `
36+ if ` libvirt_vm_engine ` is ` kvm ` , otherwise ` host-model ` .
37+
3238` libvirt_vm_volumes ` : a list of volumes to attach to the VM. Each volume is
3339defined with the following dict:
3440- ` name ` : Name to associate with the volume being created.
Original file line number Diff line number Diff line change @@ -22,6 +22,12 @@ libvirt_vm_emulator:
2222# CPU architecture.
2323libvirt_vm_arch : x86_64
2424
25+ # Virtual machine type.
26+ libvirt_vm_machine : " {{ None if libvirt_vm_engine == 'kvm' else 'pc-1.0' }}"
27+
28+ # Virtual machine CPU mode.
29+ libvirt_vm_cpu_mode : " {{ 'host-passthrough' if libvirt_vm_engine == 'kvm' else 'host-model' }}"
30+
2531# List of volumes.
2632libvirt_vm_volumes : []
2733
Original file line number Diff line number Diff line change 44 <vcpu >{{ libvirt_vm_vcpus }}</vcpu >
55 <clock sync =" localtime" />
66 <os >
7- <type arch =' {{ libvirt_vm_arch }}' >hvm</type >
7+ <type arch =' {{ libvirt_vm_arch }}' {% if libvirt_vm_machine is not none %} machine = ' {{ libvirt_vm_machine }} ' {% endif %} >hvm</type >
88 </os >
9- {% if libvirt_vm_engine == 'kvm' %}
10- < cpu mode = ' host-passthrough ' />
11- {% endif %}
9+ < cpu {% if libvirt_vm_cpu_mode is not none %} mode = ' {{ libvirt_vm_cpu_mode }} ' {% endif %} >
10+ < model fallback = ' allow ' />
11+ </ cpu >
1212 <devices >
1313 <emulator >{{ libvirt_vm_emulator }}</emulator >
1414{% for volume in libvirt_vm_volumes %}
You can’t perform that action at this time.
0 commit comments