# Managed Object - OvfManager(vim.OvfManager)

Property of
  ServiceContent
See also
  Datastore, HostSystem, ManagedEntity, OvfCreateDescriptorParams, OvfCreateDescriptorResult, OvfCreateImportSpecParams, OvfCreateImportSpecResult, OvfOptionInfo, OvfParseDescriptorParams, OvfParseDescriptorResult, OvfValidateHostParams, OvfValidateHostResult, ResourcePool
Since
  vSphere API 4.0

## Managed 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 ImportVApp, ExportVm and 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 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 ImportVApp, passing the ImportSpec as a parameter. This will create the virtual machines and 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 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 ExportVm or 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.

Properties

Name | Type | Description
--- | --- | ---
ovfExportOption* P | OvfOptionInfo[] | Returns an array of OvfOptionInfo object that specifies what options the server support for exporting an OVF descriptor. Since vSphere API 5.1
ovfImportOption* P | OvfOptionInfo[] | Returns an array of OvfOptionInfo object that specifies what options the server support for modifing/relaxing the OVF import process. Since vSphere API 5.1

*May not be presentP Required privilege: System.View

Methods

Methods defined in this Managed Object
CreateDescriptor, CreateImportSpec, ParseDescriptor, ValidateHost

# CreateDescriptor(createDescriptor)

Create an OVF descriptor for the specified ManagedEntity, which may be a VirtualMachine or a 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 ExportVm or ExportVApp.

Required Privileges
  System.View

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the OvfManager used to make the method call.
obj P | ManagedObjectReference to a ManagedEntity | The entity to export. Supported types are VirtualMachine and VirtualApp. Since vSphere API 4.0
cdp P | OvfCreateDescriptorParams | Parameters to the method, bundled in an instance of CreateDescriptorParams. Since vSphere API 4.0

PRequired privilege - see tooltip for details

Return Value

Type | Description
--- | ---
OvfCreateDescriptorResult | An instance of CreateDescriptorResult

Faults

Type | Description
--- | ---
ConcurrentAccess | Thrown if a concurrency issue prevents the operation from succeeding.
FileFault | Thrown if there is a generic file error
InvalidState | Thrown if the operation failed due to the current state of the system.
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.
TaskInProgress | Thrown if a required managed entity is busy.
VmConfigFault | Thrown if a configuration issue prevents the operation from succeeding. Typically, a more specific subclass is thrown.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:pbm="urn:pbm" name="CreateDescriptor" type="pbm:CreateDescriptorRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:pbm="urn:pbm" name="CreateDescriptorResponse"> <complexType> <sequence> <element name="returnval" type="pbm:OvfCreateDescriptorResult"/> </sequence> </complexType> </element>

# CreateImportSpec(createImportSpec)

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

- An ImportSpec to use when importing the entity.
- A list of items to upload (for example disk backing files, ISO images etc.)

Required Privileges
  System.View

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the OvfManager used to make the method call.
ovfDescriptor P | xsd:string | The OVF descriptor of the entity. Since vSphere API 4.0
resourcePool P | ManagedObjectReference to a ResourcePool | The resource pool to import the entity to. May be a vApp. Since vSphere API 4.0
datastore P | ManagedObjectReference to a Datastore | The datastore on which to create the inventory objects of the entity, for example "storage1". The privilege Datastore.AllocateSpace is required on the datastore. Since vSphere API 4.0
cisp P | OvfCreateImportSpecParams | Additional parameters to the method, bundled in an instance of CreateImportSpecParams. Since vSphere API 4.0

PRequired privilege - see tooltip for details

Return Value

Type | Description
--- | ---
OvfCreateImportSpecResult |

Faults

Type | Description
--- | ---
ConcurrentAccess | Thrown if a concurrency issue prevents the operation from succeeding.
FileFault | Thrown if there is a generic file error
InvalidDatastore |
InvalidState | Thrown if the operation failed due to the current state of the system.
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.
TaskInProgress | Thrown if a required managed entity is busy.
VmConfigFault | Thrown if a configuration issue prevents the operation from succeeding. Typically, a more specific subclass is thrown.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:pbm="urn:pbm" name="CreateImportSpec" type="pbm:CreateImportSpecRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:pbm="urn:pbm" name="CreateImportSpecResponse"> <complexType> <sequence> <element name="returnval" type="pbm:OvfCreateImportSpecResult"/> </sequence> </complexType> </element>

# ParseDescriptor(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.

Required Privileges
  System.View

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the OvfManager used to make the method call.
ovfDescriptor P | xsd:string | The OVF descriptor to examine. Since vSphere API 4.0
pdp P | OvfParseDescriptorParams | Additional parameters for parseDescriptor, wrapped in an instance of ParseDescriptorParams. Since vSphere API 4.0

PRequired privilege - see tooltip for details

Return Value

Type | Description
--- | ---
OvfParseDescriptorResult | The information about the descriptor

Faults

Type | Description
--- | ---
ConcurrentAccess | Thrown if a concurrency issue prevents the operation from succeeding.
FileFault | Thrown if there is a generic file error
InvalidState | Thrown if the operation failed due to the current state of the system.
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.
TaskInProgress | Thrown if a required managed entity is busy.
VmConfigFault | Thrown if a configuration issue prevents the operation from succeeding. Typically, a more specific subclass is thrown.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:pbm="urn:pbm" name="ParseDescriptor" type="pbm:ParseDescriptorRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:pbm="urn:pbm" name="ParseDescriptorResponse"> <complexType> <sequence> <element name="returnval" type="pbm:OvfParseDescriptorResult"/> </sequence> </complexType> </element>

# ValidateHost(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.

Required Privileges
  System.View

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the OvfManager used to make the method call.
ovfDescriptor P | xsd:string | The OVF descriptor to examine. Since vSphere API 4.0
host P | ManagedObjectReference to a HostSystem | The host to validate against. Since vSphere API 4.0
vhp P | OvfValidateHostParams | Additional parameters for validateHost, wrapped in a ValidateHostParams instance. Since vSphere API 4.0

PRequired privilege - see tooltip for details

Return Value

Type | Description
--- | ---
OvfValidateHostResult | A ValidateResult instance containing any warnings and/or errors from the validation.

Faults

Type | Description
--- | ---
ConcurrentAccess | Thrown if a concurrency issue prevents the operation from succeeding.
FileFault | Thrown if there is a generic file error
InvalidState | Thrown if the operation failed due to the current state of the system.
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.
TaskInProgress | Thrown if a required managed entity is busy.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:pbm="urn:pbm" name="ValidateHost" type="pbm:ValidateHostRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:pbm="urn:pbm" name="ValidateHostResponse"> <complexType> <sequence> <element name="returnval" type="pbm:OvfValidateHostResult"/> </sequence> </complexType> </element>