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.
29
29
30
30
` libvirt_vm_arch ` : CPU architecture, default is ` x86_64 ` .
31
31
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
+
32
38
` libvirt_vm_volumes ` : a list of volumes to attach to the VM. Each volume is
33
39
defined with the following dict:
34
40
- ` 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:
22
22
# CPU architecture.
23
23
libvirt_vm_arch : x86_64
24
24
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
+
25
31
# List of volumes.
26
32
libvirt_vm_volumes : []
27
33
Original file line number Diff line number Diff line change 4
4
<vcpu >{{ libvirt_vm_vcpus }}</vcpu >
5
5
<clock sync =" localtime" />
6
6
<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 >
8
8
</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 >
12
12
<devices >
13
13
<emulator >{{ libvirt_vm_emulator }}</emulator >
14
14
{% for volume in libvirt_vm_volumes %}
You can’t perform that action at this time.
0 commit comments