Virtual Application Life Cycle
You can power a virtual application on or off and perform other lifecycle operations.
Powering a Virtual Application On or Off
You can use the PowerOnVApp_Task method to power on a VirtualApp object. This method starts the virtual machines or child virtual applications in the order specified in the virtual application configuration.
While a virtual application is starting, all power operations performed on subentities are disabled.
If a virtual machine in a virtual application fails to start, an exception is returned and the power-on sequence terminates. In case of a failure, virtual machines that are already started remain powered on.
You can use the PowerOffVApp_Task method to power off a virtual application. This method stops the virtual machines or child virtual applications in the order specified in the VirtualApp object configuration if force is false. If force is set to true, this method stops all virtual machines (in no specific order and possibly in parallel) regardless of the VirtualApp object auto-start configuration.
While a virtual application is stopping, all power operations performed on subentities are disabled.
Unregistering a Virtual Application
You can call the UnregisterVApp_Task method to remove a VirtualApp object from the inventory without removing any of the component virtual machine files on disk. All high-level information stored with the management server (ESX/ESXi or vCenter Server system) is removed, including information about VirtualApp object configuration, statistics, permissions, and alarms.
Suspending a Virtual Application
You can call the SuspendVApp_Task method to suspend all running virtual machines in a virtual application, including virtual machines running in child virtual application. The virtual machines are suspended in the order that is used for a power off operation, which is the reverse of a power on sequence.
While a virtual application is being suspended, all power operations performed on subentities are disabled. If you attempt to perform a power operation, a TaskInProgress error results.
Destroying a Virtual Application
When a VirtualApp object is destroyed, all of its virtual machines and any child virtual applications are destroyed.
The VirtualAppVAppState type defines the set of states a VirtualApp object can be in. The transitory state between started and stopped is modeled explicitly, since the starting or stopping of a virtual application might take minutes to complete.
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 virtual application is destroyed. Otherwise, only the link is removed when the virtual application is destroyed.