cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject [18/41] git commit: updated refs/heads/marvin_refactor to 94b18c6
Date Thu, 18 Apr 2013 02:26:06 GMT
CLOUDSTACK-1966: Primary Storage Limits are not validated while deploying the VM

Signed-off-by: Abhinandan Prateek <aprateek@apache.org>


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

Branch: refs/heads/marvin_refactor
Commit: 0ddeb65fdf155b55f53ece7ff92f4a26e3f086b5
Parents: fad55c5
Author: Sanjay Tripathi <sanjay.tripathi@citrix.com>
Authored: Tue Apr 16 16:57:28 2013 +0530
Committer: Abhinandan Prateek <aprateek@apache.org>
Committed: Wed Apr 17 11:54:18 2013 +0530

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0ddeb65f/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 53a57c8..3ecdf42 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -2264,9 +2264,14 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Use
 
         // check if account/domain is with in resource limits to create a new vm
         boolean isIso = Storage.ImageFormat.ISO == template.getFormat();
+        long size = _templateHostDao.findByTemplateId(template.getId()).getSize();
+        if (diskOfferingId != null) {
+            size += _diskOfferingDao.findById(diskOfferingId).getDiskSize();
+        }
         resourceLimitCheck(owner, new Long(offering.getCpu()), new Long(offering.getRamSize()));
         _resourceLimitMgr.checkResourceLimit(owner, ResourceType.volume, (isIso
                 || diskOfferingId == null ? 1 : 2));
+        _resourceLimitMgr.checkResourceLimit(owner, ResourceType.primary_storage, new Long
(size));
 
         // verify security group ids
         if (securityGroupIdList != null) {


Mime
View raw message