incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject [16/17] git commit: 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<nitin.mehta@citrix.com>
Date Wed, 11 Jul 2012 20:18:07 GMT
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<nitin.mehta@citrix.com>


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/vpc
Commit: 29e90f8358a0c4d2efc708a55ae3178bc2f88393
Parents: ccf2851
Author: Deepti Dohare <deepti.dohare@citrix.com>
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());
         }


Mime
View raw message