summaryrefslogtreecommitdiff
path: root/roles/vm/define/templates/libvirt-domain.xml.j2
diff options
context:
space:
mode:
Diffstat (limited to 'roles/vm/define/templates/libvirt-domain.xml.j2')
-rw-r--r--roles/vm/define/templates/libvirt-domain.xml.j26
1 files changed, 3 insertions, 3 deletions
diff --git a/roles/vm/define/templates/libvirt-domain.xml.j2 b/roles/vm/define/templates/libvirt-domain.xml.j2
index be2fd8b4..c4c9e52a 100644
--- a/roles/vm/define/templates/libvirt-domain.xml.j2
+++ b/roles/vm/define/templates/libvirt-domain.xml.j2
@@ -1,8 +1,8 @@
<domain type='kvm'>
<name>{{ install_hostname }}</name>
- <memory>{{ hostvars[install_hostname].install_cooked.vm.mem * 1024 }}</memory>
- <currentMemory>{{ hostvars[install_hostname].install_cooked.vm.mem * 1024 }}</currentMemory>
- <vcpu>{{ hostvars[install_hostname].install_cooked.vm.numcpu }}</vcpu>
+ <memory>{{ ((hostvars[install_hostname].install_cooked.vm.memory | human_to_bytes) / 1024) | int }}</memory>
+ <currentMemory>{{ ((hostvars[install_hostname].install_cooked.vm.memory | human_to_bytes) / 1024) | int }}</currentMemory>
+ <vcpu>{{ hostvars[install_hostname].install_cooked.vm.numcpus }}</vcpu>
<os>
<type arch='x86_64' machine='pc-0.12'>hvm</type>
{% if vm_define_installer %}