soreana commented on code in PR #6809:
URL: https://github.com/apache/cloudstack/pull/6809#discussion_r1073396749


##########
engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java:
##########
@@ -1862,4 +1871,50 @@ public void propagateChangeToAgents(Map<String, String> 
params) {
             sendCommandToAgents(hostsPerZone, params);
         }
     }
+
+    @Override
+    public void updateCapacityOfHosts() {
+        Map<Long, List<Long>> hostsByZone = new HashMap<>();
+        Map<String, String> params = new HashMap<>();
+        boolean status = true;
+        List<HostVO> allHosts = 
_resourceMgr.listAllHostsInAllZonesByType(Host.Type.Routing);
+        if (CollectionUtils.isEmpty(allHosts)) {
+            return;
+        }
+
+        String value = HOST_RESERVED_MEM_MB.value().toString();
+        params.put(HOST_RESERVED_MEM_MB.key(), value);
+        for (HostVO host : allHosts) {
+            Long zoneId = host.getDataCenterId();
+            try {
+                // Update the "ram" for all hosts
+                long updatedHostRam = (host.getTotalMemory() + 
host.getDom0MinMemory()) - (Integer.parseInt(value) * 1024L * 1024L);

Review Comment:
   Done 👍 



-- 
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]

Reply via email to