Quantcast
Viewing all articles
Browse latest Browse all 36188

Automation–Orchestrator Runbook Spotlight–Virtual Machine Startup by Priority

Hello Readers/Viewers!

Today we are going to take an in depth look at a specific example Runbook – Virtual Machine Startup by Priority

Use Case:

Ability to query Virtual Machine Manager for Virtual Machines (for more than 1 Virtual Machine) within a Cloud, then start up those Virtual Machines in a specified order.

Components leveraged in this example:

  • System Center 2012 SP1 - Orchestrator
  • System Center 2012 SP1 - Virtual Machine Manager
  • System Center 2012 SP1 - Orchestrator Integration Pack for VMM
  • Windows Server 2012 with Hyper-V
  • Windows PowerShell

Example Solution Theory:

  • Create two Orchestrator Runbooks:
    • Runbook 1: To query Virtual Machine Manager through the Integration Pack for VMM;
    • Runbook 2: To process the startup actions for each VM
  • High Level Logic and Flow:
    • Virtual Machine data would be passed from Runbook 1 to Runbook 2 (Sub-Runbook)
    • Priority is configured and determined by the “Delayed Start Time” setting
    • Startup actions are dependent on the “Delayed Start Time (s)” for each VM
  • Runbook 1 Special Logic Used:
    • Junction: Merge two paths, Wait for individual “streams” of data (from both paths), Republish “Cloud Name” for “Complete” Notification, Collapse Multi-Value Data coming from the “Get VMs” path so that subsequent activities only execute once
    • Get VM Status Flatten and Loop: Flatten Multi-Value Data with Delimiter, Loop Until all VMs are in a “Running” state (or at least not in “Starting” or “Stopped” state – other non-Running states can be added as well)
  • Runbook 2 (the Sub-Runbook) is configured to execute concurrently (for as many VMs are in the Cloud)
    • If the “Delayed Start Time (s)” settings for all VMs in the Cloud are set to “0”, then all VMs will start up at the same time.
    • Staggered “Delayed  Start Time (s)” settings for each VM will allow them to start up in a specific order

Example Solution Execution:

Runbook 1:

Image may be NSFW.
Clik here to view.
image

Runbook 2:

Image may be NSFW.
Clik here to view.
image

Example Solution Runbook Download:

Click here for the TechNet Gallery Contribution for these Example Runbooks!

Notes on Importing the Example Runbooks:

  1. Download the VM_Startup_by_Priority_Example_Runbooks_20130619.ois_export File
  2. Create a New Folder and Import the VM_Startup_by_Priority_Example_Runbooks_20130619.ois_export File into Orchestrator
    (recommended settings)
    Image may be NSFW.
    Clik here to view.
    image
  3. Ensure that a VMM Connection is created with the name of “SC2012SP1 VMM Connection
    (this is the name of what the existing VMM Activities are configured to use for the export)
    Image may be NSFW.
    Clik here to view.
    image

    Image may be NSFW.
    Clik here to view.
    image

Example Solution Runbook Activity Screen Captures:

Runbook 1:

Initiate VM Start by Priority:

Image may be NSFW.
Clik here to view.
image

Get VMs:

Image may be NSFW.
Clik here to view.
image

Invoke Start VMs:

Image may be NSFW.
Clik here to view.
image

Junction:

Image may be NSFW.
Clik here to view.
image

Get VM Status:

Image may be NSFW.
Clik here to view.
image

Get VM Status – Looping (General Tab):

Image may be NSFW.
Clik here to view.
image

Get VM Status – Looping (Exit Tab):

Image may be NSFW.
Clik here to view.
image

Get VM Status – Looping (Do Not Exit Tab):

Image may be NSFW.
Clik here to view.
image

Send Platform Event (Complete):

Image may be NSFW.
Clik here to view.
image

Runbook 2:

Initiate VM Start:

Image may be NSFW.
Clik here to view.
image

Run .Net Script (Delay Start by Priority):

Image may be NSFW.
Clik here to view.
image

Start VM:

Image may be NSFW.
Clik here to view.
image

Return Data (Return VM Status):

Image may be NSFW.
Clik here to view.
image

Runbook 2 (0.2 VM Startup by Priority Example - Start VMs) – Job Concurrency Settings:

Image may be NSFW.
Clik here to view.
image

Example Solution VM Delay Start Up (seconds) Configuration Screen Captures (from VMM Console):

VM - spftest03 (Priority 3):

Image may be NSFW.
Clik here to view.
image

VM - spftest02 (Priority 2)

Image may be NSFW.
Clik here to view.
image

VM - spftest01 (Priority 1)

Image may be NSFW.
Clik here to view.
image


For more information and tips/tricks for Orchestrator, be sure to watch for blog posts in the Automation Track!

enJOY!


Image may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 36188

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>