rhtyd commented on a change in pull request #3494: [WIP DO NOT MERGE] Fix 
hardcoded max data volumes when VM has been created but not started before
URL: https://github.com/apache/cloudstack/pull/3494#discussion_r303754410
 
 

 ##########
 File path: server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java
 ##########
 @@ -3007,6 +3009,13 @@ private int getMaxDataVolumesSupported(UserVmVO vm) {
         if (host != null) {
             _hostDao.loadDetails(host);
             maxDataVolumesSupported = 
_hypervisorCapabilitiesDao.getMaxDataVolumesLimit(host.getHypervisorType(), 
host.getDetail("product_version"));
+        } else {
+            List<HypervisorType> supportingDefaultHV = 
Arrays.asList(HypervisorType.XenServer, HypervisorType.VMware,
+                    HypervisorType.KVM, HypervisorType.Ovm, 
HypervisorType.LXC);
+            HypervisorType hypervisorType = vm.getHypervisorType();
+            if (hypervisorType != null && 
supportingDefaultHV.contains(hypervisorType)) {
+                maxDataVolumesSupported = 
_hypervisorCapabilitiesDao.getMaxDataVolumesLimit(hypervisorType, "default");
 
 Review comment:
   Could version specific values cause regression or bug? 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to