Virtual App Import V App

Virtual App Import V App

Creates a new entity in this resource pool.

The import process consists of two steps:

  1. Create the VMs and/or vApps that make up the entity.
  2. 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

Request
URI
POST
https://{vcenter-host}/sdk/vim25/{release}/VirtualApp/{moId}/ImportVApp
COPY
Path Parameters
string
moId
Required

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}.

string
release
Required

The vSphere release schema. The current specification covers vSphere 8.0.2.0 APIs.


Request Body
ImportVAppRequestType of type(s) application/json
Required
{
    "spec": {
        "_typeName": "string",
        "entityConfig": {
            "_typeName": "string",
            "key": {
                "_typeName": "string",
                "type": "string",
                "value": "string"
            },
            "tag": "string",
            "startOrder": 0,
            "startDelay": 0,
            "waitingForGuest": false,
            "startAction": "string",
            "stopDelay": 0,
            "stopAction": "string",
            "destroyWithParent": false
        },
        "instantiationOst": {
            "_typeName": "string",
            "id": "string",
            "type": "string",
            "section": [
                {
                    "_typeName": "string",
                    "lineNumber": 0,
                    "xml": "string"
                }
            ],
            "child": [
                "OvfConsumerOstNode Object"
            ],
            "entity": {
                "_typeName": "string",
                "type": "string",
                "value": "string"
            }
        }
    },
    "folder": {
        "_typeName": "string",
        "type": "string",
        "value": "string"
    },
    "host": {
        "_typeName": "string",
        "type": "string",
        "value": "string"
    }
}
spec
Required

An ImportSpec is used when importing VMs or vApps.

It can be built from scratch, or it can be generated from an OVF descriptor using the service interface OvfManager.

This class is the abstract base for VirtualMachineImportSpec and VirtualAppImportSpec. These three classes form a composite structure that allows us to contain arbitrarily complex entitites in a single ImportSpec.

folder
Optional

Reference to an instance of the Folder managed object.

host
Optional

Reference to an instance of the HostSystem managed object.

Authentication
This operation uses the following authentication methods.
Responses
200

a HttpNfcLease object which is used to drive the import session.

Returns MoRefHttpNfcLease of type(s) application/json
This response body class contains all of the following: ManagedObjectReference
{
    "_typeName": "string",
    "type": "string",
    "value": "string"
}

500

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.

Returns VimFault of type(s) application/json
This response body class contains all of the following: MethodFault
{
    "_typeName": "string",
    "faultCause": "MethodFault Object",
    "faultMessage": [
        {
            "_typeName": "string",
            "key": "string",
            "arg": [
                {
                    "_typeName": "string",
                    "key": "string",
                    "value": {
                        "_typeName": "string"
                    }
                }
            ],
            "message": "string"
        }
    ]
}

Virtual App Operations
POST
Virtual App Clone V App Task
POST
Virtual App Create Child VM Task
POST
Virtual App Create Resource Pool
POST
Virtual App Create V App
POST
Virtual App Destroy Task
POST
Virtual App Destroy Children
POST
Virtual App Export V App
GET
Virtual App Get Alarm Actions Enabled
GET
Virtual App Get Available Field
GET
Virtual App Get Child Configuration
GET
Virtual App Get Child Link
GET
Virtual App Get Config
GET
Virtual App Get Config Issue
GET
Virtual App Get Config Status
GET
Virtual App Get Custom Value
GET
Virtual App Get Datastore
GET
Virtual App Get Declared Alarm State
GET
Virtual App Get Disabled Method
GET
Virtual App Get Effective Role
GET
Virtual App Get Name
GET
Virtual App Get Namespace
GET
Virtual App Get Network
GET
Virtual App Get Overall Status
GET
Virtual App Get Owner
GET
Virtual App Get Parent
GET
Virtual App Get Parent Folder
GET
Virtual App Get Parent V App
GET
Virtual App Get Permission
GET
Virtual App Get Recent Task
GET
Virtual App Get Resource Pool
GET
Virtual App Get Runtime
GET
Virtual App Get Summary
GET
Virtual App Get Tag
GET
Virtual App Get Triggered Alarm State
GET
Virtual App Get Value
GET
Virtual App Get V App Config
GET
Virtual App Get Vm
POST
Virtual App Import V App
POST
Virtual App Move Into Resource Pool
POST
Virtual App Power Off V App Task
POST
Virtual App Power On V App Task
POST
Virtual App Query Resource Config Option
POST
Virtual App Refresh Runtime
POST
Virtual App Register Child VM Task
POST
Virtual App Reload
POST
Virtual App Rename Task
POST
Virtual App Set Custom Value
POST
Virtual App Suspend V App Task
POST
Virtual App Unregister V App Task
POST
Virtual App Update Child Resource Configuration
POST
Virtual App Update Config
POST
Virtual App Update Linked Children
POST
Virtual App Update V App Config