Github user priyankparihar commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1813#discussion_r103931610
  
    --- Diff: server/src/com/cloud/vm/UserVmManagerImpl.java ---
    @@ -3614,6 +3604,26 @@ public UserVmVO doInTransaction(TransactionStatus 
status) throws InsufficientCap
             });
         }
     
    +    public void validateRootDiskResize(final HypervisorType 
hypervisorType, Long rootDiskSize, VMTemplateVO templateVO, UserVmVO vm, final 
Map<String, String> customParameters) throws InvalidParameterValueException
    +    {
    +        // rootdisksize must be larger than template.
    +        if ((rootDiskSize << 30) < templateVO.getSize()) {
    +            Long templateVOSizeGB = templateVO.getSize() / 1024 / 1024 / 
1024;
    +            s_logger.error("unsupported: rootdisksize override is smaller 
than template size " + templateVO.getSize() + "B (" + templateVOSizeGB + "GB)");
    +            throw new InvalidParameterValueException("unsupported: 
rootdisksize override is smaller than template size " + templateVO.getSize() + 
"B (" + templateVOSizeGB + "GB)");
    +        } else if ((rootDiskSize << 30) > templateVO.getSize()){
    +            if (hypervisorType == HypervisorType.VMware && 
!vm.getDetails().get("rootDiskController").toLowerCase().contains("scsi")) {
    +                s_logger.error("Found unsupported root disk controller : " 
+ vm.getDetails().get("rootDiskController"));
    --- End diff --
    
     @borisstoyanov @serg38 Thanks for giving your valuable time. Code is 
modified. Now if everything looks ok to you then please provide your LGTM 
comment.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to