Traditionally system administrators and engineers deploy virtual machines on a one off basis. However the issue I have with this methodology is it takes too long to deploy and integrate the necessary tiers to host an entire application (or even an simple one).
What if there was a way to connect, configure, and deploy all the pieces of your application architecture. Wouldn’t that be great? Well there is and it’s integrated directly into System Center Virtual Machine Manager (VMM) 2012.
Now I know what you may be thinking, “I don’t have VMM” or “I have VMware, I’m good, thanks” and I’m ok with that, for the moment...
However imagine deploying your complicated, multi-tiered application architecture with just a couple clicks. Or better yet, allowing your development or pre-production team to deploy without intervention from you. I’m not just talking about Hyper-V either; I’m talking about VMware and Citrix as well.
If you’re familiar with deploying virtual machines (VMs) you’re most likely familiar with deploying VMs using virtual machine templates.
Virtual machine templates provide the ability to configure/add:
· Operating System (OS) and features
· Hardware (e.g. network, processor(s), memory, IDE/SCSI hard drives, etc.)
· Applications
· Etc.
Once we’ve created a VM template we deploy in some fashion, either manually, by script, or through automation.
However not all templates are created equal. If we look at using System Center Virtual Machine Manager 2012 templates you can do a lot. For example, install roles/features for an OS, add applications and settings (including Web and SQL) as shown below:
You can even save all of your settings to a PowerShell script for use in automation.
I understand Vmware and Citrix have their methods as well, and you may be very comfortable with their tools. However let’s go beyond Virtual Machine templates and discuss “Service Templates” in Virtual Machine Manager 2012.
SERVICE TEMPLATES
Service Templates provide the ability to build virtual machine templates that are configured and deployed together and are managed as a single entity (e.g. a multi-tier line-of-business application).
Let’s look at a couple examples of a service templates in VMM 2012:
SIMPLE SERVICE TEMPLATE EXAMPLE
The following is a simple, connected, deployment of a web server and SQL server.
Similar to VM templates, when I modify each tier, I have the ability to configure:
· Operating System (OS) roles, features, domain, etc.
· Hardware (e.g. network, processor(s), memory, IDE/SCSI hard drives, etc.)
· Applications and application configuration (web, scripts, login info, services account credentials, etc.)
· …and much more
COMPLEX SERVICE TEMPLATE EXAMPLE
You can also have a very complex deployment as well. The following example may be more applicable to your environment. The StockTrader application is a multi-tier application that includes settings automation within each tier.
That’s a lot to consume, so let’s break it down a bit:
Order Processing Tier
What the order processing tier contains is a virtual application package (which is basically the application configuration packaged up using Server App-V), and the remainder of the template configuration (hardware config, etc.). The great thing about virtual application packages is they can be serviced and redeployed without having to modify the OS image (as we’ve traditionally done for years).
Read more about virtual applications here: http://technet.microsoft.com/en-us/library/gg703262.aspx
SQL Tier
The SQL tier contains a number of DACPACs and SQL settings. Whoa, what the heck is a DACPAC?
Let’s start with what a “DAC” is and we’ll add “PAC” at the end (figuratively and literally).
A data-tier application (DAC) is a logical database management entity that defines all of the SQL Server objects - like tables, views, and instance objects, including logins – associated with a user’s database. A DAC is a self-contained unit of SQL Server database deployment that enables data-tier developers and database administrators to package SQL Server objects into a portable artifact called a DAC package, also known as a DACPAC.
Read more here: http://technet.microsoft.com/en-us/library/ee210546.aspx
Here are the DACPACs within the SQL tier:
Looking into a DACPAC:
Front-end Web Tier
The front-end web tier contains, you guessed it, the web site. However we deploy the website through what are called Web Deploy packages. A Web Deploy package makes it easy to package up website information and configuration and deploy it.
Formal definition
A web deployment package is a .zip file that contains all the information needed for deployment. You create the package from the command line or in Visual Studio, and you install it on the destination server by using the command line or IIS Manager.
More info here: http://msdn.microsoft.com/en-us/library/dd394698.aspx
Two Web Deploy packages are seen in the below image:
More on Web Deploy:
Using Web Deploy: http://www.iis.net/learn/publish/using-web-deploy
How to: Create a Web Deployment Package in Visual Studio: http://msdn.microsoft.com/en-us/library/dd465323.aspx
Business Services Tier
The Business Services tier contains a virtual application package similar to the order processing tier so I won’t go into those details. However, if we dig into the settings of this tier we see it’s using ESX as its VM platform. You may be thinking, “is this possible? Can I mix and match VM platforms within my service template?” Yes you can! This is one of the many wonderful things about service templates.
Whether you’re running VMware, Citrix, or Hyper-V, service templates will accommodate all three (VM templates do as well).
If you’re interested in deploying and testing the stocktrader service template in your environment, you can download it here: http://www.microsoft.com/en-us/download/details.aspx?id=26553
Here are a couple example Service Templates to get you started:
Virtual Machine Manager Example Service Templates
Virtual Machine Manager Example DotNetNuke Service Template
Additional Resources:
Creating and Deploying Services in VMM
http://technet.microsoft.com/en-us/library/gg675074.aspx
Download System Center Virtual Machine Manager 2012
http://technet.microsoft.com/en-us/evalcenter/dn205295.aspx