An instantiateOvf request uploads an OVF package and then creates a vApp from it. By default, this operation also deploys the vApp and powers it on.
If you want to deploy an OVF package as a vApp without creating a vApp template and corresponding catalog item, make an instantiateOvf request. This request initiates a workflow similar to the one shown in Upload an OVF Package to Create a vApp Template, but with a few important differences.
- The target of the upload is a VDC, not a catalog.
- The request body is an InstantiateOvfParams element, not an UploadVAppTemplateParams element.
- The response is a VApp element that includes an upload URL for the OVF descriptor.
After you retrieve the VApp element created by the instantiateOvf request, you can upload the descriptor and the files it references.
Prerequisites
Verify that the following are true:
- You have an OVF package to upload.
- You are logged in as a user who has permission to upload OVF packages and create vApps.
- You know the URL of the target VDC that will receive the upload. Retrieve the XML representation of your organization to see a list of the VDCs that it contains.
Review the contents of the Envelope element in the descriptor file of your OVF package. Several properties in this file have implications for the InstantiateOvfParams request body you must construct to initiate the upload.
Procedure
Results
Example: Create a vApp From an OVF Package
This request includes a NetworkMapping element that maps a network name found in the uploaded OVF descriptor to the name of a network available in the target VDC.
POST https://vcloud.example.com/api/vdc/5/action/instantiateOvf Content-Type: application/vnd.vmware.vcloud.instantiateOvfParams+xml ... <?xml version="1.0" encoding="UTF-8"?> <InstantiateOvfParams xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns="http://www.vmware.com/vcloud/v1.5" name="W2K8"> <Description>Example vApp</Description> <InstantiationParams> <NetworkConfigSection> <ovf:Info>Configuration parameters for logical networks </ovf:Info> <NetworkConfig networkName="vAppNetwork"> <Configuration> <ParentNetwork href="https://vcloud.example.com/api/network/54" /> <FenceMode>bridged</FenceMode> </Configuration> </NetworkConfig> </NetworkConfigSection> </InstantiationParams> <AllEULAsAccepted>true</AllEULAsAccepted> <NetworkMapping> <Source>Network 1</Source> <Target>vAppNetwork</Target> </NetworkMapping> <InstantiateVmParams id="VM-1"> <Name>VM-1</Name> <NetworkConnectionSection> <ovf:Info /> <PrimaryNetworkConnectionIndex>0</PrimaryNetworkConnectionIndex> <NetworkConnection network="Network 1"> <NetworkConnectionIndex>0</NetworkConnectionIndex> <IsConnected>true</IsConnected> <IpAddressAllocationMode>POOL</IpAddressAllocationMode> </NetworkConnection> </NetworkConnectionSection> <ComputerName>W2K8</ComputerName> </InstantiateVmParams> </InstantiateOvfParams>
The response is a sparsely populated VApp element that includes an upload URL for the OVF descriptor. See Uploading Referenced Files for file upload procedures.
201 Created Content-Type: application/vnd.vmware.vcloud.vApp+xml ... <VApp xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" deployed="false" status="0" name="W2K8" type="application/vnd.vmware.vcloud.vApp+xml" href="https://vcloud.example.com/api/vApp/vapp-23"> <Link rel="up" type="application/vnd.vmware.vcloud.vdc+xml" href="https://vcloud.example.com/api/vdc/5"/> <Description>Example vApp</Description> <Link rel="remove" href="https://vcloud.example.com/api/vApp/vapp-23" /> <Description>Example vApp</Description> <Tasks> <Task status="running" operation="Creating Virtual Application W2K8(23)" ... > ... </Task> </Tasks> <Files> <File name="descriptor.ovf" bytesTransferred="0"> <Link rel="upload:default" href="https://vcloud.example.com/transfer/.../descriptor.ovf" /> </File> </Files> <Owner> ... </Owner> <InMaintenanceMode>false</InMaintenanceMode> </VApp>