bernardodemarco commented on code in PR #11616:
URL: https://github.com/apache/cloudstack/pull/11616#discussion_r2372349887


##########
server/src/main/java/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java:
##########
@@ -399,7 +399,7 @@ public VMSnapshot allocVMSnapshot(Long vmId, String 
vsDisplayName, String vsDesc
         _accountMgr.checkAccess(caller, null, true, userVmVo);
 
         // check max snapshot limit for per VM
-        int vmSnapshotMax = VMSnapshotManager.VMSnapshotMax.value();
+        int vmSnapshotMax = 
VMSnapshotManager.VMSnapshotMax.valueIn(userVmVo.getAccountId());

Review Comment:
   @harikrishna-patnala, great question, I've just verified the behavior for 
this scenario.
   
   When the VM is created in a project, it'll be mapped to the project account. 
Given that it is not possible to define values for settings in the scope of 
this account type, the Management Server will consider the value defined in the 
global scope. 
   
   The following example illustrates the error message when trying to create 
two VM snapshots for a project VM, with the `vmsnapshot.max` defined as `1` in 
the global scope:
   
   <img width="2268" height="592" alt="image" 
src="https://github.com/user-attachments/assets/d97a9fba-2c23-43ba-90d4-0d8c1c245173";
 />
   
   ---
   
   > may be consider the caller account id ?
   
   Since a project is composed by different accounts, which can freely 
manipulate the project's resources, this could lead to some inconsistent 
behaviors. Thus, I think it would be better to maintain the current behavior. 
   



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