Source:
<code>public Response add(VM vm) { validateParameters(vm, "name", "cluster.id|name"); validateEnums(VM.class, vm); Response response = null; if (isCreateFromSnapshot(vm)) { response = createVmFromSnapshot(vm); } else { validateParameters(vm, "template.id|name"); Guid templateId = getTemplateId(vm); VmStatic staticVm = getMapper(VM.class, VmStatic.class).map(vm, getMapper(VmTemplate.class, VmStatic.class).map(lookupTemplate(templateId), null)); if (namedCluster(vm)) { staticVm.setvds_group_id(getClusterId(vm)); } UsbPolicy usbPolicy = UsbResourceUtils.getUsbPolicy(vm.getUsb(), lookupCluster(staticVm.getvds_group_id())); if (usbPolicy != null) { staticVm.setusb_policy(usbPolicy); } if (!isFiltered()) { if (vm.isSetPlacementPolicy() && vm.getPlacementPolicy().isSetHost() && vm.getPlacementPolicy().getHost().isSetName() && !vm.getPlacementPolicy().getHost().isSetId()) { vm.getPlacementPolicy().getHost().setId(getHostId(vm.getPlacementPolicy().getHost().getName())); } } else { vm.setPlacementPolicy(null); } Guid storageDomainId = (vm.isSetStorageDomain() && vm.getStorageDomain().isSetId()) ? asGuid(vm.getStorageDomain().getId()) : Guid.Empty; if (isCreateFromSnapshot(vm)) { <START> createVmFromSnapshot(vm); <END> } else if (vm.isSetDisks() && vm.getDisks().isSetClone() && vm.getDisks().isClone()) { response = cloneVmFromTemplate(staticVm, vm, templateId); } else if (Guid.Empty.equals(templateId)) { response = addVmFromScratch(staticVm, vm, storageDomainId); } else { response = addVm(staticVm, vm, storageDomainId, templateId); } } return removeRestrictedInfoFromResponse(response); }</code><technical_language>this-use case is</technical_language>

Target:
public Response add(VM vm) { validateParameters(vm, "name", "cluster.id|name"); validateEnums(VM.class, vm); Response response = null; if (isCreateFromSnapshot(vm)) { response = createVmFromSnapshot(vm); } else { validateParameters(vm, "template.id|name"); Guid templateId = getTemplateId(vm); VmStatic staticVm = getMapper(VM.class, VmStatic.class).map(vm, getMapper(VmTemplate.class, VmStatic.class).map(lookupTemplate(templateId), null)); if (namedCluster(vm)) { staticVm.setvds_group_id(getClusterId(vm)); } UsbPolicy usbPolicy = UsbResourceUtils.getUsbPolicy(vm.getUsb(), lookupCluster(staticVm.getvds_group_id())); if (usbPolicy != null) { staticVm.setusb_policy(usbPolicy); } if (!isFiltered()) { if (vm.isSetPlacementPolicy() && vm.getPlacementPolicy().isSetHost() && vm.getPlacementPolicy().getHost().isSetName() && !vm.getPlacementPolicy().getHost().isSetId()) { vm.getPlacementPolicy().getHost().setId(getHostId(vm.getPlacementPolicy().getHost().getName())); } } else { vm.setPlacementPolicy(null); } Guid storageDomainId = (vm.isSetStorageDomain() && vm.getStorageDomain().isSetId()) ? asGuid(vm.getStorageDomain().getId()) : Guid.Empty; if (vm.isSetDisks() && vm.getDisks().isSetClone() && vm.getDisks().isClone()) { response = cloneVmFromTemplate(staticVm, vm, templateId); } else if (Guid.Empty.equals(templateId)) { response = addVmFromScratch(staticVm, vm, storageDomainId); } else { response = addVm(staticVm, vm, storageDomainId, templateId); } } return removeRestrictedInfoFromResponse(response); }