Provisioning with Infrastructure Manager and the CA Service Catalog Plug‑in

When you have the CA Service Catalog Plug‑in implemented, you can coordinate the CA Service Catalog team and the Automic system team to enable fully-automated self-service offerings for CA Service Catalog end users. This topic describes a typical service orchestration scenario: an end user submits a request for a environment and it is automatically provisioned. In this example, the Infrastructure Manager functionality is used to provision the requested environment.

Use the scenario here as a basis to develop and provide the automated self-service fulfillment services that best serve the needs of your organization.

Overview

In this example, you see how the service fulfillment of a request for a new environment (infrastructure) can be automated after the plug-in integration has been implemented. The process works like this:

  1. An end user submits a service request in CA Service Catalog for a new environment.
  2. The request is automatically fulfilled in Automic Automation.
  3. The user is informed about the progress of the request.
  4. The request is updated according to the final result:
    • If all goes well, the environment profile details are added to the request and the request is closed.
    • If there is a problem, the request is updated with information about the problem and the support team is notified.

In this diagram, the darker shaded tasks are those that end the process. The process ends when the VM is successfully created, or when it cannot be created for whatever reason. In all cases, the request is updated with a status change or with a note, or both.

Process flow for service provisioning with CA Service Catalog and Infrastructure Manager, and orchestrated by an Automic Workflow

Prerequisite Components

To support this scenario, the following tools and components must be installed:

  • On the CA Service Catalog side:
    • CA Service Catalog Plug‑in

      This plug-in package contains the JAR file that enables sending service requests to Automic Automation. For complete information about how to install, configure, and use the plug-in, see the related PDF guide, which you get when you download the package from our marketplace at https://marketplace.automic.com/.

    For information, see Installation and Implementation in the CA Service Catalog Guide.

  • On the Automic Automation side:

    Download the Infrastructure Manager REST artifact ZIP file from https://downloads.automic.com/, and install it on your Automation Engine instance. For installation instructions, see Installing the Infrastructure Manager.

    Ensure the following action packs are installed. You should see them in the PACKAGES folder in the Explorer sidebar in the Process Assembly perspective.

    • PCK.AUTOMIC_CA_SERVICECATALOG (CA Service Catalog Action Pack)
      This action pack contains actions to enrich service request tickets in CA Service Catalog with comments about the progress of the service fulfillment and to update the request status.
    • PCK.AUTOMIC_RA_REST (REST Action Pack)
      This action pack contains templates for JOBS objects that you can add to Workflows to post and get REST calls and their inputs and payloads.

    Note: If they are not listed in the Explorer sidebar, then you need to download them from our marketplace at https://marketplace.automic.com/ and install them. For instructions about installing an action pack, see Installing Packs in Working with Packs and Plug-ins.

Tasks for the Automated Provisioning

To be able to offer automated service request fulfillment to users of the CA Service Catalog, tasks must be completed by the teams for each of the systems.

Tasks on the CA Service Catalog Side

The CA Service Catalog team is responsible for the following:

  • Communicating with the Automic Automation team to get the following specifications:
    • The values for the configuration for the AE connection.
    • The input parameters for the Automic Automation Workflow.
  • Configuring the connection to the AE. For more information, see Defining a Configuration for the AE Connection in the CA Service Connector Guide.
  • Creating the service request forms and assign them to the Service Offerings of the end users. For more information, see Creating a Request Form for an AE Workflow in the CA Service Connector Guide.

    The form must have fields that can map to the Workflow PromptSet variables. These will be posted as inputs with the REST call.

Tasks on Terraform

An infrastructure administrator with CA Service Catalog or Automic Automation must create the templates for the infrastructures that you want to offer. The administrator creates the templates on Terraform and stores them in the GIT repository.

Tasks on the Automic Automation Side

The Automic Automation team is responsible for the following:

  • Communicating with the CA Service Catalog team to get the CA Service Catalog connection specifications, including the endpoint, a login user and password to be able to update requests.
  • Preparing the Infrastructure Manager.
  • Designing the Automic Automation Workflow for the service request fulfillment.

Preparation Tasks for the Infrastructure Manager

After installing the Infrastructure Manager, you must do the following configuration tasks:

  1. Install its REST API. For information, see Installing the Infrastructure Manager REST API
  2. Configure the Infrastructure Manager REST API. For information, see Infrastructure Manager REST API Configuration.
  3. Define a system user for the Workflow. For information, see Administering the Infrastructure Manager.
  4. Connect a repository to Infrastructure Manager with POST /api/v2/repositories.

    This endpoint connects a repository with templates to Infrastructure Manager. Each template describes the configuration of an infrastructure to be created, including what will be created, where it will be created, and what middleware will be installed on it. For example you can have a template which created an instance in AWS and then installs Tomcat on this instance.

    {

    "name": "Github Repo",

    "url": "https://github.com/automicss/terraform.git",

    "type": "Git",

    "branch": "master",

    "credentials": {

    "username": "automicss",

    "password": ""

    },

    "requester": "AutomicAdmin"

    }

Workflow Tasks

In our example the workflow has the following steps:

  1. Start: The inputs from the CA Service Catalog request are already loaded with the execution start into variables in the PromptSet for the infrastructure parameters.
  2. Check whether the infrastructure provider already exists with GET /api/v2/infrastructure_providers.

    The response contains a list of infrastructure providers. If you know the name of the infrastructure provider that you are looking for, add that as a search criteria. For example,

    http://{host}:{port}/provisioning/api/v2/infrastructure_providers/name/My AWS

  3. If the infrastructure does not exist, create a new infrastructure provider with POST http://{host}:{port}/provisioning/api/v2/infrastructure_providers.

    This endpoint creates an object that holds the login credentials of your account with the provider. These are the credentials which will be used by the Infrastructure Manager (or rather by Terraform because it is what is running in the background to do the actual provisioning) to authenticate with the respective Cloud Provider (which in our example is AWS) and create the resources there.

    {

    "name": "My AWS",

    "type": "AWS",

    "credentials": {

    "access_key": "<your aws access key>",

    "secret_key": "<your aws secret key>"

    },

    "requester": "AutomicAdmin"

    }

  4. Create the requested infrastructure on the infrastructure provider with POST http://{host}:{port}/provisioning/api/v2/infrastructures.

    This endpoint triggers the infrastructure creation. You need to select a template which is located in the already connected repository (the first endpoint), and also select an Infrastructure Provider (the credentials object) which will be used. You will also need to specify an infrastructure name.

    {

    "backend_provider": "TERRAFORM",

    "name": "CAServices1",

    "infrastructure_providers" : "My AWS",

    " requester ": "AutomicAdmin",

    "template": {

    "repository_name":" Github Repo",

    "template_folder": "my_aws_template",

    },

    "override_variables": {

    }

    }

    Response example:

    {

    "infrastructure_id": 1081,

    "execution_id": 1083

    }

  5. Post a SOAP call to enrich the CA Service Catalogrequest with a comment that confirms that the execution has started.
  6. Check the status of the execution with GET http://{host}:{port}/provisioning/api/v2/infrastructures/{infrastructureId}/executions/{executionId}. These IDs are in the response of the previous REST call.

    For example:

    http://{host}:{port}/provisioning/api/v1/infrastructures/1081/executions/1083

    This endpoint will return the outcome of your infrastructure creation execution.

    Response example:

    {

    "id": 1083,

    "status": "Completed",

    "repository_name": "github",

    "reference": "master",

    "template_folder": "gc_basic",

    "commit": "bfdd0ab915e68a5b68e3e33e7aa3b9714b1da894",

    "execution_log": "https://stozh01l7480:9000/provisioning/api/v2/infrastructures/1081/executions/1083/log",

    "completed_on": "2019-07-08T15:41:25.238",

    "requester": "AutomicAdmin",

    "command": "apply",

    "created_by": "administrator",

    "created_on": "2019-07-08T15:40:41.416",

    "modified_by": "administrator",

    "modified_on": "2019-07-08T15:40:41.427"

    }

    Note: If you need to troubleshoot the execution, you can retrieve the execution details from Terraform, click the linked URL in the execution status response, which opens the execution log.

  7. Based on the status of the execution, post a SOAP call to enrich the CA Service Catalogrequest with the final status and the provisioning details.
    • For a successful execution: Add a comment with the provisioning details to the request and close it.
    • For a failed execution: Add a comment with details of the execution, change the status accordingly, and take a notification action (such as sending an e-mail to the support team).

Note: You can follow the progress of this Workflow execution in Process Monitoring.