Understanding the Power of VMware vApps

by [Published on 5 July 2012 / Last Updated on 5 July 2012]

In this article we'll look at what a vApp is and how the latest features can help you, in vSphere 5.

Introduction

The power of VMware vApps is something that I think most VMware Admins still overlook simply because they haven’t taken the time to learn more. I believe that once you learn more about vApps, you’ll see that they offer amazing portability and power which you’ll want to use in your VMware infrastructure.

In the past, I have created a couple of videos on vApps. They are Great New vApp / OVF 1.0 Features in vSphere 4 and What are VMware vApps?. These videos offer good information on the concept of a vApp but they are also based on vSphere 4 and there have been a number of improvements since then. Thus, let’s start from the beginning on what a vApp is and how the latest features can help you, in vSphere 5.

What is a VMware vApp?

A vApp is a container for virtual machines that offers resource controls and management for the virtual machines that are inside. Think of a vApp as a portable, self-contained box that holds multiple virtual machines that make up a multi-tiered application (like a web server, database, and security server), including all custom network configurations.

vApps offer:

  • Container for multiple virtual machines
  • Resource controls for the VMs inside the container
  • Network configurations contained inside
  • Portability of the vApp such that everything can be contained and transferred to another virtual infrastructure
  • Entire vApps can be powered on, powered off, suspended, or shutdown
  • Entire vApps can be cloned

Probably the best way to understand vApps is to create one so let’s learn how.

Creating a vApp

Creating a vApp is easy. To do it, in your vSphere client (connected to vCenter), click on File, go to New, and click on vApp, as you see in Figure 1. Alternately, you can press Control-A.


Figure 1

This will bring up the New vApp Wizard. The first thing you need to do in this wizard is to create a name for the vApp In my case, I simply called it “Client-Server-App” and clicked Next.


Figure 2

Next, you need to configure the resource allocation for the vApp. At this point, the only resource allocations available are either CPU or memory. The resource configurations are just like a resource pool as a vApp really contains a resource pool. vApp resources use the same shares, reservations, and limits that regular resource pools use. Notice how I went ahead and reserved 4000Mhz of vCPU and 6000MB (6GB) of vRAM for the VMs that will be inside the vApp resource pool.


Figure 3

Finally, a review before creating the vApp, as shown in Figure 4. After reviewing, click Finish.

 


Figure 4

In just a few seconds your vApp will be created.

Now it’s time to move existing VMs into the new vApp. Of course, you can also create new VMs and locate them in the vApp. In my case, I simply dragged and dropped a windows server and Windows 7 VM into the VApp.

Here’s what my new vApp looks like:


Figure 5

From here, I can power on all the VMs inside the vApp at the same time by right-clicking on the vApp and then clicking Power On.

~
Figure 6

Notice how from the same menu, you can also Clone the VM, Report Performance, Add Permissions, or Alarms.

The other option is to Edit Settings for the VM.

Editing vApp Settings

Once a vApp is created, there are a number of settings that can be edited (many more than when you were first creating the vApp, using the Wizard).


Figure 7

The primary vApp setttings that you should be aware of are the IP address allocation policy and the start order, inside the vApp.

The IP address allocation policy is configured on the Options tab and the IP allocation policy section (as you see in Figure 7). The three types of IP allocations are:

  • Fixed – IP addresses are manually configured
  • Transient – allocated from the vCenter managed IP network range at power-on and released at power-off
  • DHCP – a DHCP server is used to provide the IP addresses for VMs in the vApp

If some of your IP allocation policy options are gray out (like they are in mine in Figure 7), you can go into the Advanced section and then into Advanced IP Allocation where you can configured either DHCP or OVF as the source for IP allocation.


Figure 8

Besides the IP Allocation policy, the other most used setting to edit in a vApp is the startup order.


Figure 9

The startup order is the startup and shutdown order for all virtual machines inside the vApp. You can choose to power on or power off the VMs in any order that you choose. You can also specify that a VM should wait x number of seconds before powering on or powering off the next VM in the vApp. Finally, you can choose to wait until the VMware Tools are ready on one VM in the vApp before powering on the next VM. All of these power on / power off settings are contained inside the vApp and are portable when the vApp is transferred. However, keep in mind that HA, per Duncan Epping’s post, vSphere High Availability (HA) doesn’t respect the startup order configured in a vApp (hopefully this is something that is improved in the future).

One of the more noticeable tabs when editing a vApp is the “vServices” tab. Today, there isn’t a lot here. There is only one default vService and it is the vCenter Extension vService. The vCenter Extension service allows a VM to register as an extension to vCenter, giving it full access to the vCenter APIs. While this can be beneficial to VMs that need special access, it can also be a security hole if the VM configured has malicious software.


Figure 10

I hope that, in the future, more vServices will be added.

Exporting a vApp

As I mentioned before, one of the greatest benefits of vApps is their portability between virtual infrastructures. To export a vApp (including al the VMs inside), just select the vApp and then click Export -> Export OVF Template.


Figure 11

Then, fill out the simple form, with the most important field being where you want to export it and the format (OVF or OVA)


Figure 12

Once exported, the OVF or OVA file can be imported (deployed) into another virtual infrastructure using the Deploy OVF Template option (at least if you are using the vSphere Client to deploy it).

vApps, OVF, and vCloud Director

One of the reasons vApps were created was for vCloud Director and the portability of multi-tiered applications from one cloud to anther cloud. Those clouds could be private clouds, public cloud services, or hybrid clouds. You can even export and import VMs between vSphere and XenServer or Hyper-V. vApps are also compatible with VMware Workstation.

vApps can easily be created with VMware Studio and you can learn more about the OVF packaging and its options on the OVF homepage. Thanks to the OVF format, there are a lot of options in the OVF XML file that you can use. For example, the OVF can contain information about vApp virtual hardware, EULA, product information, upgrade instructions, product version, description, etc. When deploying an OVF, you can be prompted about network settings and then those can be automatically configured and applied when the VMs in the vApp are first powered on.

One tool you should be aware of is the OVFTool. OVFtool can convert OVF to OVA and a variety of other tasks. It can be downloaded from with VMware Fusion, Workstation, or from http://www.vmware.com/go/ovf. Another tool is called vAppRun, which integrates with OVFTool and lets you work with vApps and OVF properties while using Fusion and Workstation. It can be downloaded from http://labs.vmware.com/flings/vapprun.

Keep in mind that understanding vApps is a VMware Certified Professional (VCP) exam objective, per the VCP blueprint.

In the future, I hope that the vApp OVF format can include even more pertinent information inside the package to make vApps even more powerful!

Featured Links