rhtyd commented on a change in pull request #5369:
URL: https://github.com/apache/cloudstack/pull/5369#discussion_r700955847
##########
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))
+
+ if not bash('uname -a | grep x86_64').isSuccess() :
+ raise CloudRuntimeException("Unsupported CPU Architecture.
CloudStack requires x86_64 CPU Architecture")
+
+ if int(bash('ifconfig | grep "^\\w" | grep -iv "^lo" | wc
-l').getStdout()) < 1 :
Review comment:
We may want to use iproute2, ifconfig I think may not be available on
recent Ubuntu (by default)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]