About Virtual Applications
A virtual application specifies and encapsulates the components of virtual machines and applications, and the operational policies and service levels associated with those components. A virtual application can be as simple as an individual virtual machine with a specific operating system (virtual appliance), or as complex as a complete corporate Web site. Each virtual machine in a virtual application contains a preinstalled, preconfigured operating system and might contain an application stack optimized to provide a specific set of services.
In the vSphere Web Services SDK, the VirtualApp managed object represents a virtual application. A VirtualApp object extends ResourcePool with the following capabilities:
Import and export of VirtualApp objects as OVF packages.
Management Overview
You can use the Web Services SDK to create and manage virtual applications by following these steps:
1
Call the CreateVApp method to create a virtual application without children. See Creating a VirtualApp.
2
3
Export the VirtualApp to OVF (ExportVApp method) See Exporting a Virtual Application.
You can then import the OVF to create and customize the virtual application.
Direct and Linked Children
A virtual application consists of one or more child virtual machines or virtual applications. VirtualApp children have the following characteristics:
VirtualApp children are either direct or linked, based on where a child derives its resources.
Direct Children. A direct child of a virtual application is a virtual machine or virtual application object that you add explicitly. See Managing VirtualApp Children for a list of methods. Direct children share resources with the parent VirtualApp object. Both virtual machines and virtual application can be direct children.
Linked Children. A linked child of a virtual application is a virtual machine or virtual application that you add by calling the UpdateLinkedChildren method. Linked children increase the flexibility of the VirtualApp by allowing child entities to use different resources from the parent VirtualApp object. Linked children can be part of a different clusters, but a virtual application and its children must be in the same Datacenter. Both virtual machines and virtual applications can be linked children.
Linked children gives better flexibility. In particular, you can create virtual applications that span clusters. The vSphere Client does not support adding or removing links, though it does show links.
When you add a linked child to a virtual application, the following rules apply:
An InvalidArgument fault is thrown if the UpdateLinkedChildren method is called on a link target that is a direct child of another virtual application.
When you add a virtual machine or virtual application that is already a linked child of another virtual application, the existing link is removed and replaced with the new link.
The life-time of a linked child is determined by the destroyWithParent property on the VAppEntityConfigInfo data object. If set to true, the child is destroyed when the parent VirtualApp is destroyed. Otherwise, the link is removed when the VirtualApp is destroyed.
If you add a virtual application that consists of multiple entities, for example multiple virtual machines, the entities are moved sequentially and committed one at a time, as specified in the list. If a failure is detected, the method terminates with an exception.
OVF Packages
Open Virtualization Format (OVF) is a distribution format for virtual applications. vSphere uses the OVF package as a unit of distribution and storage for virtual applications. Because these entities are uploaded, downloaded, and stored in OVF package format, vSphere supports access to and deployment of a wide variety of virtual applications.
A virtual application typically consists of one or more virtual disk files and a configuration file.
An OVF package might also include certificate and manifest files.
The OVF package contains metadata that describes the capabilities and infrastructure requirements of the virtual application, and contains references to the virtual disks and other files that store the virtual machine state. Most of this information is stored in an XML document called the OVF envelope. When an OVF package is instantiated into either a VirtualApp or a VirtualMachine object (which depends on metadata in the envelope), then the configuration stored in the OVF envelope is applied to the VirtualVApp and the VirtualMachine objects.
Some of the information in the OVF file is used unaltered, with entire ovf:Section_Type elements included in the VirtualApp object body. Other sections are transformed or extended by instantiation. You do not need detailed knowledge of all OVF package elements, but a basic understanding of key parts of the package and how they relate to virtual applications is useful.
See the OVF specification at the DMTF Web site for additional information.