Chapter 4. Actions

Actions are performed after the condition is evaluated. CloudForms Management Engine Control comes with a set of default actions that you can choose from. You can also create some of your own.

Table 4.1. Default Actions and Descriptions

ActionDescription

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 CloudForms Management Engine 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 CloudForms Management Engine 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 CloudForms Management Engine 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 CloudForms Management Engine 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.

4.1. Custom Actions

You can create a custom action using the CloudForms Management Engine 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 4.2. Custom Actions and Descriptions

Custom ActionDescription

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 CloudForms Management Engine 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.

4.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 the Configuration chapter in the General Configuration guide for information on how to create analysis profiles.

  1. Navigate to ControlExplorer.
  2. Click the Actions accordion, then click image (Configuration), image (Add a new Action).
  3. Type in a Description for the Action Type.

    image

  4. Select Assign Profile to Analysis Task from Action Type.
  5. Select a profile from the Analysis profiles.
  6. Click Add.

4.1.2. Creating a Snapshot Action

  1. Navigate to ControlExplorer.
  2. Click the Actions accordion, then click image (Configuration), image (Add a new Action).
  3. Type in a Description for the action.

    image

  4. Select Create a Snapshot from Action Type.
  5. Type in a Snapshot Name.

    image

  6. Click Add when you are finished.

4.1.3. Deleting Snapshots by Age

  1. Navigate to ControlExplorer.
  2. Click the Actions accordion, then click image (Configuration), image (Add a new Action).
  3. Type in a Description for the action.

    image

  4. Select Delete Snapshots by Age from Action Type.
  5. Select the age of snapshots to delete.

    image

  6. Click Add.

4.1.4. Evaluating an Alert

  1. Navigate to ControlExplorer.
  2. Click the Actions accordion, then click image (Configuration), image (Add a new Action).
  3. Type in a Description for the action.

    image

  4. Select Evaluate Alerts from Action Type.
  5. Select the alerts to be evaluated and click image (Move selected Alerts into this Action). Use the Ctrl key to select multiple alerts.

    image

  6. Click Add.

4.1.5. Creating an Inherit Tag Action

  1. Navigate to ControlExplorer.
  2. Click the Actions accordion, and click image (Configuration), image (Add a new Action).
  3. Type in a Description for the action.

    image

  4. Select Inherit Parent Tag from Action Type.
  5. Select the type of parent item to inherit from in Parent Type.
  6. Check all categories that you want inherited.

    image

  7. Click Add.

4.1.6. Creating a CPU Reconfigure Action

  1. Navigate to ControlExplorer.
  2. Click the Actions accordion, then click image (Configuration), image (Add a new Action).
  3. Type in a Description for the action.

    image

  4. Select Reconfigure CPUs from Action Type.
  5. Select a number from Number of CPUs.

    image

  6. Click Add.

4.1.7. Creating a Memory Reconfigure Action

  1. Navigate to ControlExplorer.
  2. Click the Actions accordion, then click image (Configuration), image (Add a new Action).
  3. Type in a Description for the action.

    image

  4. Select Reconfigure Memory from Action Type.
  5. Type in a new value for Memory Size.

    image

  6. Click Add.

4.1.8. Creating a Remove Tag Action

  1. Navigate to ControlExplorer.
  2. Click the Actions accordion, then click image (Configuration), image (Add a new Action).
  3. Type in a Description for the action.

    image

  4. Select Remove Tags from Action Type.
  5. Check the category of tags you want to remove.

    image

  6. Click Add.

4.1.9. Creating an E-mail Action

To send emails from the CloudForms Management Engine server, you must have the notifier server role enabled and have defined settings for SMTP email. For further information regarding SMTP, see the General Configuration guide.

  1. Navigate to ControlExplorer.
  2. Click the Actions accordion, then click image (Configuration), image (Add a new Action).
  3. Type in a Description for the action.

    image

  4. Select Send an E-mail from Action Type.
  5. Type in a From E-mail Address and To E-mail Address.

    image

  6. Click Add.

4.1.10. Creating an SNMP Action

To send SNMP traps from the CloudForms Management Engine server, you must have the Notifier server role and the SNMP daemons enabled. For information on enabling SNMP, see the General Configuration guide.

  1. Navigate to ControlExplorer.
  2. Click the Actions accordion, then click image (Configuration), image (Add a new Action).
  3. Enter a Description for the action.
  4. Select Send an SNMP Trap from Action Type.
  5. 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 4.3. Trap Object ID and Suffix Number

      Object IDSuffix Number Added to PENPEN 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

  6. Type in the variables that you require in your message.
  7. Click Add.
Note

When adding an SNMP action, be sure to set it as asynchronous.

4.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 CloudForms Management Engine policy already exists.

  1. Navigate to ControlExplorer.
  2. Click the Actions accordion, then click image (Configuration), image (Add a new Action).
  3. Type in a Description for the action.

    image

  4. Select Set a Custom Attribute in vCenter from Action Type.
  5. Type in the Attribute Name and Value to Set.

    image

  6. Click Add.

4.1.12. Creating a Tag Action

  1. Navigate to ControlExplorer.
  2. Click the Actions accordion, then click image (Configuration), image (Add a new Action).
  3. Type in a Description for the action.

    image

  4. Select Tag from Action Type.
  5. Click on the appropriate tag to apply from the list provided.

    image

  6. Click Add.

4.2. Editing an Action

Edit an action to modify its properties. You cannot edit any of the default actions supplied with CloudForms Management Engine. 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.

  1. Navigate to ControlExplorer.
  2. Click the Actions accordion, then click on the action you need to edit.
  3. Click image (Configuration), image (Edit this Action) on the detail view of the action.
  4. Make any required changes.
  5. 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.

4.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.

  1. Navigate to ControlExplorer.
  2. Click the Actions accordion, click on the action you need to remove.
  3. Click image (Configuration), image (Delete this Action) on the detail view of the tree.
  4. Click OK to confirm.