-
Language:
English
-
Language:
English
Red Hat Training
A Red Hat training course is available for Red Hat CloudForms
Chapter 3. Actions
Actions are performed after the condition is evaluated. Control comes with a set of default actions that you can choose from. You can also create some of your own.
Table 3.1. Default Actions and Descriptions
Action | Description |
---|---|
Cancel vCenter Task | Stop current vCenter Task. Due to limitations of vCenter, this applies only to cloning tasks. |
Check Host or VM Compliance | Run compliance checks. |
Collect Running Processes on VM Guest OS | Collect the list of running processes from the guest operating system. |
Connect All CD-ROM Drives for Virtual Machine | Connect all the CD-ROM drives for the virtual Machine. |
Connect All Floppy Drives for Virtual Machine | Connect all the floppy drives for the virtual machine. |
Connect All Floppy and CD-ROM Drives for Virtual Machine | Connect all of the floppy and CD-ROM drives for virtual machine. |
Convert to Template | Convert this virtual machine to a template. |
Delete all Snapshots | Remove all snapshots for a virtual machine. |
Delete Most Recent Snapshot | Removes a virtual machine’s most recent snapshot. |
Delete VM from Disk | Remove the virtual machine from disk. |
Disconnect All CD-ROM Drives for Virtual Machine | Disconnect all the CD-ROM drives for the virtual machine. |
Disconnect All Floppy Drives for Virtual Machine | Disconnect all the floppy drives for the virtual machine. |
Disconnect All Floppy and CD-ROM Drives for Virtual Machine | Disconnect all of the floppy and CD-ROM drives for virtual machine. |
Execute an external script | Run an external script. |
Generate Audit Event | Write an entry to the audit log and to the VMDB. |
Generate log message | Write an entry to the Red Hat CloudForms log. |
Initiate SmartState Analysis for Host | Start a SmartState Analysis for a host. |
Initiate SmartState Analysis for VM | Start a SmartState Analysis for a virtual machine. |
Invoke a Custom Automation | For use with Red Hat CloudForms automate. It enables you to run tasks and notifications automatically. |
Mark as Non-Compliant | Used with compliance policies. Mark resource as non-compliant. (Compliance status is viewable in summary screens.) |
Prevent current event from proceeding | Stop the current event from continuing. |
Put Virtual Machine Guest OS in Standby | Put the virtual machines operating system in standby mode. |
Raise Automation Event | Used with Red Hat CloudForms automate. |
Refresh data from vCenter | Perform a refresh of the vCenter. |
Remove Virtual Machine from Inventory | Take the virtual machine out of inventory. |
Retire Virtual Machine | Retire the virtual machine. (It will remain in inventory, but cannot be started.) |
Show EVM Event on Timeline | To show the EVM event on the timeline. |
Shutdown Virtual Machines Guest OS | Shut down the virtual machine’s operating system. |
Start Virtual Machine | Power on the virtual machine. |
Stop Virtual Machine | Power off the virtual machine. |
Suspend Virtual Machine | Suspend the virtual machine. |
3.1. Custom Actions
You can create a custom action using the Red Hat CloudForms console. Enter a description and action type. Procedures for each type of action are shown in the sections below. When you create a policy, you can associate actions with specific events.
Table 3.2. Custom Actions and Descriptions
Custom Action | Description |
---|---|
Assign Profile to Analysis Task | When initiating a Smart State Analysis event, you can assign a specific analysis profile. |
Create a Snapshot | Creates a snapshot with a name that you provide. |
Delete Snapshots by Age | Removes snapshots based on how old they are. |
Evaluate Alerts | Checks for alerts. This is required for the alert to be delivered. |
Inherit Parent Tags | Assigns tags from the parent cluster, host, datastore, or resource pool. |
Invoke a Custom Automation | For use with Red Hat CloudForms automate. |
Reconfigure CPUs | Reconfigure the number of CPUs for a virtual machine to the number you specify. |
Reconfigure Memory | Reconfigure the amount of memory for a virtual machine to the amount you specify. |
Remove Tags | Removes tags from the resource. |
Send an E-mail | Send an email to an address that you provide. This type of action can be used in an alert. |
Send an SNMP trap | Send an SNMP (Simple Network Management Protocol) trap to the host you specify. This type of action can be used for an alert. |
Set a Custom Attribute in vCenter | Set the value of a custom attribute in vCenter. |
Tag | Assign a company tag that you specify to a virtual machine. |
3.1.1. Creating an Assign Profile to Analysis Task Action
Use this action for assigning specific analysis profiles to virtual machines. You must create an analysis profile before assigning it to an action. You can only assign this action to an analysis start event. See Configuration in General Configuration for information on how to create analysis profiles.
- Navigate to Control → Explorer.
-
Click the Actions accordion, then click
(Configuration),
(Add a new Action).
Type in a Description for the Action Type.
- Select Assign Profile to Analysis Task from Action Type.
- Select a profile from the Analysis profiles.
- Click Add.
3.1.2. Creating a Snapshot Action
- Navigate to Control → Explorer.
-
Click the Actions accordion, then click
(Configuration),
(Add a new Action).
Type in a Description for the action.
- Select Create a Snapshot from Action Type.
Type in a Snapshot Name.
- Click Add when you are finished.
3.1.3. Deleting Snapshots by Age
- Navigate to Control → Explorer.
-
Click the Actions accordion, then click
(Configuration),
(Add a new Action).
Type in a Description for the action.
- Select Delete Snapshots by Age from Action Type.
Select the age of snapshots to delete.
- Click Add.
3.1.4. Evaluating an Alert
- Navigate to Control → Explorer.
-
Click the Actions accordion, then click
(Configuration),
(Add a new Action).
Type in a Description for the action.
- Select Evaluate Alerts from Action Type.
Select the alerts to be evaluated and click
(Move selected Alerts into this Action). Use the
Ctrl
key to select multiple alerts.- Click Add.
3.1.5. Creating an Inherit Tag Action
- Navigate to Control → Explorer.
-
Click the Actions accordion, and click
(Configuration),
(Add a new Action).
Type in a Description for the action.
- Select Inherit Parent Tag from Action Type.
- Select the type of parent item to inherit from in Parent Type.
Check all categories that you want inherited.
- Click Add.
3.1.6. Creating a CPU Reconfigure Action
- Navigate to Control → Explorer.
-
Click the Actions accordion, then click
(Configuration),
(Add a new Action).
Type in a Description for the action.
- Select Reconfigure CPUs from Action Type.
Select a number from Number of CPUs.
- Click Add.
3.1.7. Creating a Memory Reconfigure Action
- Navigate to Control → Explorer.
-
Click the Actions accordion, then click
(Configuration),
(Add a new Action).
Type in a Description for the action.
- Select Reconfigure Memory from Action Type.
Type in a new value for Memory Size.
- Click Add.
3.1.8. Creating a Remove Tag Action
- Navigate to Control → Explorer.
-
Click the Actions accordion, then click
(Configuration),
(Add a new Action).
Type in a Description for the action.
- Select Remove Tags from Action Type.
Check the category of tags you want to remove.
- Click Add.
3.1.9. Creating an E-mail Action
To send emails from the Red Hat CloudForms server, you must have the notifier server role enabled and have defined settings for SMTP email. For further information regarding SMTP, see General Configuration.
- Navigate to Control → Explorer.
-
Click the Actions accordion, then click
(Configuration),
(Add a new Action).
Type in a Description for the action.
- Select Send an E-mail from Action Type.
Type in a From E-mail Address and To E-mail Address.
- Click Add.
3.1.10. Creating an SNMP Action
To send SNMP traps from the Red Hat CloudForms server, you must have the Notifier
server role and the SNMP daemons enabled. For information on enabling SNMP, see General Configuration.
- Navigate to Control → Explorer.
-
Click the Actions accordion, then click
(Configuration),
(Add a new Action).
- Enter a Description for the action.
- Select Send an SNMP Trap from Action Type.
Type in the IP for the host to send the trap to, select the version of SNMP that you are using, and type in the Trap Object ID. Type in multiple hosts if you require the trap sent to multiple SNMP hosts.
- If using SNMP V1, you are prompted for a Trap Number. Type 1, 2, or 3, based on the appropriate Suffix Number from table below.
If using SNMP V2, you are prompted for a Trap Object ID. Type info, warning, or critical, based on the table below.
Table 3.3. Trap Object ID and Suffix Number
Object ID Suffix Number Added to PEN PEN with the Suffix Added info
1
1.3.6.1.4.1.33482.1
warn, warning
2
1.3.6.1.4.1.33482.2
crit, critical, error
3
1.3.6.1.4.1.33482.3
- Type in the variables that you require in your message.
- Click Add.
When adding an SNMP action, be sure to set it as asynchronous.
3.1.11. Creating a Set Custom Attribute Action
The custom attribute must already exist in vCenter. See vCenter documentation for instructions. In this example, an attribute called Red Hat CloudForms policy already exists.
- Navigate to Control → Explorer.
-
Click the Actions accordion, then click
(Configuration),
(Add a new Action).
Type in a Description for the action.
- Select Set a Custom Attribute in vCenter from Action Type.
Type in the Attribute Name and Value to Set.
- Click Add.
3.1.12. Creating a Tag Action
- Navigate to Control → Explorer.
-
Click the Actions accordion, then click
(Configuration),
(Add a new Action).
Type in a Description for the action.
- Select Tag from Action Type.
Click on the appropriate tag to apply from the list provided.
- Click Add.
3.2. Editing an Action
Edit an action to modify its properties. You cannot edit any of the default actions supplied with Red Hat CloudForms. Only actions that you create can be changed.
Note that when you view an action, you can see what policies it has been assigned to.
- Navigate to Control → Explorer.
- Click the Actions accordion, then click on the action you need to edit.
-
Click
(Configuration),
(Edit this Action) on the detail view of the action.
- Make any required changes.
- Click Save.
The action is modified and can be added to a policy. If the action is already party of a policy, the policy is automatically updated.
3.3. Deleting an Action
Delete unused actions to keep your environment uncluttered. You cannot delete default actions or actions that are currently assigned to a policy. The delete button is unavailable if the action is in use.
- Navigate to Control → Explorer.
- Click the Actions accordion, click on the action you need to remove.
-
Click
(Configuration),
(Delete this Action) on the detail view of the tree.
- Click OK to confirm.