Virtual App Import V App
Creates a new entity in this resource pool.
The import process consists of two steps:
- Create the VMs and/or vApps that make up the entity.
- Upload virtual disk contents.
In step 1, the client must wait for the server to create all inventory objects. It does that by monitoring the state property on the HttpNfcLease object returned from this call. When the server is done creating objects, the lease will change to the ready state, and step 2 begins. If an error occurs while the server is creating inventory objects, the lease will change to the error state, and the import process is aborted.
In step 2, the client uploads disk contents using the URLs provided in the info property of the lease. The client must call HttpNfcLeaseProgress on the lease periodically to keep the lease alive and report progress to the server. Failure to do so will cause the lease to time out, and the import process will be aborted.
When the client is done uploading disks, it completes the lease by calling HttpNfcLeaseComplete. The client can also abort the import process by calling HttpNfcLeaseAbort.
If the import process fails, is aborted, or times out, all created inventory objects are removed, including all virtual disks.
This operation only works if the folder's childType includes VirtualMachine.
Depending on the properties of the virtual machine bring imported, additional privileges may be required. See CreateVM_Task for a description of these privileges.
Required privileges: VApp.Import
The unique identifier for the managed object to which the method attaches; the serialized managed object reference for a request has the form moType/moId
, in this case VirtualApp/{moId}
.
The vSphere release schema. The current specification covers vSphere 9.0.0.0 APIs.
"ImportVAppRequestType Object"
An ImportSpec describing what to import.
The folder to which the entity will be attached.
Required privileges: VApp.Import
The target host on which the entity will run. This must specify a host that is a member of the ComputeResource indirectly specified by the pool. For a stand-alone host or a cluster with DRS, host can be omitted, and the system selects a default.
a HttpNfcLease object which is used to drive the import session.
"MoRefHttpNfcLease Object"
VmConfigFault: if a VM configSpec has incorrect values. Typically, a more specific subclass is thrown.
OutOfBounds: if Host.capability.maxSupportedVMs is exceeded.
FileAlreadyExists: if the requested cfgPath for the virtual machine's configuration file already exists.
FileFault: if there is a problem creating the virtual machine on disk. Typically, a more specific subclass, such as NoDiskSpace, will be thrown.
DuplicateName: if another virtual machine in the same folder already has the specified target name.
InvalidName: if the name is not a valid entity name.
NotSupported: if the virtual machine is being created within a folder whose childType property is not set to "VirtualMachine", a vApp is being imported into a resource pool that does not support nested resource pools, or a virtual machine is being imported into a resource pool and no folder is given.
InsufficientResourcesFault: if this operation would violate a resource usage policy.
InvalidDatastore: if the operation cannot be performed on the target datastores.
VmWwnConflict: if the WWN of the virtual machine has been used by other virtual machines.
"VimFault Object"
curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '[{}]' https://{api_host}/sdk/vim25/{release}/VirtualApp/{moId}/ImportVApp