Rightsize

YouTube

If you prefer to watch a succinct video on this topic check out my YouTube channel.

thumbnail

Use Case

The customer wanted to use Aria Operations (AO) and ServiceNow (SNOW) to automate VM rightsizing, their requirements were below.

  1. AO creates SNOW incident for VM rightsizing
  2. SNOW runs business rules / workflows
  3. SNOW initiates VM rightsize action via AO
  4. AO communicates with vCenter to rightsize VM

Below is a visual representation

Usecase

Pre-requisites

I am assuming the following is configured:

  • AO Server (my lab running v8.18.1)
  • ServiceNow Instance

You can sign up for a temporary ServiceNow developer instance, I used one to write this blog post.

Steps Prior To Alert Creation

An alert is required to create an incident in SNOW. The follow items need configuration before creating an alert:

  • Outbound Settings
  • Symptom Definitions
  • Payload Templates

Outbound Settings

AO provides a native plugin to integrate with SNOW:

  • Login to AO
  • Click Operations then Configurations
  • Click Outbound Settings

OutboundSettings

  • Click Add
  • Enter / select the following options (configure other options as required)
    • Plugin Type = ServiceNow Notification Plugin
    • Instance Name = Friendly name
    • Url = Url of your SNOW instance
    • Credential type = Basic Authentication
    • Credential = Enter your SNOW credentials

snowSettings

  • Click Test

AO will verify it can connect to SNOW and generate a test incident.

Test

TestIncident

  • Click Ok
  • Click Save

Symptom Definitions

Next configure the symptom for the rightsize alert

  • Click Operations then Configurations
  • Click Symptom Definitions

symptom

  • Ensure Metric/Property tab is selected
  • Click Add
  • On the right hand widget select:
    • Base Object Type = Virtual Machine
    • Symptom Type = Metric
    • Select Specific Object = Size (this is a metric filter)
    • Metric = Choose is Oversized or is Undersized
  • Click Save

In this example I’ve configured a symptom for oversized VMs

configsymptom

Payload Templates

The custom payload allows us to pass AO rightsizing recommendations and other data to SNOW.

  • Click Operations then Configurations
  • Click Payload Templates

payloadtemplates

  • Click Add
  • Name = Custom Name for Payload
  • Outbound method = ServiceNow Notification Plugin
  • Click Next

template1

  • Add Object Type = Virtual Machine
  • In the right hand widget:
    • Expand Metrics - Summary - Oversized
    • Drag Memory (KB) & Virtual CPUs to the left widget
    • I’ve added other properties, customise to suit requirements (your SNOW admin may require specific data)
  • Click Ok
  • Click Create

template2

Alert Creation

Let’s tie the above pieces together by creating an alert.

  • Click Operations then Configurations
  • Click Alert Definitions

Alert

  • Click Add
  • Enter following details:
    • Name = Friendly name for the alert
    • Description = Custom description
    • Base Object Type = Virtual Machine
  • Click Next

Alert1

  • Enter following details:
    • Defined On = self
    • Select Symptoms
    • Select Symptom = Metric/Property
    • Filter = oversized (or custom name for your symptom definition)
  • Drag the Oversized VM symptom to the left widget as shown below
  • Click Next

Alert2

Leave recommendations section as default

  • Click Next

Alert3

In my lab I have one policy. Ensure you select the appropriate policies where the alert should be enabled

  • Select the required policies
  • Click Create

AlertExtra

Configure Notifications

Next we need to ensure notifications are setup for our alert.

  • Click Operations then Configurations
  • Click Notifications

Notifications

  • Click Add
  • Enter following details:
    • Name = Friendly name for the notification
    • Description = Custom description
  • Ensure Notification Status is enabled
  • Click Next

Notifications1

  • Enter following details:
    • Object Type = Virtual Machine
    • Category = Alert Definition
    • Alert = Oversized VMs (or custom name of your alert)
    • Control State = Open
    • Status = All Statuses
    • Heartbeat = Not Active (do not select)
  • Click Next

Notifications2

  • Select the following:
    • Outbound method = ServiceNow Notification Plugin & name of your SNOW instance
  • Cick Next

Notifications3

  • Select Payload Template = Oversized VM (or your custom payload template name)

Below the custom template there are a number of SNOW fields which can be passed from AO. I’ve left mine blank but update as necessary (consult with your SNOW administrator).

  • Click Create

Notifications4

Testing the Alert

By default the symptom definition we created has a wait cycle of 3.

Cycle

What does this mean? A cycle refers to an AO collection cycle which is 5 minutes but the is Oversized and is Undersized metric is calculated every hour. By default these alerts will not be generated until 3 hours later (it could be slightly less time depending on where you are in the collection cycle).

An extract of the AO alerts and SNOW incidents can be seen below.

aolerts

snowincidents

If we dive into one of the incidents AO has sent through our custom payload….yay!

custompayload

Conclusion

When I think of integrating different vendor products together my immediate thought is How much custom code is required? The native ServiceNow integration with Aria Operations makes it easy to create incidents based on AO alerts.

In this post we covered how to automate the creation of ServiceNow incidents. In Part II we will cover the API’s required to complete the automation for the customer’s use case.