Resource Pool Import V App

Resource Pool 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}/ResourcePool/{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 ResourcePool/{moId}.

string
release
Required

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


Request Body
ImportVAppRequestType of type(s) application/json
Required

Show optional properties

{
    "spec": {}
}
{
    "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 Infrastructure Operations
POST
Resource Pool Create Child VM Task
POST
Resource Pool Create Resource Pool
POST
Resource Pool Create V App
POST
Resource Pool Destroy Task
POST
Resource Pool Destroy Children
GET
Resource Pool Get Alarm Actions Enabled
GET
Resource Pool Get Available Field
GET
Resource Pool Get Child Configuration
GET
Resource Pool Get Config
GET
Resource Pool Get Config Issue
GET
Resource Pool Get Config Status
GET
Resource Pool Get Custom Value
GET
Resource Pool Get Declared Alarm State
GET
Resource Pool Get Disabled Method
GET
Resource Pool Get Effective Role
GET
Resource Pool Get Name
GET
Resource Pool Get Namespace
GET
Resource Pool Get Overall Status
GET
Resource Pool Get Owner
GET
Resource Pool Get Parent
GET
Resource Pool Get Permission
GET
Resource Pool Get Recent Task
GET
Resource Pool Get Resource Pool
GET
Resource Pool Get Runtime
GET
Resource Pool Get Summary
GET
Resource Pool Get Tag
GET
Resource Pool Get Triggered Alarm State
GET
Resource Pool Get Value
GET
Resource Pool Get Vm
POST
Resource Pool Import V App
POST
Resource Pool Move Into Resource Pool
POST
Resource Pool Query Resource Config Option
POST
Resource Pool Refresh Runtime
POST
Resource Pool Register Child VM Task
POST
Resource Pool Reload
POST
Resource Pool Rename Task
POST
Resource Pool Set Custom Value
POST
Resource Pool Update Child Resource Configuration
POST
Resource Pool Update Config