Source:
protected void init() { if (Guid.isNullOrEmpty(getParameters().getVmTemplateId())) { getParameters().setVmTemplateId(Guid.newGuid()); } setVmTemplateId(getParameters().getVmTemplateId()); getParameters().setEntityInfo(new EntityInfo(VdcObjectType.VmTemplate, getVmTemplateId())); setVmTemplateName(getParameters().getName()); VmStatic masterVm = getParameters().getMasterVm(); if (masterVm != null) { setVmId(masterVm.getId()); setClusterId(masterVm.getClusterId()); if (getVmDeviceUtils().shouldOverrideSoundDevice( masterVm, getMasterVmCompatibilityVersion(), getParameters().isSoundDeviceEnabled())) { getParameters().setSoundDeviceEnabled(true); } if (getParameters().isSoundDeviceEnabled() == null) { getParameters().setSoundDeviceEnabled(false); } if (getParameters().isConsoleEnabled() == null) { getParameters().setConsoleEnabled(false); } vmHandler.updateDefaultTimeZone(masterVm); vmHandler.autoSelectUsbPolicy(masterVm); vmHandler.autoSelectDefaultDisplayType(getVmId(), masterVm, getCluster(), getParameters().getGraphicsDevices()); vmHandler.autoSelectGraphicsDevice(getVmId(), masterVm, getCluster(), getParameters().getGraphicsDevices(), getMasterVmCompatibilityVersion()); vmHandler.autoSelectResumeBehavior(masterVm, getCluster().getCompatibilityVersion()); separateCustomProperties(masterVm); } if (getVm() != null) { updateVmDevices(); images.addAll(getVmDisksFromDB()); setStoragePoolId(getVm().getStoragePoolId()); isVmInDb = true; } else if (getCluster() != null && masterVm != null) { VM vm = new VM(masterVm, new VmDynamic(), null); vm.setClusterCompatibilityVersion(getCluster().getCompatibilityVersion()); setVm(vm); setStoragePoolId(getCluster().getStoragePoolId()); } updateDiskInfoDestinationMap(); generateTargetDiskIds(); getParameters().setUseCinderCommandCallback(!getCinderDisks().isEmpty()); }

Target:
protected void init() { if (Guid.isNullOrEmpty(getParameters().getVmTemplateId())) { getParameters().setVmTemplateId(Guid.newGuid()); } setVmTemplateId(getParameters().getVmTemplateId()); getParameters().setEntityInfo(new EntityInfo(VdcObjectType.VmTemplate, getVmTemplateId())); setVmTemplateName(getParameters().getName()); VmStatic masterVm = getParameters().getMasterVm(); if (masterVm != null) { setVmId(masterVm.getId()); setClusterId(masterVm.getClusterId()); if (getVmDeviceUtils().shouldOverrideSoundDevice( masterVm, getMasterVmCompatibilityVersion(), getParameters().isSoundDeviceEnabled())) { getParameters().setSoundDeviceEnabled(true); } if (getParameters().isSoundDeviceEnabled() == null) { getParameters().setSoundDeviceEnabled(false); } if (getParameters().isConsoleEnabled() == null) { getParameters().setConsoleEnabled(false); } vmHandler.updateDefaultTimeZone(masterVm); vmHandler.autoSelectUsbPolicy(masterVm); vmHandler.autoSelectDefaultDisplayType(getVmId(), masterVm, getCluster(), getParameters().getGraphicsDevices()); vmHandler.autoSelectGraphicsDevice(getVmId(), masterVm, getCluster(), getParameters().getGraphicsDevices(), getMasterVmCompatibilityVersion()); vmHandler.autoSelectResumeBehavior(masterVm, getCluster()); separateCustomProperties(masterVm); } if (getVm() != null) { updateVmDevices(); images.addAll(getVmDisksFromDB()); setStoragePoolId(getVm().getStoragePoolId()); isVmInDb = true; } else if (getCluster() != null && masterVm != null) { VM vm = new VM(masterVm, new VmDynamic(), null); vm.setClusterCompatibilityVersion(getCluster().getCompatibilityVersion()); setVm(vm); setStoragePoolId(getCluster().getStoragePoolId()); } updateDiskInfoDestinationMap(); generateTargetDiskIds(); getParameters().setUseCinderCommandCallback(!getCinderDisks().isEmpty()); }