Chapter 2. Invoking Automate
2.1. Automate Examples
This chapter describes the ways to invoke an Automate workflow. Automation can be initiated through an alert, an event, a Red Hat CloudForms application, or a custom button. The same automation process can be re-used across more than one of these. For example, using automation to remove orphaned virtual machines and instances could be initiated by:
- An administrator request from the Red Hat CloudForms console (from a custom button)
- An alert indicating the datastore has less than 20% free-space
- A virtual machine or instance unregistered event is detected
All invocations of an automate model must enter through the /System/Process namespace.
2.2. Invoking Automate using a Custom Button
One of the ways to invoke an Automate model is to map an instance from the /System/Process/Request class to a custom button. Before creating the button, you need to have an instance in the /System/Process/Request class to map to it and a button group to assign it to.
Create buttons for a cluster, host, datastore, provider, virtual machines or cloud instances. When the button is clicked, the model will be invoked for the selected item. For each of these, you can have up to 15 buttons.
2.3. Creating a Custom Button Group
This procedure shows you how to create a custom button group.
- Navigate to → .
- Click the Buttons accordion.
- From the Object Types tree, select the type of object you want to create the button group for.
-
Click
(Configuration),
(Add a new Button Group).
- Type in a Button Group Text and Button Group Hover Text, and select the Button Group Image you want to use.
- If custom buttons have already been created, assign them to the button group. If not, see Section 2.4, “Creating a Custom Button” to create custom buttons.
- Click Add.
The button group will show in the object type you added the button to.
2.4. Creating a Custom Button
This procedure shows you how to create a custom button.
- Navigate to → .
- Click the Buttons accordion.
- From the Object Types tree, select the type of object you want to create the button for.
- Click Unassigned Buttons.
Click
(Configuration), then
(Add a new Button).
NoteIf
(Add a new Button) is not available, that means you have not created a button group for that object. To continue, create a button group first. See Section 2.3, “Creating a Custom Button Group”
- In Action, type in a Button Text and Button Hover Text, and select the Button Image you want to use.
- Select a Dialog if applicable.
-
In Object Details, select Request from the
/System/Process/dropdown. By default, the message iscreate. Do not change it. -
Type in a Request name for the
/System/Process/Requestinstance. -
Type in the
Attribute/Value Pairsfields if applicable. - Under Visibility, select which Account Roles you want to have access to this button.
- Click Add when you have confirmed that the button accomplishes the task you want.
The button will show in the object type you added the button to.
2.5. Editing a Custom Button
This procedure shows you how to edit a custom button.
- Navigate to → .
- From the Object Types dropdown, select the type of object you want to edit the button for.
- Click the button you want to edit.
-
Click
(Configuration),
(Edit this Button).
- Modify as required.
- Click Save.
2.6. Deleting a Custom Button
This procedure shows you how to delete a custom button.
- Navigate to → , then select the Buttons accordion.
- From the Object Type tree in the accordion menu, select the type of object you want to remove the button from.
-
Click
(Configuration). then click
(Remove this button).
- Click OK to confirm that you want to delete this button.
2.7. Using a Custom Button
This procedure shows you how to use custom buttons to invoke a cluster, host, datastore, provider, virtual machine or instance.
- Go to the page for the item that you created a button for.
- Click the custom button group from the taskbar, and then your custom button.
The automate model is invoked for the specified item.
2.8. Initiating Automate from an Event
You can also use a Red Hat CloudForms Policy Event to initiate automation. You can either use the provided Raise Automation Event action or create a custom automation action. The first case will start in the /System/Process class, but then go to the Event that initiated the Automate model in the /System/Process/Event Class. If you create your own custom action, it will start from the /System/Process class and then go to the /System/Process/Request Class instead.
For example, suppose that you always want the same Automate model to occur when a virtual machine is created. You would use the Raise Automation Event Action. There are instances in the /System/Process/Event Class for the following Events that you can select as part of a Policy:
2.9. Creating a Policy for Automate
This procedure shows you how to create a policy for automate.
- Navigate to → .
- Click the Policies accordion, and select Control Policies.
- Select Vm Control Policies.
-
Click
(Configuration), then
(Add a New Control Vm Policy).
- Type in a Description.
- Uncheck Active if you do not want this policy processed even when assigned to a resource.
- Click Add. You are brought to the page where you add conditions and events to your new policy.
Click
(Configuration), then
(Edit this Policy’s Event assignments).
- Check the events you want to use to send to an Automate Model.
- Click Save.
- From the Events area, click on the Description of the Event you want to assign an action to.
-
Click
(Edit Actions for this Policy Event).
-
Select Raise Automation Event, and click
(Move selected Actions into this Event).
- Click Save.
You can now assign this policy to a Policy Profile. Then, assign the policy profile to the virtual machines. Every time this event happens on the virtual machine the appropriate Automate Model will be initiated.
If you want the policy to initiate an Automate Model from the /System/Process/Request class, then you can create your own custom action. Be sure to have an instance in the /System/Process/Request class for it to map to.
2.10. Creating a Custom Automate Action
This procedure shows you how to create a custom Automate action.
- Navigate to → accordion.
- Click the Actions accordion.
-
Click
(Configuration), then
(Add a new Action).
- Type in a Description for the Action.
- Select Invoke a Custom Automation from Action Type.
In Custom Automation,
-
For Message, type
create. -
For Request, type in the name of the instance of the
/System/Process/Request Classin the second.
-
For Message, type
- Type in the Attribute/Value Pairs fields if applicable.
- Click Add.
The action is created and can be added to a policy.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.