server: Check the max data volumes limit using the actual hypervisor version (#4122)

Fix to pick the max data volumes limit using the actual hypervisor version, instead of "default" version. Use the hypervisor version in the host table when product_version parameter in host details doesn't exist or is empty

Fixes #4101
This commit is contained in:
sureshanaparti 2020-06-15 08:28:57 +05:30 committed by GitHub
parent b4937725b0
commit 185d44a265
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3097,7 +3097,11 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
Integer maxDataVolumesSupported = null;
if (host != null) {
_hostDao.loadDetails(host);
maxDataVolumesSupported = _hypervisorCapabilitiesDao.getMaxDataVolumesLimit(host.getHypervisorType(), host.getDetail("product_version"));
String hypervisorVersion = host.getDetail("product_version");
if (org.apache.commons.lang.StringUtils.isBlank(hypervisorVersion)) {
hypervisorVersion = host.getHypervisorVersion();
}
maxDataVolumesSupported = _hypervisorCapabilitiesDao.getMaxDataVolumesLimit(host.getHypervisorType(), hypervisorVersion);
} else {
HypervisorType hypervisorType = vm.getHypervisorType();
if (hypervisorType != null && CollectionUtils.isNotEmpty(supportingDefaultHV) && supportingDefaultHV.contains(hypervisorType)) {