IBM Cloud Docs
Understanding Schematics use cases

Understanding Schematics use cases

Choose among the following use cases to learn how Schematics automates your infrastructure, service, and application stacks in IBM Cloud.

Infrastructure deployment with Schematics workspaces

Schematics workspaces deliver Terraform-as-a-Service capabilities to you so that you can automate the provisioning and management of your IBM Cloud resources, and rapidly build, duplicate, and scale complex, multitiered cloud environments.

To get started with infrastructure deployment in Schematics, see Getting started tutorial.

Terraform is an open source project that lets you specify your cloud infrastructure resources and services by using a high-level scripting language. Your specification is stored in a Terraform configuration file. The complexity of using APIs, provisioning, and managing your cloud resources is removed from the user. The cloud providers create a plug-in for Terraform that contains the information for how to connect to the cloud provider. And what APIs to invoke with a certain cloud resource? IBM's plug-in is called the IBM Cloud Provider Plug-in for Terraform.

To use the capabilities of the IBM Cloud Provider Plug-in for Terraform, you create a workspace that points to the Terraform configuration files that you want to provision. The plug-in analyzes the resources that you specified and determines the order in which these resources including any dependencies that must be provisioned. Review the following image for the detailed information about how to run Terraform configuration files with Schematics workspaces.

Provisioning IBM Cloud resources with IBM Cloud Schematics and Terraform
Figure 1. Provisioning IBM Cloud resources with IBM Cloud Schematics and Terraform

  1. Codify your IBM Cloud resources. Use Terraform HashiCorp Configuration Language (HCL) or JSON format to specify the IBM Cloud resources that you want to provision in your IBM Cloud environment. If you are not familiar with Terraform, you can select one of the default Terraform templates that Schematics provides to provision the IBM Cloud resources that you want. Terraform templates can be stored in a GitHub, GitLab, or Bitbucket repository to ensure source control and enable collaboration, review, and auditing in your organization. You can save usage information in readme files to make the template shareable and usable across multiple teams. You can also upload tape archive files (.tar) from your local machine to provide the template to Schematics.
  2. Create your workspace. You can point your Schematics workspaces to a GitHub, GitLab, or Bitbucket repository where you store your Terraform template, or provide your template by uploading a .tar file. workspaces help to organize resources that belong to one IBM Cloud environment. For example, use workspaces to separate your test, staging, and production environment. With IBM Cloud® Identity and Access Management, you can control who has access to your workspaces? and who can run actions on your IBM Cloud resources?
  3. Create an execution plan. Based on your configuration, Terraform creates an execution plan and describes the actions that need to be run to get to the state that is described in your Terraform configuration files. To determine the actions, Schematics analyzes the resources that are already provisioned in your IBM Cloud account to give you a preview of whether resources must be added, modified, or removed. You can review the execution plan, change it, or simply execute the plan.
  4. Provision your resources. When you are ready to make changes to your cloud environment, you can apply your Terraform configuration files. To run the actions that are specified in your configuration files, Schematics uses the IBM Cloud Provider Plug-in for Terraform.

Configuration management with Schematics actions

Schematics actions deliver Ansible-as-a-Service capabilities to you so that you can automate the configuration and management of your IBM Cloud environment, and deploy complex multitiered apps to your cloud infrastructure.

To get started with configuration management in Schematics, see Getting started tutorial.

Ansible is a configuration management and provisioning tool, similar to Chef and Puppet, and is designed to automate the configuration, operation, and management of cloud environments, and to deploy multitiered app workloads in the cloud. Ansible uses YAML syntax to describe the tasks that must be run against a single host or a group of hosts, and stores these tasks in an Ansible playbook.

Ansible does not use agents or a custom security infrastructure that must be present on a target machine to work properly. Instead, Ansible securely connects to compute hosts over the public network by using SSH keys. To bring a resource to the required state, Ansible pushes modules to the managed host that run the tasks in your Ansible playbook. After the tasks are executed, the result is returned to the Ansible server and the module is removed from the managed host. Ansible modules are idempotent such that executing the same playbook or operation multiple times returns the same result as resources are changed only if required. For more information about Ansible, check out this video.

To use Ansible capabilities in Schematics, you create a Schematics actions that points to the Ansible playbook that you want to run. Review the following image for the detailed information about how to run Ansible playbooks with Schematics actions.

Configuring IBM Cloud resources with IBM Cloud Schematics and Ansible
Figure 2. Configuring IBM Cloud resources with IBM Cloud Schematics and Ansible

  1. Add tasks to your playbook: Use Ansible YAML syntax to describe the configuration tasks that you want to run on your cloud infrastructure, such as installing software or starting, stopping, and rebooting a virtual server. You add these tasks to an Ansible playbook and store the playbook in a GitHub, GitLab, or Bitbucket repository to ensure source control and enable collaboration, review, and auditing in your organization. If you are not familiar with Ansible, you can use one of the IBM provided playbooks, or browse the Ansible Galaxy library.
  2. Create a Schematics action: When you create a Schematics action, you point your action to the repository that stores your Ansible playbook. Then, you select the cloud resources where you want to run the tasks that are defined in your Ansible playbook. To protect your cloud resources, you can further set up a bastion host in front of your target hosts that proxies all Ansible SSH connections to the target hosts.
  3. Run your action: When you are ready to configure your cloud resources, you can run your action. Schematics uses the built-in Ansible capabilities to connect to your target hosts through SSH, and execute the tasks that are defined in your Ansible playbook. You can monitor the progress by reviewing the logs.

Software deployments with IBM-provided templates

Browse the IBM software solutions catalog and choose among a wide range of software and infrastructure templates that you can use to set up cloud resources, and to install IBM and Third party software in your IBM Cloud Kubernetes Service cluster, Red Hat OpenShift on IBM Cloud cluster, or a classic or Virtual Servers for VPC.

Software templates are installed by using the built-in Terraform, Ansible, Helm, Red Hat OpenShift on IBM Cloud Operator, and Cloud Pak capabilities in Schematics. When you choose to install one of the provided templates, you create a Schematics workspace and choose the target service or host where you want run the installation. You can review which of the integrated technologies in Schematics is used to install your template.

You can also create your own software and infrastructure templates and import them in to your own private catalog in IBM Cloud. For more information, see Adding products to a private catalog

To get started with software deployment in Schematics, see the Getting started tutorial.

Software deployments with Schematics
Figure 3. Software deployments with Schematics

  1. Choose a template: The IBM software solutions catalog offers a wide variety of infrastructure and software templates that you can choose from. These templates help to quickly install software, such as IBM Cloud Paks, IBM® WebSphere Application Server for IBM Cloud®, or Kibana and Grafana into the target service of your choice.
  2. Configure your workspace and target: When you choose one of the provided templates, you must select the target where you want to install the template. Depending on the template that you choose, the target can be an IBM Cloud Kubernetes Service cluster, a Red Hat OpenShift on IBM Cloud cluster, or a classic or Virtual Servers for VPC. Because Schematics is used to install the software, you must configure the workspace that is automatically created for you.
  3. Run the template: When you run the template, Schematics uses the built-in Terraform, Ansible, Helm, OpenShift Operator, or Cloud Pak capabilities to install your software or spin up infrastructure resources. You can use your workspace to monitor the progress of your template execution.