Use Case: 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:

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:

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:

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/v1/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/v1/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,

    {server}/provisioning/api/v1/infrastructure_providers/name/My AWS

  3. If the infrastructure does not exist, create a new infrastructure provider with POST /api/v1/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/v1/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",

    "infrastructure_name": "CAServices1",

    "infrastructure_provider" : "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 /api/v1/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/v1/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 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.