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

This article, which details how to scale out 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 Out of a Service in VMM

In case you are not familiar with machine tier scale out, it is the process of adding an additional VM to a specific tier of a running service in VMM. After you have deployed a service in VMM and you need to deploy additional virtual machines to a tier of the service, you can use the scale out functionality of VMM. For example, during the holiday shopping season, your website may need additional web servers deployed to handle the increase in traffic to your site.When you create a tier in a service template, you can specify whether that tier can be scaled out and the minimum and maximum number of virtual machines that you can deploy in the tier.

If you try to scale out a tier beyond its maximum tier size, you will receive a warning, but VMM will not prevent you from scaling out 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 or see “How to Scale Out a Service in VMM” at http://technet.microsoft.com/en-us/library/gg675080.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 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 Out Service Runbook
    • High Level View
    • Runbook Configuration 
  • Service Instance Before Scale Out 
  • Service Instance After Scale Out

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

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

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

The Get Tier activity (shown below), which retrieves the details of the machine tier targeted for scale out 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 Out activity (shown below), which initiates the scale out operation, requires four parameters, the Service Name,  Tier Name, StartAction and Stopaction, configured as described below

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

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

StartAction to set VM startup behavior, set to ‘Never automatically turn on…’ in this example

StopAction to set VM stop behavior, set to ‘Save state’ in this example

Use the picker in StartAction and StopAction to choose preferred behavior from the list provided.

TIP: You could also retrieve the Service Name and Tier Name from the Get Service and Get Tier activities, though in this case presumably those 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 Out

Service instance before scale out

image

Service Instance After Scale Out

Service instance after scale out

Immediately after the runbook executes, you will see the scale out operation results in an additional VM being added to 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.

12 thoughts on “Orchestrator By Example: Scaling Out 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. Tommy Gunn

    You probably have the VMM 2008 R2 integration pack loaded. Those activities were added in VMM 2012 IP.

  3. Miguel Mota

    Hello Tommy,

    Thanks for the fast answer!

    I loaded the VMM 2012 Integration Pack. I’m using all 2012 SP1.

    I just don’t know what to do… they just don’t show up.

  4. Miguel Mota

    Hello Pete,

    Where do i get VMM 2012 SP1 IP from? I got mine on this link and i think that’s correct, or not?

    http://www.microsoft.com/en-us/download/details.aspx?id=28725

    The only activities that shows in the activities panel on Orchestrator (VMM tab) are these ones:

    Create Checkpoint
    Create New Disk from VHD
    Create Network Adapter
    Create New Disk
    Create User Role
    Create VM from Template
    Create VM from VHD
    Create VM from VM
    Remove User Role
    Get Checkpoint
    Get Disk
    Get Network Adapter
    Get User Role
    Get VM
    Manage Checkpoint
    Move VM
    Remove VM
    Repair VM
    Resume VM
    Run VMM PowerShell Script
    Shut Down VM
    Start VM
    Stop VM
    Suspend VM
    Update Disk
    Update Network Adapter
    Update VM
    Update User Role Property
    Update User Role Quota

    I really need to make my Scale Tier Out and In automated! I must be doing something wrong!

  5. Miguel Mota

    Please,

    Anyone could help me on his one? I don’ know what to do anymore! I’m not loadingthe wrong VMM IP into my Orchestraor, but the activities doesn’t show up!

  6. Miguel Mota

    There were no previous version. This was first install.

    The latest version of the VMM IP is 7.0.1298.0, correct?

    I’ve re-deployed the VMM IP into the runbook server, but with no success. It keeps not showing the activities i need…

    Does anyone have any idea what’s happening here?!?

     

    Thanks guys!

  7. Miguel Mota

    Ok,

    I managed to get the activities in place. The version of the IP was not the last one.

     

    I created the runbook, but when i test it it gives me error in the “Scale Out” operation. The error is the following:

     

     

    The following errors occurred when invoking PowerShell script:Could not find service with ServiceName='{ServiceName from “Initialize Data”}’

    Exception: InvalidOperationException
    Target site: PSRunspaceInvoker.HandleInvokeErrors

    Stack trace:
    at Microsoft.SystemCenter.Orchestrator.Integration.PowerShellConnector.PSRunspaceInvoker.HandleInvokeErrors(IList invokeErrors)
    at Microsoft.SystemCenter.Orchestrator.Integration.PowerShellConnector.PSRunspaceInvoker.Invoke(RunspaceInvoke runspace, String script, ILogger logger)
    at Microsoft.SystemCenter.Orchestrator.Integration.PowerShellConnector.PSScriptRunner.Execute(String script)
    at Microsoft.SystemCenter.Orchestrator.Integration.VMM2012QIK.ActivityBase.DoWork(IActivityRequest request, IActivityResponse response)
    at Microsoft.SystemCenter.Orchestrator.Integration.VMM2012QIK.ScaleTierOut.DoWork(IActivityRequest request, IActivityResponse response)
    at Microsoft.SystemCenter.Orchestrator.Integration.VMM2012QIK.VMMBase.Execute(IActivityRequest request, IActivityResponse response)

     

    Anyone could help me on this one?

Leave a Reply

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