diff options
Diffstat (limited to 'roles/vm/guest')
-rw-r--r-- | roles/vm/guest/create/templates/libvirt-domain.xml.j2 | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/roles/vm/guest/create/templates/libvirt-domain.xml.j2 b/roles/vm/guest/create/templates/libvirt-domain.xml.j2 index ce7894c0..0d124566 100644 --- a/roles/vm/guest/create/templates/libvirt-domain.xml.j2 +++ b/roles/vm/guest/create/templates/libvirt-domain.xml.j2 @@ -31,6 +31,21 @@ <apic/> <pae/> </features> +{% if 'cpu' in install.vm %} + <cpu mode='{{ install.vm.cpu.mode }}'> +{% if 'model' in install.vm.cpu %} + <model>{{ install.vm.cpu.model }}</model> +{% endif %} +{% if 'topology' in install.vm.cpu %} + <topology sockets='{{ install.vm.cpu.topology.sockets }}' cores='{{ install.vm.cpu.topology.cores }}' threads='{{ install.vm.cpu.topology.threads }}'/> +{% endif %} +{% for feature, policy in (install.vm.cpu.features | default({})).items() %} + <feature policy='{{ policy }}' name='{{ feature }}'/> +{% endfor %} + </cpu> +{% else %} + <cpu mode='host-passthrough' migratable='off'/> +{% endif %} <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> {% if vm_create_installer %} |