Vcenter Ovfs deploy$Task

Vcenter Ovfs deploy$Task

Deploy an OVF on a resource pool.

Deployment creates a new Virtual Machine(VM) or Virtual Appliance(VApp), from an OVF located on a web-server, in the specified folder and attached to a resource pool.

The descriptor OVF is downloaded, parsed and its validity is verified against the provided deployment constraints(if any). The files referenced in the descriptor are then downloaded and processed. In case of OVA, files are extracted and processed. If file-paths in OVF are not absolute then they are assumed to be relative to the descriptor URL.

The import process consists of two parts:

    • Create the VMs and/or VApps that make up the entity.
    • Upload virtual disk contents.

In part 1: The server creates all inventory objects. If an error occurs while creating inventory objects the import process is aborted, task reflects a failure.

In part 2: The server transfers disk contents using from the URL location.

When the server is done transferring disks, if there are no Guest customization or PowerOn specified the task completes, else those requested operations are performed.

If the import process fails or times out, all created inventory objects are removed, including all virtual disks. Note: if VC is abruptly stopped in the middle of this task cleanup might not be able to happen in time.

This operation only works if the folder's childType includes required VM privilege VirtualMachine.Inventory.Create.

By default Pull mode is leveraged unless user specifies otherwise. On vCenter server the privilege VApp.PullFromUrls is required if default behaviour is performed.

This operation was added in vSphere API 9.0.0.0.

Returns an authorization error if you do not have all of the privileges described as follows:

  • The resource ResourcePool referenced by the property Vcenter Ovfs DeploySpec.resource_pool requires Resource.AssignVMToPool and VApp.Import.
  • The resource Datastore referenced by the property Vcenter Ovfs DatastoreInfo.datastore requires Datastore.AllocateSpace.
  • The resource Folder referenced by the property Vcenter Ovfs DeploySpec.folder requires VirtualMachine.Inventory.Create and VApp.Import.
Request
URI
POST
https://{api_host}/api/vcenter/ovfs?action=deploy&vmw-task=true
COPY
Request Body

Specification for deployment.

Vcenter Ovfs DeploySpec of type(s) application/json
Required

Show optional properties

{
    "url": "string",
    "name": "string",
    "vm_home_datastore": {}
}
{
    "url": "string",
    "resource_pool": "string",
    "folder": "string",
    "name": "string",
    "host_system": "string",
    "network_mapping": {
        "network_mapping": {
            "net_type": "string",
            "network": "string"
        }
    },
    "vm_home_datastore": {
        "datastore": "string"
    },
    "disk_provisioning": "string",
    "pull_from_esx": false,
    "signature_required": false,
    "skip_manifest_check": false,
    "power_on": false,
    "custom_http_headers": {
        "custom_http_headers": "string"
    },
    "custom_properties": {
        "custom_properties": "string"
    },
    "source_certificate": "string",
    "deployment_option": "string"
}
string As uri As uri
url
Required

The HTTP location of the source OVF files or OVA.

This property was added in vSphere API 9.0.0.0.

string
resource_pool
Optional

The resource pool where the VM or vApp will deploy. Currently required but in the future versions may become optional.

This property was added in vSphere API 9.0.0.0.

if missing or null or empty, the deployment will fail.

When clients pass a value of this schema as a parameter, the property must be an identifier for the resource type: ResourcePool. When operations return a value of this schema as a response, the property will be an identifier for the resource type: ResourcePool.

string
folder
Optional

The folder where the VirtualMachine will be placed.

This property was added in vSphere API 9.0.0.0.

if missing or null or empty, the folder will be set to vmFolder in the datacenter where the resource pool is.

When clients pass a value of this schema as a parameter, the property must be an identifier for the resource type: Folder. When operations return a value of this schema as a response, the property will be an identifier for the resource type: Folder.

string
name
Required

The name of the VM or vApp being deployed as specified by an OVF.

This property was added in vSphere API 9.0.0.0.

string
host_system
Optional

The identifier of the host being deployed to.

This property was added in vSphere API 9.0.0.0.

If missing or null, a suitable host will be picked if possible, meeting datastore and network constraints.

When clients pass a value of this schema as a parameter, the property must be an identifier for the resource type: HostSystem. When operations return a value of this schema as a response, the property will be an identifier for the resource type: HostSystem.

object
network_mapping
Optional

The networkMapping defines user choices for mapping of a network as specified by the OVF descriptor to a Network in the inventory.

This property was added in vSphere API 9.0.0.0.

If missing or null, no network mapping is used.

vm_home_datastore
Required

The datastore selection for VM's home directory.

This property was added in vSphere API 9.0.0.0.

string
disk_provisioning
Optional

The optional disk provisioning type used upon deployment. If set all the disks in the deployed OVF will have the same specified disk type (e.g., thin provisioned).

For more information see: Vcenter Ovfs DiskProvisioningType.

This property was added in vSphere API 9.0.0.0.

If missing or null, the type will be set to thick.

boolean
pull_from_esx
Optional

Use Push mode for transferring VM files to ESX. Push mode transfers files from source to ESXi, whereas in Pull mode ESX "pulls" the files directly from source. The user needs privilege VApp.PullFromUrls in vCenter to use Pull mode.

This property was added in vSphere API 9.0.0.0.

If missing or null, the default is set to Pull mode.

boolean
signature_required
Optional

Require that the OVF package includes both a certificate (.cert) file and a manifest (.mf) file. The certificate file contains a vendor-supplied public key and the signature of the manifest file as signed with the vendor-supplied private key.

This property was added in vSphere API 9.0.0.0.

If missing or null, the default is set to false.

boolean
skip_manifest_check
Optional

Skip manifest validation. The manifest validation involves validating format and content of the manifest file. In Push mode of deployment all SHA entries present in the manifest file are validated against SHA digest of transferred files. If value is true and manifest file is not present a warning is generated.

This property was added in vSphere API 9.0.0.0.

If missing or null, the default is set to false.

boolean
power_on
Optional

Whether to power on the deployed entity.

This property was added in vSphere API 9.0.0.0.

If missing or null, the default is set to false.

object
custom_http_headers
Optional

Use this optional field to specify any custom headers required by the source server, including authenticating headers.

This property was added in vSphere API 9.0.0.0.

If missing or null, no headers are used to access source.

object
custom_properties
Optional

These parameters will apply to OVF Properties to customize the guest OS after it is deployed. These parameters specify values for corresponding ovf:Property flags. Example: if ovf:Property has ovf:key="ip" and desrired value is "1.2.3.4" then an entry would be added which would map "ip" to "1.2.3.4".

This property was added in vSphere API 9.0.0.0.

If missing or null, no customization is done.

string
source_certificate
Optional

Optionally used for HTTPS source validation. The source is the location where the OVF/OVA files are located. The source server certificate in PEM format.

This property was added in vSphere API 9.0.0.0.

If missing or null, no certificate is used.

string
deployment_option
Optional

The key of the chosen deployment option. If empty, the default option is chosen. The list of available deployment options can optionally be specified in the OVF file being deployed and this key specifies which one to use for deployment from that list.

This property was added in vSphere API 9.0.0.0.

Authentication
This operation uses the following authentication methods.
Responses
202

The Vcenter Ovfs DeployResult of the newly created entity.

Returns string of type(s) application/json
Operation doesn't return any data structure

400

Vapi Std Errors InvalidArgument If any of the specified parameters is invalid.

Vapi Std Errors UnverifiedPeer If vCenter Server cannot validate the certificate of the server that supplies the OVF file.
The value of the data property of Vapi Std Errors Error will be a schema that contains all the properties defined in CertificateInfo.

Returns Vapi Std Errors Error of type(s) application/json
"Vapi Std Errors Error Object"
array of object
messages
Required

Stack of one or more localizable messages for human error consumers.

The message at the top of the stack (first in the list) describes the error from the perspective of the operation the client invoked.

Each subsequent message in the stack describes the "cause" of the prior message.

object
data
Optional

Data to facilitate clients responding to the operation reporting a standard error to indicating that it was unable to complete successfully.

Operations may provide data that clients can use when responding to errors. Since the data that clients need may be specific to the context of the operation reporting the error, different operations that report the same error may provide different data in the error. The documentation for each each operation will describe what, if any, data it provides for each error it reports.

The Vapi Std Errors ArgumentLocations, Vapi Std Errors FileLocations, and Vapi Std Errors TransientIndication schemas are intended as possible values for this property. Vapi Std DynamicID may also be useful as a value for this property (although that is not its primary purpose). Some resources may provide their own specific schemas for use as the value of this property when reporting errors from their operations.

Some operations will not set this property when reporting errors.

string
error_type
Required

Discriminator field to help API consumers identify the structure type.

For more information see: Vapi Std Errors Error Type.

This property was added in vSphere API 6.7.2.

Can be missing or null for compatibility with preceding implementations.


401

if the user can not be authenticated.

Returns Vapi Std Errors Unauthenticated of type(s) application/json
This response body class contains all of the following: InlineVapi Std Errors Unauthenticated0
"Vapi Std Errors Unauthenticated Object"
string
challenge
Optional

Indicates the authentication challenges applicable to the target API provider. It can be used by a client to discover the correct authentication scheme to use. The exact syntax of the value is defined by the specific provider, the protocol and authentication schemes used.

For example, a provider using REST may adhere to the WWW-Authenticate HTTP header specification, RFC7235, section 4.1. In this case an example challenge value may be: SIGN realm="27da1358-2ba4-11e9-b210-d663bd873d93",sts="http://vcenter/sso?vsphere.local", Basic realm="vCenter"

This property was added in vSphere API 7.0.0.0.

This property is optional because it was added in a newer version than its parent node.


404

If the resource pool is not found.

Returns Vapi Std Errors NotFound of type(s) application/json
This response body class contains all of the following: InlineVapi Std Errors NotFound0
"Vapi Std Errors NotFound Object"

500

If the system reports an error while responding to the request.

Returns Vapi Std Errors Error of type(s) application/json
"Vapi Std Errors Error Object"
array of object
messages
Required

Stack of one or more localizable messages for human error consumers.

The message at the top of the stack (first in the list) describes the error from the perspective of the operation the client invoked.

Each subsequent message in the stack describes the "cause" of the prior message.

object
data
Optional

Data to facilitate clients responding to the operation reporting a standard error to indicating that it was unable to complete successfully.

Operations may provide data that clients can use when responding to errors. Since the data that clients need may be specific to the context of the operation reporting the error, different operations that report the same error may provide different data in the error. The documentation for each each operation will describe what, if any, data it provides for each error it reports.

The Vapi Std Errors ArgumentLocations, Vapi Std Errors FileLocations, and Vapi Std Errors TransientIndication schemas are intended as possible values for this property. Vapi Std DynamicID may also be useful as a value for this property (although that is not its primary purpose). Some resources may provide their own specific schemas for use as the value of this property when reporting errors from their operations.

Some operations will not set this property when reporting errors.

string
error_type
Required

Discriminator field to help API consumers identify the structure type.

For more information see: Vapi Std Errors Error Type.

This property was added in vSphere API 6.7.2.

Can be missing or null for compatibility with preceding implementations.


Code Samples
COPY
                    curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"name:"string","url:"string","vm_home_datastore":"{}"}' https://{api_host}/api/vcenter/ovfs?action=deploy&vmw-task=true