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 05:27:58 UTC

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

abhinandanprateek 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_r120537286
 
 

 ##########
 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:
   We can include the list of hypervisor supporting custom root disk size in a method in the HypervisorType class itself. 
 
----------------------------------------------------------------
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