Creating automation policies
Automation engineers or developers create automation policies to remediate issues or problems based on the events generated in BMC Helix Operations Management or BMC Helix AIOps. Automation policies contain actions that connect with the automation applications supported by BMC Helix Intelligent Automation to perform remediation actions for events.
You can either create policies directly or create them for a requested event, displayed in the Requests page. A policy runs only if it is in a published state.
To create an automation policy
Perform the following steps to create an automation policy.
Step 1: To provide the policy information and specify the execution mode
- In the BMC Helix Intelligent Automation console, go to Policies and click Create Automation Policy.
- In the Policy Information section, enter a unique name and an optional description for the policy.
Select the execution mode as Manual or Automatic depending upon whether you want to execute the policy manually or automatically based on the incoming events.
Can I change the execution mode later?
Yes, you can edit the policy and change the mode anytime.
Step 2: To define the trigger condition to match the incoming event
- In the Trigger section, click Browse, and do one of the following:
From the Select Event Type tab, select an existing event type and click Done.
The trigger condition from the event is listed in the following format: <eventCategory>: <eventName>.
Where do these event types come from?
Out of all incoming events, BMC Helix Intelligent Automation shows the latest event for each event type (in case of multiple events of the same type but with different values).
Why don't I see any existing event types to choose from?
Out of a huge number events, BMC Helix Intelligent Automation chooses events from each type randomly as a sample. Hence, either the product has not received any events from the source or it may take a while for the event types to be listed.
- On the Paste Event JSON tab, enter the event information in the JSON format, and click Done.
Click anywhere in the Trigger Condition box to start building the expression for a trigger condition, and use the suggested parameters, values, and operators to complete the expression.
For sample expressions, see Trigger condition expression.
Step 3: To select actions to be run as part of the policy
To add action to the policy, click Add Action and perform the following steps using the action wizard:
From the Pick an automation tool section, click the connector name.
Only configured connectors are displayed here. The wizard takes you to the next step to select an action.
- Click Sync Actions.
All actions available in the selected connector appear.
- Click Select against the action that you want to add to the policy.
The wizard takes you to the next step to configure an action.
Depending on the selected action, provide the information and click Done.
Based on the selected event, the event slots with the values specified in the event appear under the Parameters section on the UI. You can click any of the parameters and its value gets copied. You can paste it while defining the action in the policy.
The added action appears in the Action Configuration section. You can add multiple actions in a policy.
Adding action for supported applications
To add action for a specific automation application, see the following documentation for an example for each of the supported connections:
- Terminating, starting, or stopping an EC2 instance (AWS)
- Restarting PATROL Agent on a server (Ansible Tower)
- Resizing a deployment (Kubernetes)
- Executing a workflow (TrueSight Orchestration)
- Running a job in Jenkins (Generic REST API)
Invoking a process in BMC Helix Innovation Studio (BMC Helix Innovation Suite)
Step 4: To add tags
- To add system or custom tags to the policy, perform the following steps:
- System tags: Select one or more tags from the list of available system tags.
Based on the event, some system tags are displayed.
- Custom tags: In the Tags (Optional) section, enter a key-value pair.
Tag key should start with an alphabet and end with an alphanumeric character. Key supports alphanumeric characters and periods, dashes, and underscores.
- System tags: Select one or more tags from the list of available system tags.
Step 5: To configure change management for creating change requests
To create a change request as part of this policy, perform the following steps:
- If not enabled already, use the Enable change ticket creation toggle button and then click Modify to add change request values.
Select the appropriate values for the following fields and click Save:
- First Name: By default, first and last name of the logged-in user appears.
When you enter the first name, based on the selected company, the list of user names belonging to that company appear in a list in the
<username-firstname-lastname>format. If there are multiple users with the same first name, you can select the correct user from the list. When you select the first name, the last name gets selected.
- Last Name
Description: By default, contains the name of the product, BMC Helix Intelligent Automation. The description is updated in the Summary field in the change request in BMC Helix ITSM. Ensure that the description is up to 100 characters only.
The selected values are displayed. When a change is created in BMC Helix ITSM, it will contain the values specified in the policy.
In case the user credentials for the BMC Helix ITSM get changed for the tenant, it takes 15 minutes to reflect the changes in BMC Helix Intelligent Automation. In this time period, if the the policies with change management options are triggered, they fail and display an authentication failed error. After 15 minutes, if the policies are triggered again, they will successfully run.
After the change request is approved in BMC Helix ITSM, the policy is triggered and runs the actions.
Step 6: To provide estimated savings
- In the Estimated Savings section, enter an approximate time (in minutes) and money (in USD) that you may save by automating the actions.
- Continue to the next step
Step 7: To configure notifications and publish policy
By default, the Generate Information Event on execution check box is selected. Every time this policy runs, an information event (
AUTOMATION_STATUS_EV class) is generated in BMC Helix Operations Management.
- For policies that are already created, information events are generated in BMC Helix Operations Management. If you do not want the information events, edit a policy and clear the check box.
- If you clear the check box:
- Policy execution is not counted in the Automation Runs count in BMC Helix Intelligent Automation Value Dashboard. For more information, see Viewing policies in BMC Helix Dashboards.
- If users run this automation policy from BMC Helix AIOps, the status of the policy in BMC Helix AIOps still shows Running even if the policy may have run successfully.
- If you do not want to generate information events of the type
Automation_Status_EVin BMC Helix Operations Management for the out-of-the-box policies created as part of solutions (Blackout Policy or Proactive Service Resolution), then you must configure the solution again. If you configure the solution again, automation status information events are not generated.
Select Publish Policy and click Save.
(Optional step) To test a policy
When creating a policy, you can select an event from the list of events that have occurred in BMC Helix Operations Management. BMC Helix Intelligent Automation listens to BHOM over a period of time and shows a list of event types to make it easy to build policies. For testing, BMC Helix Intelligent Automation uses the event data selected as part of the policy creation process. It does not create a new event, or wait for a new event coming from BMC Helix Operations Management.
However, changing the trigger conditions may cause the policy to fail during testing if the new conditions don't match the stored event type. For example, if you select a "Service Down" event to create a policy, BMC Helix Intelligent Automation uses a "Service Down" event stored in the product. If you change the trigger conditions, the test may fail if they don't match the stored event.
Click Test Policy.
You are prompted to save the policy.
On the Test Inputs tab, enter parameter values for testing (if required by the policy being tested).
The results appear in the Test Results tab.
If the policy test is successful, the policy is created and executed on the resource you provide during testing.
Can I test a policy later?
Yes, however, you need to change a policy status to draft and edit the policy to test it. BMC recommends that you test a policy while creating it.
Trigger condition expression
To build a trigger condition expression, you can use the expression builder provided by BMC Helix Intelligent Automation while creating an automation policy. To learn more, see Trigger condition.
The following table lists sample conditions and the events that will match to those conditions:
|Trigger condition example
|Service is down
|Matches any event where
SERVICES_Spooler Service status == 3 0 - Running, 1 - Ok not running, 2 - Warning not running, 3 - Alarm not running for 1 min. and
source_hostname equals the hostname specified in the condition, and the
Click here to view a sample Windows Service Down event
|Matches any event where the tags.platform contains kubernetes,
payload.resources[*].cluster contains the name of the cluster and the
Click here to view an overallocated container event
|Stop an Amazon EC2 instance
|Matches any event where the
event_type field contains
ec2_stop and the
Sample event for AWS EC2 instance
Where to go from here
After successfully creating policies, you can view the automation policies in the console, see Viewing, editing, and copying automation policies.