Cloud Management Platform Aria Automation Cloud Automation DevOps IT Applications Vmware

Use Cloud Assembly Blueprint to deploy Ansible Control Machine

In this blog post I will be demonstrating how to create a Cloud Agnostic Blueprint in VMware Cloud Assembly to deploy an Ansible Control Machine to any cloud. The target cloud can be specified as an input during deployment

VMware Cloud Assembly Service Overview

VMware Cloud Assembly orchestrates and expedites infrastructure and application delivery in line with DevOps principles. It uniquely provides broad and deep support for VMware-based private and hybrid clouds including VMware Cloud Foundation, VMware Cloud on AWS and vSphere as well as native AWS and Azure and GCP public cloud environments

What is Ansible Control Machine

Any Linux based machine with Ansible installed. Windows isn’t supported for the control node. There are certain requirements for control node which are listed here

VMware Cloud Assembly Terminology

If you need a refresher, the following table lists the short description of various terminologies for Cloud Assembly.

For more information, you can refer the documentation here

Cloud Accounts  Cloud Accounts allow you to bring your public cloud and on-prem data centers under management
Cloud Zones  Cloud Zones are the aggregation of the compute resources where the workloads will be provisioned You can link it with a Project to define which users have access to provision to the same.
Projects  Projects link users and Cloud Zones. A Project allows user/groups to deploy their blueprint to linked Cloud Zones
Flavor Mappings  Instance Sizes. You could create similar to t-shirt sizes like small, medium or large which you can then specify in a blueprint
Image Mappings  Images which are used for the deployment. It could be a template, OVF, content library item, AMI, ARM , etc. Similar to Flavor Mappings you will create friendly names that are then consumed in a blueprint
Network Profile  A collection of network resources in the Cloud Zone. It provides the ability to configure policies based on which network resource would be chosen
Storage Profile  A collection of storage/datastores. It provides the ability to configure policies based on which storage resource would be chosen
Blueprints  Blueprints are the specifications for the resources that you deploy. You can continuously improve a blueprint after you deploy it.
Cloud Proxy  An on-prem virtual appliance provides connector agents for interacting with on-premises services
Tags  Tags drive the placement of deployments through the matching of capabilities and constraints

 

Requirements

You need to have the following configuration in your CAS environment

  1. Amazon Web Service (AWS) cloud account for account regions where you will deploy Cloud Assembly blueprints. Click Here for detailed instructions
  2. vCenter cloud account for the account regions that you want to deploy Cloud Assembly blueprints. Click Here for detailed instructions
  3. VMware Cloud on AWS cloud account for the account regions that you want to deploy Cloud Assembly blueprints. Click Here for detailed instructions
  4. Capability Tags for the Cloud Zones as follows (These are examples, and you can substitute your own if you like – just be sure you specify the same ones everywhere)
    • AWS Cloud Zone – AWS
    • vCenter Cloud Zone – OnPrem-vSphere
    • VMware Cloud on AWS- VMWonAWS

  1. Flavor Mappings for all 3 Cloud Accounts (I have used acm_small with the following config, however, you can rename it to something else as well with your desired configuration. Make sure you modify the same in Blueprint)
    • AWS – t2. Micro
    • OnPrem-vSphere – 2 CPU and 4 GB RAM
    • VMWonAWS – 2 CPU and 4GB RAM

  1. Image Mapping for all 3 Cloud Accounts
    • AWS – Ubuntu AMI for your region. I have it for us-east-1
    • OnPrem-vSphere – Ubuntu Cloud OVA
    • VMWonAWS – Ubuntu Cloud OVA

  1. Storage Profile for all 3 Cloud Accounts
  2. Network Profile for all 3 Cloud Accounts

Cloud Agnostic Blueprint

 

Blueprints are the specifications for the resources that you deploy. We will be using Cloud Agnostic components of the blueprint so that same blueprint can be used to deploy to any cloud.I have shared the blueprint on my GitHub repo here

Let’s walk through blueprint which will give you an idea about the blueprint

There are 3 inputs configured in the inputs which will prompt the user at request time

  • Username – I have default user as root
  • Password – I have a default password. User can input their own password
  • TargetCloudType – I have 3 Clouds Configured (AWS, OnPrem-vSphere & VMWonAWS). We will be using capability tags which will allow CAS to pick the correct cloud at request time

Next, you will be stating the details which were configured as part of the requirements above.

  • Image Mapping – acm_ubuntu
  • Flavor – acm_small
  • Constraints – Capability Tags. Here, we are tying the inputs which user the selects to the actual config specified on the infrastructure

Here we will be using Ubuntu Operating System and deploy a Virtual Machine with the 2 vCPU and 4 GB RAM if it’s a vSphere-based machine or t2.micro if it’s deployed on AWS

Customize the image with Cloud-Init – As you might already be aware, we are using cloud-init to install packages and do the Ansible specific configuration using cloudConfig. You can also refer to Ansible documentation for detailed here for detailed setup instructions. In our blueprint, we are doing the following

  • Enabling Password Authentication
  • Allowing Root Login
  • Restarting sshd service
  • Installing Ansible
  • Modifying Ansible specific configuration so that it can be added as Integration with CAS

Here is what the final blueprint will look like.

 

Ansible Control Machine Deployment

 

You can now deploy from Blueprint and specify the input parameters. Here I have selected AWS as the TargetCloudType with default credentials.

Once the deployment is successful

You can ssh to the AWS EC2 instance and ensure Ansible is installed by running “ansible –version”

And yes, you can also add this Ansible Control Machine as an Integration in CAS. You can refer here for more details!

 

Conclusion

This hopefully showed you can leverage VMware Cloud Assembly to build a Cloud Agnostic blueprint to provision real world, useful applications across multiple clouds. You can refer here for more blueprint samples in CAS