Chapter 3. Invoking Automate
3.1. Automate Examples
This chapter describes the ways to invoke an Automate workflow. Automation can be initiated through an alert, an event, a CloudForms Management Engine 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 CloudForms Management Engine 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.
3.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.
3.3. Creating a Custom Button Group
This procedure shows you how to create a custom button group.
-
Navigate to
Automate→Customization. -
Click the
Buttonsaccordion. -
From the
Object Typestree, select the type of object you want to create the button group for. -
Click
(Configuration),
(Add a new Button Group). -
Type in a
Button GroupText andButton Group Hover Text, and select theButton Group Imageyou want to use. - If custom buttons have already been created, assign them to the button group. If not, see Section 3.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.
3.4. Creating a Custom Button
This procedure shows you how to create a custom button.
-
Navigate to
Automate→Customization. -
Click the
Buttonsaccordion. -
From the
Object Typestree, 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 3.3, “Creating a Custom Button Group”
-
In
Action, type in aButton TextandButton Hover Text, and select theButton Imageyou want to use. -
Select a
Dialogif applicable. -
In
Object Details, selectRequestfrom the/System/Process/dropdown. By default, the message iscreate. Do not change it. -
Type in a
Requestname for the/System/Process/Requestinstance. -
Type in the
Attribute/Value Pairsfields if applicable. -
Under
Visibility, select whichAccount Rolesyou want to have access to this button. -
Click
Addwhen you have confirmed that the button accomplishes the task you want.
The button will show in the object type you added the button to.
3.5. Editing a Custom Button
This procedure shows you how to edit a custom button.
-
Navigate to
Automate→Customization. -
From the
Object Typesdropdown, 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.
3.6. Deleting a Custom Button
This procedure shows you how to delete a custom button.
-
Navigate to
Automate→Customization, then select theButtonsaccordion. -
From the
Object Typetree in the accordion menu, select the type of object you want to remove the button from. -
Click
(Configuration). then click
(Remove this button). -
Click
OKto confirm that you want to delete this button.
3.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.
3.8. Initiating Automate from an Event
You can also use a CloudForms Management Engine 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:
3.9. Creating a Policy for Automate
This procedure shows you how to create a policy for automate.
-
Navigate to
Control→Explorer. -
Click the
Policiesaccordion, and selectControl Policies. -
Select
VM Control Policies. -
Click
(Configuration), then
(Add a New Control Vm Policy). -
Type in a
Description. -
Uncheck
Activeif 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
Eventsarea, click on theDescription of the Eventyou want to assign an action to. -
Click
(Edit Actions for this Policy Event).
-
Check the events you want to use to send to an
-
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.
3.10. Creating a Custom Automate Action
This procedure shows you how to create a custom Automate action.
-
Navigate to
Control→Exploreraccordion. -
Click the
Actionsaccordion. -
Click
(Configuration), then
(Add a new Action). -
Type in a
Descriptionfor the Action. -
Select
Invoke a Custom AutomationfromAction Type. In
Custom Automation,-
For
Message, typecreate. -
For
Request, type in the name of the instance of the/System/Process/Request Classin the second.
-
For
-
Type in the
Attribute/Value Pairsfields 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.