summaryrefslogtreecommitdiff
path: root/roles
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2020-06-29 22:46:07 +0200
committerChristian Pointner <equinox@spreadspace.org>2020-07-01 11:37:40 +0200
commit7a846cdbcf6a66cc0cc529613272b74579a517dc (patch)
treec0cb40bca53d861f55d663ffe6c976015acaa29d /roles
parentsimplified partman early command (diff)
minor improvment for vm resource config
Diffstat (limited to 'roles')
-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 %}