You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/09/09 11:44:22 UTC

[GitHub] [cloudstack] Pearl1594 commented on a change in pull request #5428: resource limit: Fix resource limit check on VM start

Pearl1594 commented on a change in pull request #5428:
URL: https://github.com/apache/cloudstack/pull/5428#discussion_r705249470



##########
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:
       @shwstppr I was wondering the same and I think @weizhouapache may be able to provide some insight here, I didn't quite understand the usage of 'resource.count.running.vms.only' - I have currently aligned it to how the checks have been done for other operations.




-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org