You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by gi...@git.apache.org on 2017/06/07 06:50:31 UTC

[GitHub] koushik-das commented on a change in pull request #2088: CLOUDSTACK-9892: Primary storage resource check is broken when using ?

koushik-das commented on a change in pull request #2088: CLOUDSTACK-9892: Primary storage resource check is broken when using ?
URL: https://github.com/apache/cloudstack/pull/2088#discussion_r120546376
 
 

 ##########
 File path: server/src/com/cloud/vm/UserVmManagerImpl.java
 ##########
 @@ -3133,11 +3145,25 @@ protected UserVm createVirtualMachine(DataCenter zone, ServiceOffering serviceOf
         }
         // check if account/domain is with in resource limits to create a new vm
         boolean isIso = Storage.ImageFormat.ISO == template.getFormat();
-        // For baremetal, size can be null
-        Long tmp = _templateDao.findById(template.getId()).getSize();
         long size = 0;
-        if (tmp != null) {
-            size = tmp;
+        // custom root disk size, resizes base template to larger size
+        if (customParameters.containsKey("rootdisksize")) {
+            // only KVM, XenServer and VMware supports rootdisksize override
+            if (!(hypervisorType == HypervisorType.KVM || hypervisorType == HypervisorType.XenServer || hypervisorType == HypervisorType.VMware || hypervisorType == HypervisorType.Simulator)) {
+                throw new InvalidParameterValueException("Hypervisor " + hypervisorType + " does not support rootdisksize override");
 
 Review comment:
   In my opinion these HV checks shouldn't be there at all. Mostly these are put as the features are not implemented/tested against all HVs. These should either get get removed or moved to HV capabilities table in the DB if some HV doesn't support root resize. That said I simply moved the above code from one place to another.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services