Source:
private void initUnregisteredVM() { List<OvfEntityData> ovfEntityDataList = unregisteredOVFDataDao.getByEntityIdAndStorageDomain(getParameters().getContainerId(), getParameters().getStorageDomainId()); if (!ovfEntityDataList.isEmpty()) { try { ovfEntityData = ovfEntityDataList.get(0); FullEntityOvfData fullEntityOvfData = ovfHelper.readVmFromOvf(ovfEntityData.getOvfData()); VM vmFromConfiguration = fullEntityOvfData.getVm(); if (Guid.isNullOrEmpty(getParameters().getClusterId())) { Cluster cluster = drMappingHelper.getMappedCluster(fullEntityOvfData.getClusterName(), vmFromConfiguration.getId(), getParameters().getClusterMap()); if (cluster != null) { getParameters().setClusterId(cluster.getId()); } } setClusterId(getParameters().getClusterId()); if (getCluster() != null && getCluster().getBiosType() != null) { vmFromConfiguration.setBiosType(getCluster().getBiosType()); } if (vmFromConfiguration.getBiosType() == null) { vmFromConfiguration.setBiosType(BiosType.CLUSTER_DEFAULT); } vmFromConfiguration.setClusterId(getParameters().getClusterId()); getParameters().setVm(vmFromConfiguration); getParameters().setDestDomainId(ovfEntityData.getStorageDomainId()); getParameters().setSourceDomainId(ovfEntityData.getStorageDomainId()); getParameters().setUserToRoles(fullEntityOvfData.getUserToRoles()); if (getParameters().getDiskMap() != null) { vmFromConfiguration.setDiskMap(getParameters().getDiskMap()); vmFromConfiguration.setImages(getDiskImageListFromDiskMap(getParameters().getDiskMap())); } drMappingHelper.mapExternalLunDisks(DisksFilter.filterLunDisks(vmFromConfiguration.getDiskMap().values()), getParameters().getExternalLunMap()); mapEntities(fullEntityOvfData); } catch (OvfReaderException e) { log.error("Failed to parse a given ovf configuration: {}:\n{}", e.getMessage(), ovfEntityData.getOvfData()); log.debug("Exception", e); } } }

Target:
private void initUnregisteredVM() { List<OvfEntityData> ovfEntityDataList = unregisteredOVFDataDao.getByEntityIdAndStorageDomain(getParameters().getContainerId(), getParameters().getStorageDomainId()); if (!ovfEntityDataList.isEmpty()) { try { ovfEntityData = ovfEntityDataList.get(0); FullEntityOvfData fullEntityOvfData = ovfHelper.readVmFromOvf(ovfEntityData.getOvfData()); VM vmFromConfiguration = fullEntityOvfData.getVm(); if (Guid.isNullOrEmpty(getParameters().getClusterId())) { Cluster cluster = drMappingHelper.getMappedCluster(fullEntityOvfData.getClusterName(), vmFromConfiguration.getId(), getParameters().getClusterMap()); if (cluster != null) { getParameters().setClusterId(cluster.getId()); } } setClusterId(getParameters().getClusterId()); if (getCluster() != null && getCluster().getBiosType() != null) { vmFromConfiguration.setClusterBiosType(getCluster().getBiosType()); } if (vmFromConfiguration.getBiosType() == null) { vmFromConfiguration.setBiosType(BiosType.CLUSTER_DEFAULT); } vmFromConfiguration.setClusterId(getParameters().getClusterId()); getParameters().setVm(vmFromConfiguration); getParameters().setDestDomainId(ovfEntityData.getStorageDomainId()); getParameters().setSourceDomainId(ovfEntityData.getStorageDomainId()); getParameters().setUserToRoles(fullEntityOvfData.getUserToRoles()); if (getParameters().getDiskMap() != null) { vmFromConfiguration.setDiskMap(getParameters().getDiskMap()); vmFromConfiguration.setImages(getDiskImageListFromDiskMap(getParameters().getDiskMap())); } drMappingHelper.mapExternalLunDisks(DisksFilter.filterLunDisks(vmFromConfiguration.getDiskMap().values()), getParameters().getExternalLunMap()); mapEntities(fullEntityOvfData); } catch (OvfReaderException e) { log.error("Failed to parse a given ovf configuration: {}:\n{}", e.getMessage(), ovfEntityData.getOvfData()); log.debug("Exception", e); } } }