Cloud Agnostic Blueprint

vRealize Automation

vRealie Automations (vRA) has en incredible feature that enables you to deploy the same service/blueprint can be used on different cloud plattforms. You don’t have to create a service per platform.

The first thing we have to do, to be able to create VM:s on other platforms that vSphere, is to add a new cloud account. In my example I’ll provision VM:s to Amazon Web Service (AWS) .Navigate to Cloud Assembly, Infrastructure, Cloud Accounts and select “Add Cloud Account”. Select Amazon Web Services when to account selector chows up.

Set a name enter the user credential. When you’ve entered “Access Key ID” och “Secret access key” click “Verify”. If the account details are correct you’ll get a list of available regions in AWS.

Select the one/one’s you’ll use and make sure that you automatically will l create a “Cloud Zone” of that region. Click “Add”

After you’d created a Cloud Account, the Cloud Zones has to be added to the Project you’re using. Navigate to Projects and edit the project by clicking the hyperlink.

Go to “Provisioning” and add the “Cloud Zones” that was just created as the AWS account was added. Save the project.

The last thing we need to do before we start creating blueprints is to tag the new infrastructure. Tagging gives us the ability to control witch infrastructure is being consumed. Navigate to Resources, Compute, select the regions that just was added. In my example it’s us-west-1b” och “us-west-1c”. Select “Tags” and set the tags you find meaningful. I use “compute: xxx” and location: yyy”to be able to control the deployment of VM:s based on platform and/or location.

Cloud platforms uses a different way of describing size than vSphere. AWS, GCP and Azure all uses pre-defined sizes where vin vSphere you can create what size you want. You can even create a VM with 1032 Mb memory and three CPU’s. To bridge the inconsistency we’ll use “Flavour Mappings”. Navigate to “Flavour Mappings”

Give it a name and select what cloud zone to use, to define a “Small” flavour should be in the various platforms.

In my example I’ll create a “Small” defined by 1 CPU and 2 Gb memory on the vSphere cloud zone, and that corresponds to a t2.small in AWS. I’m creating a “Medium” as well making it 2 CPU’s and 4 Gb of memory in vSphere and a t2.medium in AWS. There is no requirement that the size has to be the same in vSphere and AWS. A “Small” flavour doesn’t even has to be a small VM, it’s just up to the administrator to create what makes sense.

We’ll use the same concept when it comes to virtual machine templates. As the underlying architecture is different in the cloud plattforms we can’t use the same template. We have to create an abstraction layer here as well. Navigate to “Image mappings” and select “New Image Mapping”.

Give it a name , what “Cloud Zone” and what template should be used. In my example I’ll name it CentOS and select a vSphere CentOS template that is going to represent the “CentOS” image.

Click the little plus sigh in the end of the row to add a new. Select AWS as platform and choose what AMI is going to be used in “us-west-1” when “CentOS” is needed. Save the “Image Mapping” because now we are about to create a cloud agnostic blueprint.

Navigate to Design, Blueprints and select “New”. Enter a name and select what project that can use the blueprint.

Drag and drop a “Machine” from the toolbox on the left on the canvas.

The YAML code automatically created on the right indicates that two properties are not correct configured: “image: ” and “flavour: “

Because we recently created both a “Image Mapping” and two “Flavour Mappings” they will show up in the code editor. II’ll go for image “CentOS” and flavour “Small”

We could just click “Deploy” and create a VM, but we wouldn’t really where it’s being created. The only we know is that a CentOS size small will be created. To be able to control where, we must use “constraints: “. Add the “constraints:” property and let the code editor show what tags being available. I select “location: us” If I select “Deploy”, vRA will create a VM on compute infrastructure that has the tag “location: us” is it can translate the flavour “Small” and the image “CentOS”. If all those are fulfilled, the VM is created

You go ahead and deploy, see where your VM will end up. ☺️

The post “Create inputs to blueprints” will go through how a user, at request time, can select where the VM will end up.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: