cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kis...@apache.org
Subject [1/2] git commit: updated refs/heads/master to 227567c
Date Thu, 19 Dec 2013 17:38:17 GMT
Updated Branches:
  refs/heads/4.3 8c29760db -> c39431ff6
  refs/heads/master 9190b0305 -> 227567cf6


CLOUDSTACK-5554: Custom disk offering allows to create a datadisk with size greater than custom.diskoffering.size.max
value


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

Branch: refs/heads/master
Commit: 227567cf6ca79c7bc398b55f2eee4d8fb93c0de4
Parents: 9190b03
Author: Harikrishna Patnala <harikrishna.patnala@citrix.com>
Authored: Thu Dec 19 18:21:07 2013 +0530
Committer: Kishan Kavala <kishan@cloud.com>
Committed: Thu Dec 19 22:56:34 2013 +0530

----------------------------------------------------------------------
 server/src/com/cloud/vm/UserVmManagerImpl.java | 24 ++++++++++-----------
 1 file changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/227567cf/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 f58a451..c1d0fc0 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -2520,19 +2520,19 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Vir
         if (tmp != null) {
             size = tmp;
         }
-        DiskOfferingVO diskOffering = _diskOfferingDao.findById(diskOfferingId);
-        if (diskOffering.isCustomized()) {
-            if (diskSize == null) {
-                throw new InvalidParameterValueException("This disk offering requires a custom
size specified");
-            }
-            Long customDiskOfferingMaxSize = volumeMgr.CustomDiskOfferingMaxSize.value();
-            Long customDiskOfferingMinSize = volumeMgr.CustomDiskOfferingMinSize.value();
-            if ((diskSize < customDiskOfferingMinSize) || (diskSize > customDiskOfferingMaxSize))
{
-                throw new InvalidParameterValueException("VM Creation failed. Volume size:
" + diskSize + "GB is out of allowed range. Max: " + customDiskOfferingMaxSize + " Min:" +
-                        customDiskOfferingMinSize);
-            }
-        }
         if (diskOfferingId != null) {
+            DiskOfferingVO diskOffering = _diskOfferingDao.findById(diskOfferingId);
+            if (diskOffering != null && diskOffering.isCustomized()) {
+                if (diskSize == null) {
+                    throw new InvalidParameterValueException("This disk offering requires
a custom size specified");
+                }
+                Long customDiskOfferingMaxSize = volumeMgr.CustomDiskOfferingMaxSize.value();
+                Long customDiskOfferingMinSize = volumeMgr.CustomDiskOfferingMinSize.value();
+                if ((diskSize < customDiskOfferingMinSize) || (diskSize > customDiskOfferingMaxSize))
{
+                    throw new InvalidParameterValueException("VM Creation failed. Volume
size: " + diskSize + "GB is out of allowed range. Max: " + customDiskOfferingMaxSize + " Min:"
+
+                            customDiskOfferingMinSize);
+                }
+            }
             size += _diskOfferingDao.findById(diskOfferingId).getDiskSize();
         }
         resourceLimitCheck(owner, new Long(offering.getCpu()), new Long(offering.getRamSize()));


Mime
View raw message