sureshanaparti commented on code in PR #9178:
URL: https://github.com/apache/cloudstack/pull/9178#discussion_r1628855602
##########
engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java:
##########
@@ -1462,6 +1450,23 @@ public void orchestrateStart(final String vmUuid, final
Map<VirtualMachineProfil
}
}
+ private void updateOverCommitRatioForVmProfile(VirtualMachineProfile
vmProfile, long clusterId) {
+ final ClusterDetailsVO clusterDetailCpu =
_clusterDetailsDao.findDetail(clusterId,
VmDetailConstants.CPU_OVER_COMMIT_RATIO);
+ final ClusterDetailsVO clusterDetailRam =
_clusterDetailsDao.findDetail(clusterId,
VmDetailConstants.MEMORY_OVER_COMMIT_RATIO);
+
+ if (userVmDetailsDao.findDetail(vmProfile.getId(),
VmDetailConstants.CPU_OVER_COMMIT_RATIO) == null &&
+ (Float.parseFloat(clusterDetailCpu.getValue()) > 1f ||
Float.parseFloat(clusterDetailRam.getValue()) > 1f)) {
+ userVmDetailsDao.addDetail(vmProfile.getId(),
VmDetailConstants.CPU_OVER_COMMIT_RATIO, clusterDetailCpu.getValue(), true);
+ userVmDetailsDao.addDetail(vmProfile.getId(),
VmDetailConstants.MEMORY_OVER_COMMIT_RATIO, clusterDetailRam.getValue(), true);
+ } else if (userVmDetailsDao.findDetail(vmProfile.getId(),
VmDetailConstants.CPU_OVER_COMMIT_RATIO) != null) {
+ userVmDetailsDao.addDetail(vmProfile.getId(),
VmDetailConstants.CPU_OVER_COMMIT_RATIO, clusterDetailCpu.getValue(), true);
+ userVmDetailsDao.addDetail(vmProfile.getId(),
VmDetailConstants.MEMORY_OVER_COMMIT_RATIO, clusterDetailRam.getValue(), true);
Review Comment:
both cases, same values are set
--
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]