Scripting Object - VcOvfManager

Scripting-object corresponding to
OvfManager
Attribute of
VcSdkConnection, VcServiceContent

Scripting Object Description

Service interface to parse and generate OVF descriptors.

The purpose of this interface is to make it easier for callers to import VMs and vApps from OVF packages and to export VI packages to OVF. In the following description, the term "client" is used to mean any caller of the interface.

This interface only converts between OVF and VI types. To actually import and export entities, use {@link vim.ResourcePool#importVApp ResourcePool.importVApp}, {@link vim.VirtualMachine#exportVm VirtualMachine.exportVm} and {@link vim.VirtualApp#exportVApp VirtualApp.exportVApp}.

Import

For the import scenario, the typical sequence of events is as follows:

The client calls parseDescriptor to obtain information about the OVF descriptor. This typically includes information (such as a list of networks) that must be mapped to VI infrastructure entities.

The OVF descriptor is validated against the OVF Specification, and any errors or warnings are returned as part of the ParseResult. For example, the parser might encounter a section marked required that it does not understand, or the XML descriptor might be malformed.

The client decides on network mappings, datastore, properties etc. It then calls createImportSpec to obtain the parameters needed to call {@link vim.ResourcePool#importVApp ResourcePool.importVApp}.

If any warnings are present, the client will review these and decide whether to proceed or not. If errors are present, the ImportSpec will be missing, so the client is forced to give up or fix the problems and then try again.

The client now calls {@link vim.ResourcePool#importVApp ResourcePool.importVApp}, passing the ImportSpec as a parameter. This will create the virtual machines and {@link vim.VirtualApp} objects in VI and return locations to which the files of the entity can be uploaded. It also returns a lease that controls the duration of the lock taken on the newly created inventory objects. When all files have been uploaded, the client must release this lease.

Export

Creating the OVF descriptor is the last part of exporting an entity to OVF. At this point, the client has already downloaded all files for the entity, optionally compressing and/or chunking them (however, the client may do a "dry run" of creating the descriptor before downloading the files. See {@link vim.OvfManager#createDescriptor OvfManager.createDescriptor}).

In addition to the entity reference itself, information about the choices made on these files is passed to createDescriptor as a list of OvfFile instances.

The client must inspect and act upon warnings and errors as previously described.

No matter if the export succeeds or fails, the client is responsible for releasing the shared state lock taken on the entity (by {@link vim.VirtualMachine#exportVm VirtualMaching.exportVm} or {@link vim.VirtualApp#exportVApp VirtualApp.exportVApp}) during the export.

Error handling

All result types contain warning and error lists. Warnings do not cause processing to fail, but the caller (typically, the user of a GUI client) may choose to reject the result based on the warnings issued.

Errors cause processing to abort by definition.

Attributes

Name Type Description
idString

@since Unknown
morefVcManagedObjectReference

returns the ManagedObjectReference of this ManagedObject @since Unknown
ovfExportOptionVcOvfOptionInfo []

@since vSphere API 5.1
ovfImportOptionVcOvfOptionInfo []

@since vSphere API 5.1
sdkConnectionVcSdkConnection

@since Unknown
sdkIdString

@since Unknown
typeStringDeprecated.

Returns the name for the this managed object's vim type @since Unknown
vimHostVcSdkConnection

@since Unknown
vimIdString

@since Unknown
vimTypeString

@since Unknown

Methods

Methods defined in this Scripting Object
_getRef, createDescriptor, createImportSpec, createTrigger, exportOvfToUrl_Task, importOvfAtUrl_Task, parseDescriptor, parseDescriptorAtUrl_Task, validateHost

parseDescriptor

Parse the OVF descriptor and return as much information about it as possible without knowing the host on which it will be imported.

Typically, this method is called once without a deploymentOption parameter to obtain the values for the default deployment option. Part of the result is the list of possible deployment options. To obtain the values for a particular deployment option, call this method again, specifying that option. @since vSphere API 4.0

Parameters

NameTypeDescription
arg0String

arg1VcOvfParseDescriptorParams


Return Value

Type Description
VcOvfParseDescriptorResult

_getRef

@since Unknown

Parameters

NameTypeDescription
None

Return Value

Type Description
VcManagedObjectReference

createTrigger

@since Unknown

Parameters

NameTypeDescription
timeoutNumber

filterString

conditionString

filterToSyncString


Return Value

Type Description
Trigger

importOvfAtUrl_Task

Create an entity from an OVF located on a web-server. The entity created in the specified folder and attached to the resource pool.

This operation only works if the folder's childType includes VirtualMachine.

The descriptor is downloaded, parsed and its validity is verified against the provided deployment constraints. The files referenced in the descriptor are then downloaded in the order certificate, disks and manifest. If these file-paths are not absolute (do not begin with http(s)://), then they are assumed to be relative to the descriptor URL. @since vSphere API 4.0

Parameters

NameTypeDescription
arg0String

arg1VcOvfCreateImportSpecParams

arg2VcFolder

arg3VcResourcePool

arg4VcDatastore

arg5VcKeyValue []

arg6String


Return Value

Type Description
VcTask

parseDescriptorAtUrl_Task

Parse the OVF descriptor located on a web-server and return as much information about it as possible without knowning the host on which it will be imported.

Version of method {@link #parseDescriptor} that works with HTTP URLs. @since vSphere API 4.0

Parameters

NameTypeDescription
arg0String

arg1VcOvfParseDescriptorParams

arg2VcKeyValue []

arg3String


Return Value

Type Description
VcTask

validateHost

Validate that the given OVF can be imported on the host.

More specifically, this means whether or not the host supports the virtual hardware required by the OVF descriptor. @since vSphere API 4.0

Parameters

NameTypeDescription
arg0String

arg1VcHostSystem

arg2VcOvfValidateHostParams


Return Value

Type Description
VcOvfValidateHostResult

createDescriptor

Create an OVF descriptor for the specified ManagedEntity, which may be a {@link vim.VirtualMachine} or a {@link vim.VirtualApp}.

To create the complete OVF descriptor, the client must already have downloaded the files that are part of the entity, because information about these files (compression, chunking, filename etc.) is part of the descriptor.

However, these downloads can be quite time-consuming, so if the descriptor for some reason cannot be generated, the client will want to know this before downloading the files.

For this reason, the client may do an initial "dry run" with the ovfFiles parameter unset. Default filenames will then be used in the descriptor, and the client can examine any warnings and/or errors before downloading the files.

After the final call to this method, client must release the lock on the entity given to it by {@link vim.VirtualMachine#exportVm VirtualMachine.exportVm} or {@link vim.VirtualApp#exportVApp VirtualApp.exportVApp}. @since vSphere API 4.0

Parameters

NameTypeDescription
arg0VcManagedEntity

arg1VcOvfCreateDescriptorParams


Return Value

Type Description
VcOvfCreateDescriptorResult

exportOvfToUrl_Task

Create an OVF for a virtual machine or vApp and upload it to a web-server. Parameter dstBaseUrl specifies the base-path at which the OVF descriptor and all referenced files will be uploaded using HTTP PUT requests. The order of upload is: certificate (if any), referenced disks, manifest (if any) and finally the descriptor. @since vSphere API 4.0

Parameters

NameTypeDescription
arg0VcManagedEntity

arg1String

arg2VcKeyValue []

arg3String


Return Value

Type Description
VcTask

createImportSpec

Validate the OVF descriptor against the hardware supported by the host system. If the validation succeeds, return a result containing: @since vSphere API 4.0

Parameters

NameTypeDescription
arg0String

arg1VcResourcePool

arg2VcDatastore

arg3VcOvfCreateImportSpecParams


Return Value

Type Description
VcOvfCreateImportSpecResult