private OvfCreateImportSpecParams getOvfCreateImportSpecParams(final VmInputs vmInputs, final ManagedObjectReference hostSystem, final List ovfNetworkMappings, final List<KeyValue> ovfPropertyMappings) { final OvfCreateImportSpecParams params = new OvfCreateImportSpecParams(); params.setHostSystem(hostSystem); params.setDeploymentOption(""); params.setLocale(String.valueOf(vmInputs.getLocale())); params.setEntityName(vmInputs.getVirtualMachineName()); params.setIpAllocationPolicy(vmInputs.getIpAllocScheme()); params.setIpProtocol(vmInputs.getIpProtocol()); params.setDiskProvisioning(vmInputs.getDiskProvisioning()); params.getNetworkMapping().addAll(ovfNetworkMappings); params.getPropertyMapping().addAll(ovfPropertyMappings); return params; }
public OvfCreateImportSpecResult createImportSpec(String ovfDescriptor, ResourcePool resourcePool, Datastore datastore, OvfCreateImportSpecParams cisp) throws TaskInProgress, VmConfigFault, ConcurrentAccess, FileFault, InvalidState, InvalidDatastore, RuntimeFault, RemoteException { return getVimService().createImportSpec(getMOR(), ovfDescriptor, resourcePool.getMOR(), datastore.getMOR(), cisp); }