How to create a service template in System Center 2012

John Joyner explains what makes up a service template in the Virtual Machine Manager and shows you how to create one and use it in App Controller.

A new feature delivered by Microsoft System Center 2012 is the ability to deploy an application based on a service template. Service templates allow for turn-key deployment of application infrastructure. Service templates are authored using the Service Template Designer feature of System Center 2012 Virtual Machine Manager (VMM). Once a template is created, it can be used to deploy services using the VMM console or VMM PowerShell commands, and made available for self-service provisioning using the System Center 2012 App Controller web portal.

A service template is comparable to a building blueprint, created by the professional architect before any work occurs at the construction site. Like combining construction materials to build a building, System Center 2012 VMM brings together in a service template all the configuration details and software tools to deliver those configurations across devices. VMM assembles the resources of your cloud into a fabric, and then lets users deploy applications via service templates to the cloud in a self-service and/or automation-based model. Figure A shows a service template for a two-tier application featuring fault domains based on network assignment.

Figure A

Service Template Designer in VMM: A two tier application with network-based fault domains. (Click images to enlarge.)

Characteristics of service templates

  • Combine and associate different fabric elements in the private cloud, and take the form of visual diagrams.
  • Include one or more virtual machine (VM) tiers, as well as associated network interfaces and network load balancers.
  • A VM tier hosts an application and can contain one VM for testing, two or more production VMs for redundancy, and any number of VMs for capacity scale-out.
  • Can also contain SQL server application hosts and logical network segments.
  • Allow for repeatable, precision deployment of an entire application at any scale, automatically configuring all necessary fabric elements in the cloud.
An appreciation for these concepts behind defining an application as a service template will begin your true professional journey to cloud-centric thinking:
  • The private cloud architect that authors the service template has this job: Distill into that template all the knowledge needed to deploy, scale, and retire the application using the resources of the cloud fabric.
  • For the life of that application, non-technical staff and even fully-scripted automation can use and re-use the intelligence in the template to deploy and manage the application in the fabric.
  • Non-technical users can provision and configure highly complex private cloud fabric elements such as storage area networks (SANs) and hardware load balancers, completely abstracted from the actual data center fabric.

Create a service template in VMM

Follow these steps in System Center 2012 VMM to create a service template. A prerequisite is that you have defined VM Templates for each VM application role that you want to add to the service template. Also you need to have created a private cloud in VMM with resources available to match those required by the VM Templates. These prerequisites will allow VMM to match application VMs to fabric resources that will support them.

  1. Navigate to the Library space and click the Create Service Template button in the ribbon.
  2. Select one of the predefined service templates and press OK. (See Figure B.)
  3. Observe your list of VM templates on the left side of the designer (see Figure A, VM Templates tab).
  4. Drag VM templates into the designer canvas to add VMs to that tier. Alternatively, drag a VM template onto a tier to replace the default settings for that tier.
  5. Add hardware load balancers and logical networks to the designer canvas. Use the connector button in the ribbon to connect network interfaces.
  6. Press the Save and Validate button in the ribbon when done, then exit the designer.

Figure B

Creating a service template in in the VMM Library space.

Use a service template in App Controller

A previous article provided an introduction to Microsoft System Center 2012 App Controller, a product that could be named "Microsoft cloud manager."  In that article, we connected App Controller to our on-premise VMM server for access to our private cloud resources, as well as connecting to Azure for management of our public cloud subscriptions. Now that we have defined a service template, we can use App Controller to actually launch the application deployment to our private cloud.

Figure C

App Controller: Self-service deployment of an application using a service template.
Figure C from the App Controller web portal lists the same Two Tier Application template seen in the VMM template designer in Figure A. Here are the steps to deploy the application with App Controller:

  1. From the App Controller Library space, select Templates, then select the template of the application you want to deploy, and click on Deploy in the templates menu.
  2. You will be presented with a screen to select which private cloud to deploy the application to, then a graphical representation of the application you are about to deploy as seen in Figure D.
  3. Click the Deploy button and VMM will start to execute your instructions and deploy the application to the fabric.

Figure D

App Controller: Graphical depiction of the application you are about to deploy.
Figure E below shows the progress of VMM as the jobs are executing. These are the jobs to deploy the application to the private cloud selected by the user with App Controller.
  • Two VMs (ServiceVM00001 and ServiceVM00002) have been automatically named and placed (one VM each) in two host clusters in the private cloud.
  • In the design of this application, the network of the host cluster matches the network fault domain the VM is assigned to.
  • The fact that both the VM Templates and the host clusters in the private cloud have "LAN A" and "LAN B" associations permits VMM to intelligently distribute the VMs to host clusters that preserve the isolation between the fault domains.

Figure E

Watching the progress of deploying the two-tier application in the VMM console.

By John Joyner

John Joyner, MCSE, CMSP, MVP Cloud and Datacenter Management, is senior architect at ClearPointe, a cloud provider of systems management services. He is co-author of the "System Center Operations Manager: Unleashed" book series from Sams Publishing, ...