Deploying IBM UrbanCode Deploy Blueprint Designer Cloud Applications Part 2 – Agents and Agent Relays
In Part 1 of this blog series, we connected the Blueprint Designer to AWS. In Part 2, we are going to discuss agents and agent relays. Agents are the UCD objects that actually execute the deployment. Agent relays are mechanisms to scale multiple agent environments. The focus of this blog entry is to review the mechanics of how agents and agent relays work together in preparation for how blueprints make use of them. Information on how to install agents and agent relays is provided in the UCD Knowledge Center.
UrbanCode Deploy is Agent Based
The real power of UCD is that it is an agent-based solution. Agents are lightweight Java processes that listen for requests from the UCD server. Upon request, the agents run application deployments dictated by the component processes, resource hierarchy, and application environments to which they are associated. The agents communicate results back to the UCD server which tracks inventory and compliance across a deployment landscape.
An agent needs to be installed and executed on every machine or VM that will receive deployable components. For enterprises that have a rich application catalog on large and complex full-stack environments, the agent approach presents a number of scaling problems. The first is the load on the UCD server and the second is deployment, maintenance, and monitoring of agents.
Agent relays solve the problem of excessive load on the UCD server. Instead of each agent connecting to the UCD server directly, one can instead use an agent relay acting as a proxy between the UCD server and the agents that are running across environments. Rather than a connection between the server and each agent, there is now just one connection between the server and the agent relay. The agents are then connected to the agent relay using it to manage communication with the server. The following diagram, borrowed from the UCD Knowledge Center, portrays the interconnections and firewall port (default) opening requirements.
Agent and Agent Relay Deployment
The agent relay needs to be installed explicitly. But there are facilities to install agents right from within the UCD server web application or from the command line if agents are loaded into UCD as components. To do so without blueprints, you will need to know the target machine instance already created and know its hostname or IP address.
Agent and Agent Relay Monitoring
In UCD, under Resources, the status of the agent relay is shown as well as its status.
You can also see the status of the connected agents under the relay.
Clicking on the name of the agent relay shows the agents that are attached to the agent relay, their status, and some administration actions for agents that are available. Going to the agent tab directly will also show the agent below and will also provide options for installing agents from the web client.
Adding the Blueprint Designer to the Mix
At this point, one still needs to manually install agents using one more of the several methods for doing so. Using the Blueprint Designer, however, will automate the provisioning of the agents needed based on the number of VM instances in the blueprint. One of the install components from the Blueprint Designer installation packages is the Cloud Agent Package. As mentioned in Part 1 of this blog series, the Cloud Agent package installation adds the UCD agents for the various supported platforms. These are now deployable components and their deployment is automated at blueprint provisioning time. They are visible in UCD as components.
Command Line Option Deployment of Agents
There is value to installing the Cloud Agents separately without the use of the Blueprint Designer. After all, they are just agents and not cloud-specific (even though they are called that) objects. From the target machine, either use the server web client to export the appropriate agent or use the following REST API.
The commands below can also be constructed using the UCD CLI but by using curl you save yourself the need to install the UCD CLI tools. In both cases, replace the bold red text with your server and credential values. The ports shown are the defaults and DNS names can be used instead of IP addresses as long as the server names can be resolved.
The following command is using an agent relay to download the cloud agent ucd-agent-linux-x86_64.tgz component to the /tmp directory. Make sure the machine where you are executing this from can reach the agent relay.
curl –proxy http://your.relay.ipaddress:20080 -Lk –retry 10 –retry-max-time 120 -o /tmp/ibm-ucd-agent-linux-x86_64.tgz -u ucd_user:ucd_password https://your.ucd.server.ipaddress:8443/cli/version/downloadArtifacts?component=ucd-agent-linux-x86_64&version=7.1&singleFilePath=ibm-ucd-agent-linux-x86_64.tgz
The following command is downloading the cloud agent ucd-agent-linux-x86_64.tgz component to the /tmp directory without using an agent relay. Make sure that the machine where you are executing this from can reach the UCD server.
curl -Lk –retry 10 –retry-max-time 120 -o /tmp/ibm-ucd-agent-linux-x86_64.tgz -u ucd_user:ucd_password “https://your.ucd.server.ipaddress:8443/cli/version/downloadArtifacts?component=ucd-agent-linux-x86_64&version=7.1&singleFilePath=ibm-ucd-agent-linux-x86_64.tgz“
The command can also be constructed using the UCD CLI but by using curl you save yourself the need to install the UCD CLI tools. In both cases, replace the bold red text with your server and credential values. The ports shown are the defaults and DNS names can be used instead of IP addresses as long as the server names can be resolved. Unpack the downloaded component with:
tar -zxf /tmp/ibm-ucd-agent-linux-x86_64.tgz -C /tmp
The following commands install the agent in /opt/ibm-ucd and start it. The first command is when using an agent relay and the second is when you are connecting your deployed agent directly to the UCD server. The agent_team parameter is the team in UCD that will own the agent. Replace agent_name with the name you want for the agent. The install script will append the IP address of the machine to the name provided.
/tmp/ibm-ucd-agent-install/install-agent-with-options.sh -t “agent_team” -p 7916 -s http://your.relay.ipaddress -r -d -x start -v -n agent_name
/tmp/ibm-ucd-agent-install/install-agent-with-options.sh -t “agent_team” -p 7918 -s http://your.ucd.server.ipaddress:ucd_port -x start -v -n agent_name
Make sure your agent processes is running on the target machine and it is visible in the UCD server.
In my next blog post we will begin to construct our blueprint. The steps to install the agent presented here will not be necessary as provisioning a blueprint automates that step for each of the target machines. Installing an agent relay, however, will be necessary since the VM instances to which we are deploying may not know of machines in your network.
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.