Workflow: Automatic Shutdown of Idle Machines with vRealize Operations and vRealize Automation

Workflow: Automatic Shutdown of Idle Machines with vRealize Operations and vRealize Automation

vRealize Orchestrator workflow: Power Off Idle virtual machine through vRealize Automation, and Notify owner.

This workflow intended to be called by vRealize Operations Manager action, such as on an alarm. The workflow shuts down a managed virtual machine in vRealize Automation and notifies the current owner of the shutdown action.


The workflow operates as below:

  1. Takes 3 inputs, all expected to come from vRealize Operations remediation action:
    • VM identity: Managed Object ID, in the form "vm-1234".
    • Correlation Event ID: An identifier that links the action back to the event in vRealize Operations that caused the trigger.
    • vCenter UUID: Unique identifier for the vCenter in which the VM is registered.
  2. Looks up vCenter VM object, pulls out the "InstanceUUID" that vRealize Automation uses as reference
  3. Looks up vRealize Automation VM object using the "vmUniqueId", searches out Shutdown action reference, Owner's email address and URL directly back to the VM in vRealize Automation.
  4. Calls vRealize Automation shutdown action.  This will fail if (a) the VM is no longer running, or (b) the service account connected to vRA does not have access to the Shutdown action.
  5. Emails owner with notification, including URL to take the owner straight to the VM if needed (for quick powering on again!).


Requirements

  • vRealize Operations 6.1.  Intended to be used for either manually triggered alarm actions, or for auto-triggered actions in 6.1.
  • vRealize Automation 6.2.  Required for the shutdown action and owner information.  Not tested with other versions.
  • vRealize Orchestrator 6.1.  The workflows may work with other versions, but has not been tested.
  • vRO Solution and Workflow Package for vRealize Operations Manager: Available here ‌from the Solutions Exchange.


The workflow needs the following information populated for the deployed environment. All these details are populated by first running the "Configure Workflow Elements" workflow.

  • vCACCAFEHost: points to the vRA appliance instance.
  • Email details:
    • smtpHost: email server for sending notifications
    • smtpPort: (probably can leave it as port 25, standard)
    • username and password: for email server authentication, if needed.
    • fromName and fromAddress: to represent sender of the automatic email notification.


If desired, edit the workflow script item “Populate email subject and content” to have the desired email template (HTML encoded).

Attachments
Version history
Revision #:
1 of 1
Last update:
‎08-19-2015 05:44 PM
Updated by: