rhtyd commented on a change in pull request #5142:
URL: https://github.com/apache/cloudstack/pull/5142#discussion_r660342009
##########
File path: server/src/main/java/com/cloud/hypervisor/HypervisorGuruBase.java
##########
@@ -179,9 +179,13 @@ protected VirtualMachineTO
toVirtualMachineTO(VirtualMachineProfile vmProfile) {
ServiceOffering offering =
_serviceOfferingDao.findById(vmProfile.getId(),
vmProfile.getServiceOfferingId());
VirtualMachine vm = vmProfile.getVirtualMachine();
HostVO host = hostDao.findById(vm.getHostId());
+ boolean divideMemoryByOverprovisioning = true;
+ boolean divideCpuByOverprovisioning = true;
- boolean divideMemoryByOverprovisioning =
VmMinMemoryEqualsMemoryDividedByMemOverprovisioningFactor.valueIn(host.getClusterId());
- boolean divideCpuByOverprovisioning =
VmMinCpuSpeedEqualsCpuSpeedDividedByCpuOverprovisioningFactor.valueIn(host.getClusterId());
+ if (host != null) {
Review comment:
nit - should we check both host != null and host.getClusterId != null?
(that may not be necessary but for writing defensive code)?
--
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]