Learn how to configure dynamic environments in IBM® UrbanCode Deploy in the context of a continuous delivery solution. The solution is based on a real case study, the "DevOpsInACloud" scenario, which uses UrbanCode Deploy to create, update, and manage environments dynamically, based on workload.
Description of the DevOpsInACloud scenario
As shown in Figure 1, each DevOpsInACloud server environment is composed of two images of operating systems. One image is the primary node and the other is the secondary node. When a new server environment is needed, it can be dynamically created in the cloud, based on the requirements of the workload. These environments are maintained dynamically with UrbanCode Deploy.
Figure 1. DevOpsInACloud architecture
This article describes how to configure a dynamic environment in UrbanCode Deploy, so that each time a new server environment is created, it is automatically added to the UrbanCode Deploy environment.
Configure the UrbanCode Deploy agent on new environments
In a cloud environment, new environments are generated from the cloud image template. You can configure the UrbanCode Deploy agent on the newly provisioned environment in two ways:
- Start from a template without the UrbanCode Deploy agent installed. You can then install and configure the agent right after machine deployment.
- Start from a template with the UrbanCode Deploy agent pre-installed. You can then re-configure the agent name and the agent ID attributes before starting the agent. The name of the agent has to be configured using the following naming convention each time a new environment is created.
ENV_TYPE: Indicates the type of environment type (for example,
NODE_TYPE: Specifies whether this is a primary (
P) or secondary (
ENV_ID: Specifies a number (
n) that represents a particular environment
Use UrbanCode Deploy to configure dynamic environments
To configure UrbanCode Deploy so that the newly provisioned virtual machines are automatically added to the specific dynamic environment, use the following steps:
- Define a resource template.
- Define a top-level group resource.
- Define an application blueprint.
- Create the application environment.
- Configure the environment to dynamically manage the agents.
Step 1. Define a resource template
To define a new resource template in the UrbanCode Deploy server, click Resource > Resource Template to get the Resource Template shown in Figure 2.
- In the Primary nodes group define a new Agent
Prototype and add the relative primary node components:
- Click Actions on the Primary nodes group row and click Add Agent Prototype.
- Click Actions on the Agent prototype row you just created and click Add Component.
- Repeat Step 1 to define the Secondary nodes group row.
Figure 2. Define a new resource in the resource template
Step 2. Define a top-level group resource
Define a new Top-Level Group resource in Resources. This group is the root of the environment.
As shown in Figure 3 in the Resource tab, click
Create Top-Level Group resource and specify a name,
Figure 3. Top-level group resource definition
Step 3. Define an application blueprint
To define a new application blueprint:
- Click the Application tab and select your application.
- Click the Blueprints tab and then click Create New Blueprint.
- Specify a name for the blueprint and the name of the resource template defined previously, as shown in Figure 4.
Figure 4. Blueprint definition
Step 4. Create the application environment
To create a new application environment:
- Click the Application tab and select your application. In this case, the application is the DevOpsInACloud application.
- Click the Environments tab and then click Create New Environment
- As shown in Figure 5, specify:
- Name: Type the name of the environment you want to create.
- BluePrint: Select the blueprint created in Step 3.
- Base Resource: Select the Top-Level
Group resource. In this case, the group is the
DevOpsInACloud_Groupcreated in Step 2.
- Click Save to save the new environment.
Figure 5. Environment definition
As soon as you save the new environment, you can find it in the list of application environments, as shown in Figure 6.
Figure 6. List of application environments
Step 5. Configure the environment to manage the agents
The environment is automatically created in the top-level group resource, but the environment is not automatically populated with the agents.
Figure 7. Application environment in the top-level group resource
To configure the groups (created in Step 2) to manage group members automatically, click the Resources tab and then:
- Find the group you want manage dynamically (for example Primary nodes group) and click the Edit resource icon.
- Click Manage Members automatically and define a regular expression for the specific group.
In the DevOpsInACloud scenario, two groups are configured:
Primary nodes group and
Secondary nodes group.
In this example,
Primary node group is specified as a regular
expression based on the agent name. All of the agents with names that fit
QA_P_.* are included in this group, as shown in
Figure 8. Resource group definition for primary nodes
Secondary node group is specified as a regular expression
based on the agent name. All of the agents with names that fit the pattern
QA_S_.* are included in this group as shown in Figure 9.
Figure 9. Resource group definition for secondary nodes
Automatically, the agents that are already installed are included in the environment.
The components specified in the specific agent prototype in the resource template (created in Step 1) are associated with the corresponding physical agents, as shown in Figure 10.
Figure 10. Result of resources configuration
As soon as a new sub-environment
QA is deployed, it is
automatically included in the DevOpsInACloud environment and the correct
components are associated to the agent.
To ensure continuous delivery solution in a cloud environment you need to manage environments that can change dynamically. In the DevOpsInACloud scenario, UrbanCode Deploy is used to dynamically create new environments based on workload.
- IBM UrbanCode Deploy offers an automation deployment framework that reduces deployment errors and improves efficiency, correctness, and traceability.
- Find more useful resources on UrbanCode Deploy. Refer to the UrbanCode Deploy information center.
Get products and technologies
- Download a free trial version of IBM UrbanCode Deploy.
- Download a free trial version of Rational software.
- Evaluate IBM software in the way that suits you best: Download it for a trial, try it online, use it in a cloud environment.
- Check the Rational software forums to ask questions and participate in discussions.
- Ask and answer questions and increase your expertise when you get involved in the Rational forums, cafés, andwikis.
- Join the Rational community to share your Rational software expertise and get connected with your peers.
- Rate or review Rational software. It's quick and easy.
Dig deeper into DevOps on developerWorks
Get samples, articles, product docs, and community resources to help build, deploy, and manage your cloud apps.
Experiment with new directions in software development.
Software development in the cloud. Register today to create a project.
Evaluate IBM software and solutions, and transform challenges into opportunities.