Managing virtual machines and applications comes in many shapes, sizes, and formats. There is an interesting construct found within the VMware vSphere infrastructure environment which you may have seen when installing some types of applications and solutions provided from VMware called a VMware vApp. However, you can use this same type of object in your vSphere environment for your own purposes. It provides some really interesting capabilities and features when looking at deploying and managing your virtual infrastructure. This may be a capability that you are not taking full advantage of when managing your vSphere environment.
Let’s take a look at what a VMware vApp is as well as how it is setup and configuration.
What is a VMware vApp?
What is the VMware vSphere vApp? The vSphere vApp is a construct that allows you to package multiple interoperating virtual machines and software applications into a single entity that can be managed and distributed using the very familiar OVF format.
You can roll one or more virtual machines into a single vApp. This allows operations to be carried out in bulk on all the VM objects contained in the vApp. When you clone or power on/off a vApp, this affects all the VMs that are contained in the vApp container object.
A vSphere vApp allows you to perform resource management and other management activities such as power operations for multiple virtual machines at the same time. Think of a vSphere vApp as a container of sorts for virtual machines that allow you to have the logical management capabilities you need in bulk.
Application-Centric Provisioning and Management Use Cases
We have transitioned into a world where everything is application-centric. After all, it is the applications that allow businesses to perform day to day functions and not the underlying infrastructure. Having a more aggregate mechanism to control, provision, edit, and otherwise manage all the underlying VMs to a specific application is extremely handy and allows much more application-focused vSphere administration.
The vApp makes this type of approach possible by allowing you to manage your applications instead of the underlying VMs that make the applications work. This allows you to treat all of these underlying infrastructure components like a single application that in essence, is what they make possible.
This allows very cool management and administration practices such as configuring the startup and shutdown order of the VMs or monitoring the utilization and health of the vApp instead of many singular VMs that make an application run. It is a much more holistic approach to managing the application infrastructure in your vSphere environment.
It also makes dealing with all the interdependencies of your applications much easier as well. One of the caveats to having different VMs hosting multiple services your application relies on is you have to know about all of those dependencies when bringing up your application.
Hosting all your VMs inside the vApp allows you to ease the pain of managing all of the dependencies. You can manage your microservices architecture as you would a monolithic architecture from a virtual machine perspective. All of this allows easing the administrative burden when dealing with applications that may consist of bringing up 10 different VMs for the application to work.
Since a vSphere vApp is a vCenter Server-centric object, the metadata around the vSphere vApp is stored in the vCenter Server database. This means the metadata can be lost if the vCenter database is cleared, or the host that is hosting the vApp is removed from vCenter. Additionally, vApp metadata does not follow the normal behavior when snapshots are deleted, modified, or defined. This means that any vApp properties that you delete, modify, or define after you take a snapshot of a VM to remain in that state if the VM reverts to that snapshot or any prior snapshots.
VMware vSphere vApp Use Case
In your infrastructure, you may have a classic 3-tier application that relies on a web server, application server, and DB server. Traditionally, you may have managed your application infrastructure by managing the individual virtual machines this 3-tier application relies on to function.
However, by using a VMware vSphere vApp, you can manage your application holistically with the vApp. This is accomplished by moving your 3-tier application virtual machines inside the vApp which allows managing all three as a single entity.
With the vApp, you can manage the resource settings in terms of reservations, limits, and shares for the vApp instead of doing this with each individual VM that comprises the 3-tier application. The vApp also allows you to handle situations like the startup order of the VMs that comprise your vApp supported application. For most, the database backend will need to be available first. Within the vApp, you define the startup order to start the database virtual machines first and then start the application and web servers after the database servers have started.
Other Interesting Capabilities
Another really interesting use case with using the vApp construct in VMware vSphere is the ability to deploy another instance of your application very easily. You can clone your vApp instead of cloning each individual virtual machine that makes up the vApp.
This makes moving and creating new application instances extremely easy. Additionally, this is a great way to create new instances of application virtual machine infrastructure for Dev/Test instances. Managing your applications using a vApp is much more desirable than having to individually manage each VM that comprises your application.
There is also the ability in working with vApps to use nested vApps which means you have vApps inside of vApps. This allows you to have a more granular management approach when working with vApps. You may have subsets of virtual machines that you have housed in nested vApps inside of a parent vApp.
Creating a vApp in VMware vSphere
Creating a vApp in VMware vSphere is not difficult at all. There are a couple of prerequisites to note before getting started with the creation of your first vApp. The vApp object is supported for creation on one of the following configurations:
- A standalone host that is running ESX 4.0 or greater
- A cluster that has DRS enabled
In fact, in the cluster scenario, you will find the vApp option greyed out in the vSphere Client if the cluster does not have DRS enabled.
The first step to creating a new vApp is right-clicking your vSphere cluster and selecting New vApp. Notice below, DRS is turned on.
When you select the New vApp option, this will launch the New vApp wizard that allows provisioning a new vApp in just four easy steps.
First, you will need to select whether this should be a new vApp that is created or clone an existing vApp.
Next, select a name and a location for the new vApp.
Configure the resource allocation for the new vApp in step three, resource allocation. Here, you find the very familiar resource allocation settings that you are used to when setting up resource pools.
Finally, review and finish the creation of the new vApp in the new vApp wizard.
The new vApp will appear in your vSphere Client. If you have not seen the vApp construct before, the icon that appears next to the vApp is a bit different than any other object in vSphere.
Configuring vApp Settings in vSphere Client
After you have created a new vApp in your vSphere environment, there are interesting settings that can be configured under the settings of the vSphere vApp.
The Start Order tab settings allow configuring the start order of the virtual machines which allows you to ensure the dependencies are met in the correct order for servicing your application.
The IP Allocation tab allows configuring the IP addressing for the resources contained in the vApp. You have several options here including:
- IP protocol
- IP allocation schema
- DHCP – The IP addresses are allocated through a DHCP server when the virtual machine is powered on
- OVF environment – IP allocation is determined by the environment in which you deploy the OVF environment
When you bundle up the vApp, you can encapsulate “product-specific” information such as the product URL, Vendor, and Vendor URL.
Exporting a vApp as an OVF
As mentioned, one of the great things about using a VMware vSphere vApp is having the ability to quickly and easily export the entire collection of virtual machines contained in your vApp. Instead of having to create a copy of each individual VM, this allows you to package up all of the dependencies of your application from a VM perspective and have these bundled together in OVF format.
Then to import a copy of your “application”, you simply need to import a copy of your vApp which contains all of the virtual machines required to run the application. This allows an easy way to create additional instances of your application infrastructure. It is also a great way to easily create DEV/TEST environments of your application components.
To begin the Export process, right-click the vApp > OVF Template > Export OVF Template.
This launches the Export OVF Template dialog box. You can check the box Enable advanced options to choose additional components to include in the OVF Template, including BIOS UUID, MAC addresses, and extra configuration.
When you click OK, the export process kicks off and you will see the Export OVF template task in your Recent Tasks display as the vApp is exported.
Once the vApp is exported, you have everything you need in the form of an OVF template to import/restore the vApp in a different or same environment.
Importing an Exported vApp into vSphere
The exported vApp will be exported into an OVF format that can easily be consumed back into vSphere. As you can see below, the export process that was shown above resulted in the normal OVF files being created. Using these files, you can simply import the OVF and you will have the vApp restored to your environment.
In your environment or resource that you want to import your OVF appliance, select Deploy OVF Template.
Using the normal Deploy OVF Template process, choose your OVF files created during the vApp export and step through the normal process of OVF deployment.
After stepping through the OVF deployment process and choosing the name TestvApp_fromOVF, you can see the resulting vApp is restored to the same vSphere environment that I had exported it from.
Is Exporting a vApp a Backup?
While exporting a vApp may constitute a point in time backup of sorts for the virtual machines contained in the vApp object, it is not a means to rely on for creating a point in time backups of your environment. You don’t get all the efficiencies that you would when using a real backup solution for the VMs that are contained in the vApp.
When you export your vApp manually as an OVF, this creates a copy in the bulk of all the VM data that is contained in the virtual machines housed in the vApp. So, you do not benefit from Changed Block Tracking. This will result in deltas between your “point in time” process being massive.
Other advanced features such as application-aware processes and other features are not found in the vApp Export process. However, perhaps the major deal-breaker when looking at the vApp Export process is the VMs that are contained in the vApp have to be powered off before the vApp can be exported.
This, of course, is not going to work for most environments running the vApp to house their business-critical virtual machines that make up their application-specific infrastructure.
Using a true backup solution – Vembu BDR Suite offers the means to protect your business-critical assets in your vApp objects so that you have point-in-time, versioned, backups that are created with application-aware technology and also use Changed Block Tracking (CBT) to pull the backups of the environment.
With Vembu BDR Suite, you can also create site recovery jobs to allow you to failover your vApp from one environment to your environment offsite from production, such as a DR facility. This is in harmony with the 3-2-1 backup best practice methodology that allows you to protect your data in a way that you have multiple copies and they are spread out across different physical locations.
The VMware vApp is a powerful, underutilized tool that can help you to manage your infrastructure effectively from an application perspective. It provides a vehicle in which you can house all your application dependency VMs together so they are managed as a single entity, instead of individual VMs.
This allows you to modify resource settings, IP provisioning, and other settings at the vApp level. Additionally, as shown, you can export the vApp itself which allows creating a copy of the VMs it contains by creating an OVF of the vApp. This OVF can then be imported back into vSphere which allows creating an additional instance of your application by means of the vApp which houses all the virtual machines the application relies on.
The next time you need to create a copy of your application, the vApp object may very well be the easiest way to manage your resources by “application” rather than by the individual VMs that allow the application to function.