Integrating with IBM Turbonomic

You can use a generic webhook integration to integrate IBM Cloud Pak for AIOps with IBM Turbonomic.

For details see Creating Generic Webhook integrations.

Configuring IBM Turbonomic to forward events to the webhook integration for Turbonomic

IBM Turbonomic must be configured with a new webhook configuration to send alerts to the webhook integration for Turbonomic.

Creating a workflow

  1. Set the following variables:

    TURBONOMIC_HOSTNAME=<api endpoint hostname>
    TURBONOMIC_ADMIN_USER=<turbonomic username>
    TURBONOMIC_ADMIN_PASSWORD=<turbonomic password>
    AIOPS_WEBHOOK_URL=<webhook integration URL>
    BASIC_AUTH_USERNAME=<webhook basic authentication username>
    BASIC_AUTH_PASSWORD=<webhook basic authentication password>
    

    Note: Update the values set for AIOPS_WEBHOOK_URL, BASIC_AUTH_USERNAME and BASIC_AUTH_PASSWORD. You can obtain these values from the AIOps Webhook integration configuration.

  2. Get the JSESSIONID token

    JSESSIONID=$(curl \
    --silent \
    --cookie-jar - \
    --insecure \
    https://${TURBONOMIC_HOSTNAME}/api/v3/login?hateoas=true \
    --data "username=${TURBONOMIC_ADMIN_USER}&password=${TURBONOMIC_ADMIN_PASSWORD}" \
    | awk '/JSESSIONID/{print $7}')
    
  3. Create a workflow

    curl \
    "https://${TURBONOMIC_HOSTNAME}/api/v3/workflows" \
    --insecure \
    --compressed \
    --header 'Accept: application/json' \
    --header 'Content-Type: application/json' \
    --header "cookie: JSESSIONID=${JSESSIONID}" \
    --request POST \
    -vv \
    --data @- <<EOF
    {
    "displayName": "Event Webhook integration",
    "className": "Workflow,
    "description": "Event webhook integration",
    "discoveredBy": {
        "readonly": false
    },
    "type": "WEBHOOK",
    "typeSpecificDetails": {
      "url": "${AIOPS_WEBHOOK_URL}",
      "method": "POST",
      "authenticationMethod": "BASIC",
      "username": "${BASIC_AUTH_USERNAME}",
      "password": "${BASIC_AUTH_PASSWORD}",
      "template": "\$converter.toJson(\$action)",
      "trustSelfSignedCertificates": true,
      "headers": [
         {
          "name": "Content-type",
          "value": "application/json"
         }
       ],
      "type": "WebhookApiDTO"
      }
    }
    EOF
    
  4. Get the workflow UID for later use.

    WORKFLOW_UUID=$(curl \
    "https://${TURBONOMIC_HOSTNAME}/api/v3/workflows" \
    --insecure \
    --compressed \
    --header 'Accept: application/json' \
    --header 'Content-Type: application/json' \
    --header "cookie: JSESSIONID=${JSESSIONID}" \
    --request GET | jq -c ".[] | select(.typeSpecificDetails .
    url | contains(\"${AIOPS_WEBHOOK_URL}\")) | .uuid" | tr -d '"')
    

Create a policy

  1. Log in to the Turbonomic console.

  2. Navigate to the Settings page and then choose Policies.

  3. Click New Automation Policy and then select the policy type, Virtual Machine in this case. This sets the type of entity that your policy will affect. Refer to Working with policies for more information.

    Name the policy

    • Add Scope The scope determines which entities this policy will affect. Choose one or more groups, or create new groups and add them to the policy scope. These groups match the type of entity you have set for the policy.

    • Policy Schedule The Select Schedule fly-out lists all the schedules that are currently defined for your instance of Turbonomic. Expand a schedule entry to see further details, or skip it if you don't need the schedule.

    • Automation and Orchestration You can define automation and orchestration settings for different action types within the same policy.

      • Action Type See a list of actions that are viable for the policy, and then make your selections.

      • Action Generation and Acceptance

        • Do not generate actions as Turbonomic doesn't considers your selected actions in its calculations. For example, if you do not want to generate resize actions for VMs in the policy, analysis will still drive toward the desired state, but will do so without considering resizes.

        • Generate Actions Turbonomic generates your selected actions to address or prevent problems. Choose from the following Action Acceptance modes to indicate how you would like the actions to run:

          • Recommend Recommend the action so a user can run it via the given hypervisor or by other means

          • Manual Recommend the action, and provide the option to run that action through the Turbonomic user interface

          • Automatic Run the action automatically For automated resize or move actions on the same entity, Turbonomic waits five minutes between each action to avoid failures associated with trying to run all actions at once. Any action awaiting execution stays in queue.

      • Before Execution and Action Execution: By default, generated actions run without the need for orchestration. Turbonomic gives you the ability to set up orchestration to affect the execution of actions.

      • After Execution: The default is to 'do nothing'. Other options include:

        • Create Record in Orchestration Turbonomic registers the action in the Orchestration log, showing that the given action has been run. For example: A final ActionID could be created and with the final ActionState, the Type and Severity would be updated accordingly in IBM Cloud Pak for AIOps. Those actions would also be updated to IBM Cloud Pak for AIOps, and it would handle with the alerts with updated state: closed or cleared or keep open.

        • Use Action Script Run an action script that is set up for the POST entrypoint. The action script name must match the entity type and action type.

  4. Save the policy.

  5. Action events will be sent to the webhook integration when an action is run.