[Kimchi-devel] [PATCH 2/4 v3] [Memory HotPlug] Add maxMemory into templates
Rodrigo Trujillo
rodrigo.trujillo at linux.vnet.ibm.com
Thu Jun 4 19:38:46 UTC 2015
This patch adds maxMemory value in new templates. This value is also
used when new virtual machines are created.
MaxMemory is going to be the total amount of memory of the host.
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo at linux.vnet.ibm.com>
---
src/kimchi/osinfo.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/kimchi/osinfo.py b/src/kimchi/osinfo.py
index 67d85be..35aa594 100644
--- a/src/kimchi/osinfo.py
+++ b/src/kimchi/osinfo.py
@@ -20,6 +20,7 @@
import copy
import glob
import os
+import psutil
from collections import defaultdict
from configobj import ConfigObj
@@ -181,6 +182,9 @@ def lookup(distro, version):
params['os_version'] = version
arch = _get_arch()
+ # Setting maxMemory of the VM, which will be equal total Host memory in Kib
+ params['max_memory'] = psutil.TOTAL_PHYMEM >> 10
+
# set up arch to ppc64 instead of ppc64le due to libvirt compatibility
if params["arch"] == "ppc64le":
params["arch"] = "ppc64"
--
2.1.0
More information about the Kimchi-devel
mailing list