vishesh92 commented on code in PR #12403:
URL: https://github.com/apache/cloudstack/pull/12403#discussion_r2730919688


##########
server/src/main/java/com/cloud/capacity/CapacityManagerImpl.java:
##########
@@ -704,22 +704,16 @@ public void updateCapacityForHost(final Host host) {
                 so = 
_offeringsDao.findByIdIncludingRemoved(vm.getServiceOfferingId());
             }
             if (so.isDynamic()) {
-                usedMemory +=
-                    
((Integer.parseInt(vmDetails.get(UsageEventVO.DynamicParameters.memory.name())) 
* 1024L * 1024L) / ramOvercommitRatio) *
-                        clusterRamOvercommitRatio;
+                usedMemory += 
Integer.parseInt(vmDetails.get(UsageEventVO.DynamicParameters.memory.name())) * 
1024L * 1024L;

Review Comment:
   The value of `cpuOvercommitRatio` for a VM can only be changed when the VM 
is stopped. When the VM is started, the value is reset to the cluster's 
`cpu.overprovisioning.factor`.
   
   This basically means that `ramOvercommitRatio` is always equal to 
`clusterRamOvercommitRatio` & `cpuOvercommitRatio` is equal to 
`clusterCpuOvercommitRatio`. Before this change, we were just multiplying and 
then divided the value with the same number.



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