How to "Urbanize" a Component in IBM Urban Code Deploy
JohnnyShieh 060000KVTN Visits (2461)
The beauty of IBM's Urban Code Deploy (UCD) product is the ability of the user to build a component that can be re-used by multiple users or in multiple Heat Orchestration Templates (HOT). That's the theory, what is the practical reality? How do you actually build a component? How do you make it server independent? What does one mean by "server independent"?
In UCD, it's easy to build scripts that launch after a VM has been instantiated. Thus, one could have complex scripts that execute after a VM has been created. Or, one could have simple scripts that then gather more complex scripts and execute these complex scripts to perform actions on the VM, post-OS install.
But, what if the VM is created in an environment where the network or access to servers supplying binaries and programs are not reachable? How does one create a VM and populate it so that it is independent of servers for images or install scripts? What one needs to do is to "urbanize" their components. "Urbanize" is a homegrown phrase used to describe a component that is standalone as an entity, not relying on servers to provide images needed to complete the component installation.
As an example, if a user wanted to install Java on their system, what would the user do in UCD? But they don't want to install the default Java that comes with a RHEL release. They wish to install the IBM version of Java. How does this very specific version of IBM Java get provisioned onto a newly built VM? One would think that they would write a script - within a UCD component. The user knows that the this component script will execute post-OS install. And the script could simply say:
However, as pointed out earlier, what if it is not possible for the newly created VM to reach 10.10.x.x? What does the developer do to make sure that this UCD component is network independent?
The answer is that the IBM Java component needs to be "urbanized". The steps are as follows:
1) Log into the server for IBM UCD
2) mkdir -p /urb
3) scp myim
This copies the image you want to urbanize onto a local directory for IBM UCD to pick up.
4) In the UCD GUI, select Components -> Create New Component
5) Fill out the entry:
6) Select Save. When this occurs, the user is dropped into additional options that are needed to complete configuring the component. This entry can be confusing to users, but the result of the Save is that the user is sitting in the menu options for the just-created component "Install IBM Java RPM". The GUI will look like this:
7) The user will then select Versions -> Import New Versions
What is occurring at this time is that the Version importer agent is going to the user defined directory /urban/java_image and searching the directory with any numerical sub-directories. The user created /urb
8) When the upload is completed, the user should then select: Process -> Create New Process. The user fills out a simple description of the process in the panel:
When the user saves the new process, they will be presented with the default view. The user should then select the "Edit" button on the right side of the screen.
9) At the point, the user should use the menu to the far left of the window. In these folders are pre-built blank functions that the user will use to build the functions that will download and install the Java rpm. The user should select the icon, then drag them onto the white working area between the Start and Finish boxes. The icons to drag and customize are as follows:
9a) Utilities -> FileUtils -> Create Directories
9b) Repositories -> Artifact -> IBM UrbanCode Deploy -> Download Artifacts
9c) Scripting -> Shell -> Shell
9d) Join these three functional "boxes" in the order they should be executed:
9e) But DO NOT FORGET! Save the process that was just created. Click on this tiny, tiny diskette icon to the left:
And now the user has a Component called "Install IBM Java RPM" that can be used in one or more future HOT documents for use with HEAT.