Updated Branches:
  refs/heads/master ccf2851ca -> 29e90f835

CS-15429: When an instance is created with data volume, account limit for this 
data volume was not checked against. Adding a check for that.
Signed-off-by: Nitin Mehta<[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/29e90f83
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/29e90f83
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/29e90f83

Branch: refs/heads/master
Commit: 29e90f8358a0c4d2efc708a55ae3178bc2f88393
Parents: ccf2851
Author: Deepti Dohare <[email protected]>
Authored: Tue Jul 10 06:01:02 2012 +0530
Committer: U-nitin-PC\nitin <nitin@nitin-PC.(none)>
Committed: Tue Jul 10 06:02:30 2012 +0530

----------------------------------------------------------------------
 server/src/com/cloud/vm/UserVmManagerImpl.java |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/29e90f83/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java 
b/server/src/com/cloud/vm/UserVmManagerImpl.java
index b3fac70..635a943 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -2243,8 +2243,9 @@ public class UserVmManagerImpl implements UserVmManager, 
UserVmService, Manager
         }
 
         // check if account/domain is with in resource limits to create a new 
vm
+        boolean isIso = Storage.ImageFormat.ISO == template.getFormat();
         _resourceLimitMgr.checkResourceLimit(owner, ResourceType.user_vm);
-        _resourceLimitMgr.checkResourceLimit(owner, ResourceType.volume);
+        _resourceLimitMgr.checkResourceLimit(owner, ResourceType.volume, 
(isIso || diskOfferingId == null ? 1 : 2));
 
         //verify security group ids
         if (securityGroupIdList != null) {
@@ -2274,7 +2275,7 @@ public class UserVmManagerImpl implements UserVmManager, 
UserVmService, Manager
         if (listZoneTemplate == null || listZoneTemplate.isEmpty()) {
             throw new InvalidParameterValueException("The template " + 
template.getId() + " is not available for use");
         }
-        boolean isIso = Storage.ImageFormat.ISO == template.getFormat();
+
         if (isIso && !template.isBootable()) {
             throw new InvalidParameterValueException("Installing from ISO 
requires an ISO that is bootable: " + template.getId());
         }

Reply via email to