Assigning a Custom Analysis Profile to a Virtual Machine

Red Hat CloudForms 4.1

How to assign a custom CloudForms analysis profile to a virtual machine

Red Hat CloudForms Documentation Team

Abstract

This guide provides instructions for assigning a custom CloudForms analyis profile to a virtual machine.
If you have a suggestion for improving this guide or have found an error, please submit a Bugzilla report at http://bugzilla.redhat.com against Red Hat CloudForms Management Engine for the Documentation component. Please provide specific details, such as the section number, guide name, and CloudForms version so we can easily locate the content.

You can create and assign different analysis profiles for specific virtual machine configurations using the Red Hat CloudForms user interface. This document describes the steps required to create a custom virtual machine analysis profile, and assigning it to a virtual machine for use with SmartState analysis, via a control policy.

  1. Creating a Virtual Machine Analysis Profile
  2. Creating an Action to Assign the Virtual Machine Analysis Profile to Analysis Task
  3. Creating a Virtual Machine Control Policy
  4. Creating a Policy Profile and Assigning the Virtual Machine Control Policy
  5. Assigning the Policy Profile to a Virtual Machine

1. Creating a Virtual Machine Analysis Profile

  1. Log into the appliance as the admin user.
  2. Navigate to SettingsConfiguration.
  3. Expand the Settings accordion, then click Analysis Profiles.
  4. Click image (Configuration), then image (Add VM Analysis Profile).
  5. In Basic Information, enter Name and Description for the analysis profile.
  6. In the Category tab, select the categories you want to collect information for under Category Selection. The Category tab is available for virtual machine profiles only.
  7. In the File tab, click <New Entry> and specify the file to be scanned and collect contents for. Repeat the step for adding multiple file name entries.
  8. In the Registry tab, enter the Registry Key and Registry Value. To determine whether a registry key exists without providing a value, enter * in Registry Value. The Registry tab is available for virtual machine profiles only.
  9. In the Event Log tab, specify the event log entries to collect. Enter a Filter Message to look for specific text in a message. Enter a Level (info, warn or error for example) to specify the event level. Enter the Source for the event log entry and # (Number) of Days to specify how far back to check.
  10. Click Add.

2. Creating an Action to Assign the Virtual Machine Analysis Profile to the Analysis Task

Actions are performed after the condition is evaluated. You can associate actions with specific events when you create a policy. Red Hat CloudForms provides a set of default actions, but you can also create custom actions using the CloudForms user interface.

Use this procedure to create a custom action by adding the Assign Profile to Analysis Task action type to the virtual machine analysis profile (created in Section 1, “Creating a Virtual Machine Analysis Profile”).

image

  1. Navigate to ControlExplorer.
  2. Expand the Actions accordion and click image (Configuration), then image (Add a new Action).
  3. Enter a Description for the new action. This will be the name given to your new action.
  4. Select Assign Profile to Analysis Task from the Action Type list.
  5. Select the newly-created virtual machine analysis profile from the Analysis Profiles list.
  6. Click Add.
Note

You can only associate this action with an analysis start event.

The action is created and added to the Available Actions list. Associate this action with the VM Analysis Start event when you create a virtual machine control policy in the next procedure.

3. Creating a Virtual Machine Control Policy

You can create a control policy by combining an event, a condition, and an action. The procedure below describes how to create a virtual machine control policy to assign the newly-created action to the VM Analysis Start event. Optionally, you can use a scope expression that is tested immediately when the policy is triggered by an event. If the item is out of scope, then the policy will not continue on to the conditions, and the assigned action will not run.

  1. Navigate to ControlExplorer.
  2. Expand the Policies accordion, and click Control Policies.
  3. Select Vm Control Policies.
  4. Click image (Configuration), then image (Add a New Vm Control Policy).
  5. Enter Description. This will be the name given to your VM control policy.
  6. Uncheck Active if you do not want this policy processed even when assigned to a resource.
  7. Optionally, enter Scope (you can also create a scope as part of a condition, or not use one at all). If the virtual machine is not included in the scope, the assigned action will not run.
  8. Enter Notes if required.
  9. Click Add. The policy is added and listed under Vm Control Policies in the Policies accordion.
  10. Select the newly-added VM control policy. You can now associate events, conditions, and actions with the policy.
  11. Click image (Configuration), then image (Edit this Policy’s Event assignments).
  12. Under VM Operation, select VM Analysis Start.
  13. Click Save.
  14. Click the VM Analysis Start event to configure actions.
  15. Click image (Configuration), then image (Edit Actions for this Policy Event).
  16. In Order of Actions if ALL Conditions are True, select the action created in Section 2, “Creating an Action to Assign the Virtual Machine Analysis Profile to the Analysis Task” from the Available Actions list. This action will take place if the resources meet the conditions of the policy.

    image

    Note

    Each selected action can be executed synchronously or asynchronously; a synchronous action will not start until the previous synchronous action is completed, while an asynchronous action allows the next action to start whether or not the first action has completed. Also, at least one Red Hat CloudForms server in the Red Hat CloudForms zone must have the notifier server role enabled for the trap to be sent.

  17. Click ( image ) which will move the action to Selected Actions. The selected action is set to (S) Synchronous by default. From Selected Actions, select the action, then:

    • Click A (Set selected Actions to Asynchronous) to make it asynchronous.
    • Click S (Set selected Actions to Synchronous) to make it synchronous. If creating a synchronous action, use the up and down arrows to identify in what order you want the actions to run.
  18. Click Save.

4. Creating a Policy Profile and Assigning the Virtual Machine Control Policy

Add a new policy profile and assign the virtual machine control policy (created in Section 3, “Creating a Virtual Machine Control Policy”) to it.

  1. Navigate to ControlExplorer.
  2. Expand the Policy Profiles accordion, click image (Configuration), then image (Add a New Policy Profile).
  3. In the Basic Information area, enter a Description for the policy profile.
  4. Under Policy Selection, select the virtual machine control policy created in Section 3, “Creating a Virtual Machine Control Policy” from the Available Policies list.
  5. Click ( image ) to move the selected virtual machine control policy into this profile.
  6. Click Add.

5. Assigning the Policy Profile to a Virtual Machine

Assign the policy profile to a virtual machine and initiate SmartState analysis. Note that policy profiles can be specified at multiple levels. That is, if you assign this to a provider (Amazon EC2 or OpenStack for example), the policy profile will apply to all hosts or virtual machines for that provider.

  1. Navigate to ComputeCloudsInstances or ComputeInfrastructureVirtual Machines, and select an available virtual machine.
  2. Click image (Policy), then image (Manage Policies).
  3. Under Select Policy Profiles, select the policy profile. It will turn blue to show the selection. Click the triangle next to the policy profile to see its member policies.
  4. Click Save.
  5. Select the virtual machine from the available virtual machines list; click image (Configuration), then image (Perform SmartState Analysis). A pop-up window appears to confirm the action.
  6. Click OK. SmartState analysis is initiated for the selected virtual machine or instance from the Red Hat CloudForms database.

SmartState analysis will now report back findings specified by the custom virtual machine analysis profile.