Orchestrator By Example: Performing In-Place Updates for Services in System Center 2012 VMM SP1 and Orchestrator

This article, which details how to implement in-place servicing of a VMM service instance with Orchestrator, is a supplemental post to “Chapter 16 – Integration with System Center Virtual Machine Manager” in the upcoming System Center 2012 Orchestrator Unleashed from Sams Publishing, now available for pre-order.

A Note on In-Place Updates (aka In-Place Servicing)

In case you are not familiar, updating a service is the process of making changes to a deployed service. Because System Center 2012 – Virtual Machine Manager (VMM) keeps track of which service template was used to deploy a service, you can make updates to the service template, and then use that updated service template to make changes to the deployed service.

VMM supports two different methods for making the updates to a deployed service:

  • Applying updates to the existing (in-place) virtual machines
  • Deploying new virtual machines with the updated settings

For more info, see chapter 16 in the upcoming Orchestrator Unleashed book or see “Updating a Service in VMM” at http://technet.microsoft.com/en-us/library/gg675089.aspx 

NOTE: In writing this chapter, we assumed not everyone is a VMM expert and so provided quite a bit of background info in chapter 16 to give you the basics of service templates in VMM 2012 SP1.

In This Post

In this post, we will look at the details of the runbook, as well as a before and after snapshot of the running service instance in System Center 2012 Virtual Machine Manager SP1

  • The In-Place Servicing Runbook
    • High Level View
    • Runbook Configuration 
  • Service Instance Before Servicing
  • Service Instance After Servicing

I’ve added a few tips throughout to help you get it right in the real world.

High Level View of the In-Place Servicing Runbook

Here is the high-level view of the runbook, which can easily be called from SC 2012 Service Manager or externally using C# or PowerShell. image

This runbook performs the following actions steps:

  • Accepts user input required to apply the correct service template to the correct running instance
  • Retrieves the running service instance provided in user input
  • Retrieves the  service template provided in user input
  • Configures the pending service update (including the update type) on the service instance
  • Applies the service update

TIP: You will notice this runbook has no error checking, it’s just a simple version to show how to carry out the process (what I call a drag-drop-done version). Use the recommendations we provide in the book for adding error handling to the version before you put it into production use.

The In-Place Servicing Runbook

The runbook requires three pieces of information from the user, collected by the Initialize Data activity, as shown in the image below:

  • Service Instance Name – The display name of the running service instance in VMM
  • Service Template Name – The display name of the service template
  • Service Template Release – The release (version) of the service template

TIP: You can use in-place servicing to roll back a change that does not have the desired effect!

image

The Get Service activity (shown below), which retrieves the details of the running service instance, requires one parameter, the Service Name, provided in the user input and retrieved using the subscribe to published data feature in Orchestrator.

Service Name Equals {Service Instance Name from “Initialize Data”} 

image

The Get Service Template activity (shown below), which retrieves the details of the service template to be applied to the service instance in the update, requires two parameters, the Service Template Name and Service Template Release, both provided in the user input and retrieved using the subscribe to published data feature in Orchestrator.

Service Template Name Equals {Service Template Name from “Initialize Data”} 

Service Template Release Equals {Service Template Release from “Initialize Data”} 

image

The Set Pending Service Update activity (shown below), which configures the details of the update to be applied to the service instance in the update, requires four parameters, the Service Name, Service Template Name, Service Template Release and the Servicing type. While this configures (sets) the actions to be performed in the update, it does not set the update in motion.

Service  Name Equals {Service Template Name from “Get Service”} 

Service Template Name Equals {Service Template Name from “Get Service Template”} 

Service Template Release Equals {Service Template Release from “Get Service Template”} 

Servicing Type Equals UseStandardServicing*

*I hard set this value in this example, as it is the type of servicing I use almost all the time. You could configure the runbook to accept the value from the user. The acceptable values are  UseStandardServicing and UseImageBasedServicing. The difference in these two in-place servicing types is described earlier in this article and at greater depth in the book.

image

The final activity in the runbook, Apply Update, requires only the Service Name, as shown below. This activity actually sets the update process in motion.

TIP: You could use a Check Schedule activity between  Set Pending Service Update and Apply Update to ensure updates are applied only during desired hours of the day and days of the week.

image

Now you’re done.  Below I have provided some details of the “before and after” updating for my sample service instance in VMM.

Service Instance Before Servicing

Service instance before servicing

image

And the sample WebDeploy app before the update

image

 

Service Instance After Servicing

Service instance after servicing

image

And the sample WebDeploy app after the update

image

Please leave questions and feedback in the comments section below this post.

 

Get System Center 2012 Orchestrator Unleashed

You can pre-order the book on Amazon at System Center 2012 Orchestrator Unleashed from Sams Publishing or on the Informit.com website at http://www.informit.com/store/system-center-2012-orchestrator-unleashed-9780672336102. While Informit is more expensive on the printed copy of the book, they give us a special deal if you bundle the e-book in with the printed copy.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.