You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/09/03 04:26:25 UTC

[GitHub] [cloudstack] davidjumani commented on a change in pull request #5369: kvm: Add check if host meets the minimum requirements

davidjumani commented on a change in pull request #5369:
URL: https://github.com/apache/cloudstack/pull/5369#discussion_r701574722



##########
File path: python/lib/cloudutils/serviceConfig.py
##########
@@ -495,6 +495,30 @@ def config(self):
             logging.debug(formatExceptionInfo())
             return False
 
+class hostConfig(serviceCfgBase):
+    def __init__(self, syscfg):
+        super(hostConfig, self).__init__(syscfg)
+        self.serviceName = "Host"
+
+    def config(self):
+        try:
+            cfo = configFileOps("/etc/cloudstack/agent/agent.properties", self)
+            reservedMemory = float(cfo.getEntry("host.reserved.mem.mb").strip() or 1024)
+            totalMemory = float(bash("awk '/MemTotal/ { printf \"%.3f \\n\", $2/1024 }' /proc/meminfo").getStdout().strip())
+            if totalMemory < reservedMemory or totalMemory < 4096 :
+                raise CloudRuntimeException("CloudStack requires a minimum of 4096 MB and more than %d MB memory since %d MB is reserved" %(reservedMemory, reservedMemory))

Review comment:
       By default 1 GB is reserved
   https://github.com/apache/cloudstack/blob/main/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java#L1038
   
   Should I then update the docs since it says a min of 4GB is required?
   http://docs.cloudstack.apache.org/en/latest/installguide/overview/_requirements.html#host-hypervisor-system-requirements
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org