Deploying UrbanCode Deploy Blueprint Designer Cloud Applications Part 4 – Designing Your First Blueprint
This blog series, up to this point, has talked about connecting BDP to an Amazon cloud, discussed agents and agent relays, and provided options for setting up a lab environment. We are finally at the point where we are ready to build our first blueprint on an AWS EC2 cloud.
The Sample Component and Application
When BPD is installed there is a separate package that installs the cloud agents and a sample component and application. The cloud agents are versions of UCD agents for a number of platforms – Linux x86-64, Windows x86-64, AIX PPC 64, Linux PPC 64, and Linux s390. They are loaded as components but they are not deployed as such otherwise you would not be able to remove them. As we covered in Part 2 of this blog series, the agents are downloaded using a curl command. There is a second script included in that package that installs the ucd_blueprint_designer_test component and the ucd_blueprint_designer_test_app. The application already has the component included and has no process. The component is very simple, containing no artifacts and having no versions. All the component contains is a simple process called deploy that executes a shell command – echo “Connected”. The process is shown below in Figure 1.
The configuration of the Test Script step is shown in Figure 2.
A Little About Amazon Web Services
If you are not familiar with AWS, there is a little bit of “stuff” one needs to know. First, in AWS there are images (AMIs) and flavors (instance types). There are over 80,000 images in AWS and they are not intuitive by name. In fact, they are primarily referenced by id. The image represents the OS and what is coming with it (databases, etc) and you will need to browse the Amazon catalogue to find the image you want to use. Then there are flavors that represent the size of the instance on which the image will be instantiated. In our example, we are using Red Hat RHEL-7.3_HVM_GA-20161026-x86_64-1-Hourly2-GP2 image with id ami-0932686c on a t2.micro VM. Not all images support all flavors and the mapping is not documented in AWS.
Next are key pairs. SSH key pairs are how you connect to an Amazon Linux instance. Since UCD is creating the instance on the fly, you need to supply the SSH key on Amazon by name. It is important to remember to use a key that is in the availability zone in which the instance is to be created. You define the availability zone at provisioning time and the key must already be in place.
Lastly, there are security groups. Security groups define the network traffic and the type of protocol to and from the created instance. By default, all outbound traffic is enabled but inbound traffic must be configured in a security group. In our example, we have enabled all inbound traffic but in the real world you will want to only open the ports that are necessary.
Creating the Blueprint
For this example we will be using a Linux VM. In order to troubleshoot any problems with the provisioning, one will need some basic understanding of the Linux command line.
Navigate to the IBM UrbanCode Blueprint Designer, login, and select the Blueprint icon on the left menu bar and click the New… button above the menu bar. Give the blueprint a name and keep the rest of the defaults. By default, the name of the blueprint ends up being the name of the application environment that will be created in UCD.
The following steps assume you have already connected BPD to AWS. From the Images drawer on the right, drag an RHEL 7.3 image onto the canvas. In this example we are using image Red Hat RHEL-7.3_HVM_GA-20161026-x86_64-1-Hourly2-GP2 with id ami-b63769a1.
Click on the VM instance in the canvas. As you select different things on the canvas, the properties in the left menu bar change context to show values of the selected item. Click on the pencil next to the Key of the VM image and change it to test-instance. Do the same for the Name property. Save the blueprint design.
From the Networks drawer, drag your VPC network onto the canvas. You can alternatively use “Reference Network” and specify the VPC at provisioning time. Connect the network to the image. When you let go of the mouse button, Blueprint designer may ask for a subnet. Select “Use a cloud default” or one that has meaning.
From the Security drawer drag the appropriate security group(s) and place them onto the image. Save the blueprint design.
Now select the Components drawer from the palette. You will only see the components to which you have rights in UCD. Select the ucd_bluepint_designer_test component and place it onto the image. The first time you drag a component onto the blueprint canvas you are presented with a dialog window that asks you to identify the application. If you recall, a component can be part of more than one application and this dialog window is where you specify which one to use in the blueprint. You must first add the component to the application in UCD but in this example the component has already been added to the application. This dialog window is also where you can specify an application process or snapshot. Save the blueprint design.
The component version will say MISSING. Change it to LATEST. In the lower middle of the component select the process to run. The component only has one process called deploy so that is selected by default. Your blueprint should now look something like Figure 8.
When you select the component in the image the Properties in the menu bar on the left will indicate the properties you can modify for the component. There are timeouts for the agent relay and the agents, the version of the component and the process to run. Save the blueprint design.
For this blog entry we will stop here. The next entry will execute the provisioning of a blueprint and what happens during execution.
About the Author
David J. Arnone
is an ALM and DevOps Architect specializing in IBM CLM and UrbanCode Deploy solutions and services. As a certified Rational CLM Architect, David joined Zilker Technology in January, 2017 and is part of the growing Zilker DevOps practice team.
Don't miss out! Get updates on new webcasts, events, and blogs.