Orchestrator By Example: Scaling In a Machine Tier in a VMM Service with Orchestrator

This article, which details how to scale in a VMM service instance with Orchestrator to automate the provisioning of additional capacity, 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 Scale In of a Service in VMM

In case you are not familiar with machine tier scale in, it is the process of removing a VM from a specific tier of a running service in VMM. After you have added VMs to a tier (scaled out the tier) to provide additional capacity, you can remove one or more VMs from the tier to conserve resources and reduce costs when the increase in demand subsides. If you try to scale in a tier below its minimum tier size, you will receive a warning, but VMM will not prevent you from scaling in the tier. However, after the virtual machine is deployed, the tier and the service will show a status of Needs Attention in the VMs and Services workspace.

For more info, see chapter 16 in the upcoming Orchestrator Unleashed book. There is no native “scale in” operation in VMM (you would just delete a VM), so I have no related link on TechNet.

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 services and 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 Scale In Service Runbook
    • High Level View
    • Runbook Configuration 
  • Service Instance Before Scale In 
  • Service Instance After Scale In

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

High Level View of the Scale In Service 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 ensure the scale in operation is performed on correct running instance and machine tier
  • Retrieves the running service instance provided in user input
  • Retrieves the  machine tier targeted for scale in (as provided in user input)
  • Initiates the scale in operation

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 this version before you put it into production use.

The Scale In Service Runbook

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

  • Service Name – The display name of the running service instance in VMM
  • Tier Name – The display name of the service template

image_thumb[17]

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 Name from “Initialize Data”} 

image_thumb[9]

The Get Tier activity (shown below), which retrieves the details of the machine tier targeted for scale in the within running service instance , requires two parameter, the Tier Name and the Service Name, provided in the user input and retrieved using the subscribe to published data feature in Orchestrator.

Tier Name Equals {Tier Name from “Initialize Data”} 

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

TIP: I recommend to customers to establish consistent names for machine tiers within their services (like ‘Web Tier’, ‘App Tier’, ‘Data Tier’, etc.). If you follow this strategy, you will definitely need to provide the service instance by name or ID to ensure the runbook only retrieves the machine tier instance within the target service. Otherwise, multiple machine tiers (in multiple services) may be retrieved by this activity. If you use service name, you will also need to be sure you use unique names when creating services in VMM. More on this in an article on service deployment in VMM with Orchestrator.

image

The Scale Tier In activity (shown below), which initiates the scale in operation, requires two parameters, the Service Name and Tier Name, configured as described below

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

Tier Name Equals {Tier Name from “Initialize Data”}* 

NOTE: You could also retrieve the Service Name and Tier Name from the Get Service and Get Tier activities, though in this case presumably those activities will have failed if the values provided to Initialize Data were not correct. You always want to configure the most reliable options in your runbooks.

image

In Optional Properties, you will find you can add properties such as Computer Name, Virtual Machine Name and Description if you wish to specify the VM name in advance or to add a description.

Service Instance Before Scale In

Service instance before scale in

This runbook assumes you are not attempting to scale in below the minimum instance count for the tier, so presumably you will have a VM count in the target service / machine tier of greater than one VM when you attempt to test the runbook.

image

Service Instance After Scale In

Service instance after scale in

After scale in, you should have one less VM, but still have at least one VM in the tier.

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 you a special deal if you bundle the e-book in with the printed copy.

2 thoughts on “Orchestrator By Example: Scaling In a Machine Tier in a VMM Service with Orchestrator

  1. Miguel Mota

    Greetings,

    I’m new in this System Center world, but i’ve installed all correctly and download, register and deployed the Integration Pack referred to VMM. In the activities panel, the options “Get Tier”,  “Get Service” and “Scale Out” doesn’t show up. Only the defaults like “Get Disk” and “Get VM”…

    How do i find it or configure them?

    Thanks in advance!

  2. Miguel Mota

    Hello,

    When i run the runbook tester, when it passes to “Get Service” activities it gives me an error saying:

    “Computer Name must be specified in the configuration before running this activity.”

    What should i do?

Leave a Reply

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