4 minutes 793 Words
2024-10-08 00:00
Part 1 - Automate VM Rightsizing
YouTube
If you prefer to watch a succinct video on this topic check out my YouTube channel.
Use Case
The customer wanted to use Aria Operations (AO) and ServiceNow (SNOW) to automate VM rightsizing, their requirements were below.
- AO creates SNOW incident for VM rightsizing
- SNOW runs business rules / workflows
- SNOW initiates VM rightsize action via AO
- AO communicates with vCenter to rightsize VM
Below is a visual representation
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
- 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
- Click Test
AO will verify it can connect to SNOW and generate a test incident.
- Click Ok
- Click Save
Symptom Definitions
Next configure the symptom for the rightsize alert
- Click Operations then Configurations
- Click Symptom Definitions
- 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
Payload Templates
The custom payload allows us to pass AO rightsizing recommendations and other data to SNOW.
- Click Operations then Configurations
- Click Payload Templates
- Click Add
- Name = Custom Name for Payload
- Outbound method = ServiceNow Notification Plugin
- Click Next
- 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
Alert Creation
Let’s tie the above pieces together by creating an alert.
- Click Operations then Configurations
- Click Alert Definitions
- Click Add
- Enter following details:
- Name = Friendly name for the alert
- Description = Custom description
- Base Object Type = Virtual Machine
- Click Next
- 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
Leave recommendations section as default
- Click Next
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
Configure Notifications
Next we need to ensure notifications are setup for our alert.
- Click Operations then Configurations
- Click Notifications
- Click Add
- Enter following details:
- Name = Friendly name for the notification
- Description = Custom description
- Ensure Notification Status is enabled
- Click Next
- 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
- Select the following:
- Outbound method = ServiceNow Notification Plugin & name of your SNOW instance
- Cick Next
- 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
Testing the Alert
By default the symptom definition we created has a wait cycle of 3.
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.
If we dive into one of the incidents AO has sent through our custom payload….yay!
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.