syed commented on a change in pull request #2120: CLOUDSTACK-9665 List hosts
api does not report correct cpu and memory?
URL: https://github.com/apache/cloudstack/pull/2120#discussion_r127312316
##########
File path: server/src/com/cloud/api/query/dao/HostJoinDaoImpl.java
##########
@@ -154,8 +154,10 @@ public HostResponse newHostResponse(HostJoinVO host,
EnumSet<HostDetails> detail
Long mem = host.getMemReservedCapacity() +
host.getMemUsedCapacity();
Long cpu = host.getCpuReservedCapacity() +
host.getCpuUsedCapacity();
+ hostResponse.setMemoryTotal(mem);
+ Float totalMemorywithOverprovisioning=new
Float((host.getTotalMemory()*ApiDBUtils.getMemOverprovisioningFactor(host.getClusterId())));
+
hostResponse.setMemWithOverprovisioning(totalMemorywithOverprovisioning.toString());
Review comment:
Hey guys,
Looks like there is a flaw with the logic. We have a cluster of XenServer
hosts with 512 GB of RAM and the UI shows ~170 GB of RAM. This is not even
including the overprovisioning factor. Can you please check the logic around
here
here `getMemReservedCapacity` is for most cases 0 which leads to `mem =
host.getMemUsedCapacity()` and later `hostResponse.setMemoryTotal(mem)` which
is wrong. Can you please explain the logic here? @bvbharatk @karuturi ?
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services