vishesh92 commented on code in PR #8302:
URL: https://github.com/apache/cloudstack/pull/8302#discussion_r1421919912


##########
server/src/main/java/com/cloud/vm/UserVmManagerImpl.java:
##########
@@ -689,18 +689,28 @@ private void resourceLimitCheck(Account owner, Boolean 
displayVm, Long cpu, Long
     }
 
     protected void resourceCountIncrement(long accountId, Boolean displayVm, 
Long cpu, Long memory) {
-        if (! VirtualMachineManager.ResourceCountRunningVMsonly.value()) {
-            _resourceLimitMgr.incrementResourceCount(accountId, 
ResourceType.user_vm, displayVm);
-            _resourceLimitMgr.incrementResourceCount(accountId, 
ResourceType.cpu, displayVm, cpu);
-            _resourceLimitMgr.incrementResourceCount(accountId, 
ResourceType.memory, displayVm, memory);
+        if (!VirtualMachineManager.ResourceCountRunningVMsonly.value()) {
+            Transaction.execute(new TransactionCallbackNoReturn() {

Review Comment:
   Similar solution for primary_storage & volume as well.



-- 
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]

Reply via email to