Source:
private void initVmTemplate() { List<OvfEntityData> ovfEntityList = unregisteredOVFDataDao.getByEntityIdAndStorageDomain(getParameters().getContainerId(), getParameters().getStorageDomainId()); if (!ovfEntityList.isEmpty()) { try { ovfEntityData = ovfEntityList.get(0); FullEntityOvfData fullEntityOvfData = ovfHelper.readVmTemplateFromOvf(ovfEntityData.getOvfData()); if (Guid.isNullOrEmpty(getParameters().getClusterId())) { mapCluster(fullEntityOvfData); } vmTemplateFromConfiguration.setClusterId(getParameters().getClusterId()); mapVnicProfiles(vmTemplateFromConfiguration.getInterfaces()); setVmTemplate(vmTemplateFromConfiguration); setEffectiveCompatibilityVersion(CompatibilityVersionUtils.getEffective(getVmTemplate(), this::getCluster)); vmHandler.updateMaxMemorySize(getVmTemplate(), getEffectiveCompatibilityVersion()); getParameters().setVmTemplate(vmTemplateFromConfiguration); getParameters().setDestDomainId(ovfEntityData.getStorageDomainId()); getParameters().setSourceDomainId(ovfEntityData.getStorageDomainId()); getParameters().setDbUsers(fullEntityOvfData.getDbUsers()); getParameters().setUserToRoles(fullEntityOvfData.getUserToRoles()); if (getParameters().getDiskTemplateMap() != null) { ArrayList imageList = new ArrayList<>(getParameters().getDiskTemplateMap().values()); vmTemplateFromConfiguration.setDiskList(imageList); ensureDomainMap(imageList, getParameters().getDestDomainId()); } } catch (OvfReaderException e) { log.error("Failed to parse a given ovf configuration: {}:\n{}", e.getMessage(), ovfEntityData.getOvfData()); log.debug("Exception", e); } } setClusterId(getParameters().getClusterId()); if (getCluster() != null) { setStoragePoolId(getCluster().getStoragePoolId()); } }

Target:
private void initVmTemplate() { List<OvfEntityData> ovfEntityList = unregisteredOVFDataDao.getByEntityIdAndStorageDomain(getParameters().getContainerId(), getParameters().getStorageDomainId()); if (!ovfEntityList.isEmpty()) { try { ovfEntityData = ovfEntityList.get(0); FullEntityOvfData fullEntityOvfData = ovfHelper.readVmTemplateFromOvf(ovfEntityData.getOvfData()); if (Guid.isNullOrEmpty(getParameters().getClusterId())) { mapCluster(fullEntityOvfData); } vmTemplateFromConfiguration.setClusterId(getParameters().getClusterId()); drMappingHelper.mapVnicProfiles(vmTemplateFromConfiguration.getInterfaces(), getParameters().getExternalVnicProfileMappings()); setVmTemplate(vmTemplateFromConfiguration); setEffectiveCompatibilityVersion(CompatibilityVersionUtils.getEffective(getVmTemplate(), this::getCluster)); vmHandler.updateMaxMemorySize(getVmTemplate(), getEffectiveCompatibilityVersion()); getParameters().setVmTemplate(vmTemplateFromConfiguration); getParameters().setDestDomainId(ovfEntityData.getStorageDomainId()); getParameters().setSourceDomainId(ovfEntityData.getStorageDomainId()); getParameters().setDbUsers(fullEntityOvfData.getDbUsers()); getParameters().setUserToRoles(fullEntityOvfData.getUserToRoles()); if (getParameters().getDiskTemplateMap() != null) { ArrayList imageList = new ArrayList<>(getParameters().getDiskTemplateMap().values()); vmTemplateFromConfiguration.setDiskList(imageList); ensureDomainMap(imageList, getParameters().getDestDomainId()); } } catch (OvfReaderException e) { log.error("Failed to parse a given ovf configuration: {}:\n{}", e.getMessage(), ovfEntityData.getOvfData()); log.debug("Exception", e); } } setClusterId(getParameters().getClusterId()); if (getCluster() != null) { setStoragePoolId(getCluster().getStoragePoolId()); } }