weizhouapache commented on a change in pull request #5428:
URL: https://github.com/apache/cloudstack/pull/5428#discussion_r705266075
##########
File path: server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
##########
@@ -4927,10 +4927,10 @@ public void finalizeStop(VirtualMachineProfile profile,
Answer answer) {
if (owner.getState() == Account.State.disabled) {
throw new PermissionDeniedException("The owner of " + vm + " is
disabled: " + vm.getAccountId());
}
- if (VirtualMachineManager.ResoureCountRunningVMsonly.value()) {
+ if (!VirtualMachineManager.ResoureCountRunningVMsonly.value()) {
// check if account/domain is with in resource limits to start a
new vm
ServiceOfferingVO offering =
_serviceOfferingDao.findById(vm.getId(), vm.getServiceOfferingId());
- resourceLimitCheck(owner, vm.isDisplayVm(), new
Long(offering.getCpu()), new Long(offering.getRamSize()));
+ resourceLimitCheck(owner, vm.isDisplayVm(),
Long.valueOf(offering.getCpu()), Long.valueOf(offering.getRamSize()));
Review comment:
@Pearl1594 @shwstppr
if resource.count.running.vms.only is false, the resources (cpu/memory) of
the vm have already been added to resource count of domain/account, when we
create the vm. so it is not needed to check the resource limitation when we
start the vm.
https://github.com/apache/cloudstack/blob/f6073052aa3d592d6d737990a95c44e702908d59/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java#L4246-L4247
--
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]