March 27, 2012 | Written by: Dominique Vernier
Share this post:
There are multiple ways to create an image on the IBM SmartCloud Enterprise and this is what I’ll explain in this blog topic.
We have first to distinguish two main streams: first, import an image from your own premises, and second, build an image based on the instance created on the IBM SmartCloud Enterprise platform.
Create images outside the IBM SmartCloud Enterprise
Since release 2.0 of the IBM SmartCloud Enterprise, an image can be imported in an OVA format to the IBM SmartCloud Enterprise. This is done by using APIs, which are available in three types (Command-line API, Java API, and RESTFul API). Read the article “What are the IBM SmartCloud Enterprise APIs?” to learn more about the APIs).
You can find more information about how to import an image to the IBM SmartCloud Enterprise from its portal by opening the “Creating and Customizing Images and Software Bundles” document.
Another alternative for creating and deploying images is the Smart Elastic Server offering by CohesiveFT, an IBM Business Partner.
Create images inside the IBM SmartCloud Enterprise
The idea, here, is to create an image based on a customized instance, and the customization can reach various levels of flexibility. By flexibility, I mean the possibility to customize the image in a way that the image can fulfill multiple use-cases by deeply parameterizing this image.
From the least flexible to the most flexible, we have the following ways:
- Taking a hard copy of an instance.
- Customizing the image to add extra parameters.
- Relying on the Rapid Deployment Service provided by IBM to leverage scripts to deploy middleware.
Next to these three ways, the IBM SmartCloud Enterprise provides an image called ICCT, which stands for Image Construction and Composition Tool. This tool can help you to create an image based on building blocks called bundles. I will come back on this at the end of this article.
- Take an hard copy of an instance.
This is the least flexible way and the most static one. The idea is just to create an instance out of a selected image from the IBM SmartCloud Enterprise public image catalog. It could be an image holding a simple OS or with a pre-installed software. Then, you customize this instance by, for example, adding your own application. Finally, you take an image from this instance by using the Create an image function from the portal or use the corresponding API.
One important disadvantage of this method is that all instances created from this new image are exactly the same because there is no interaction with the provisioning process to customize the instance on the fly (during the provisioning process). For example, you will not be able to set different configurations of your application for each instance. Also, if your application configuration depends on the instance IP address, one and only one instance will be usable from your image, the one having the IP address for which the configuration was done.
- Customize the image to add extra parameters.
We saw the lack of flexibility of the first solution. This can be fixed by modifying files in the image to activate an interaction with the provisioning process.
In the IBM SmartCloud Enterprise, each image configuration is stored in the Asset Catalog, and you can modify this configuration.
You can find more details about this technique in the developerWorks articles: “Parameterize cloud images for custom instances on the fly“ and “Tailor image validation rules on the fly,” which has the basic concepts.
In the Asset Catalog, you will find an entry for your image. This entry contains some interesting files.
- The parameters.xml file: In this file, you can specify parameters that are needed to customize your instance on the fly. While creating a new instance from your image, you set these parameters to configure your instance. For example, giving a specific password for this given instance.
To achieve this, you add a “field” tag in the parameters.xml file such as:
<field name=”userPassword” label=”User Password” type=”password” pattern=”^\w*(?=\w*\d)(?=\w*[a-z])(?=\w*[A-Z])\w*$” patternErrorMessage=”Invalid Password. Must contain at least 1 number, at least 1 lower case letter, and at least 1 upper case letter.”>
Provisioning an instance from this image will automatically generate a new screen in the portal allowing you to enter the parameters.
The parameters.xml file will be uploaded in the instance with the actual values set during your instance request.
In the file, you can also specify the hypervisor firewall rules.
- The activation_scripts directory: In this directory, you can add files that will be uploaded in your instance during the provisioning process, and thus, add some startup scripts in your instance. These scripts can use the parameters.xml file to configure your instance as needed.
- The GettingStarted.html file: You can update this file to provide user guidance for the instance based on the image. Users will see this HTML page through the portal.
- Use rapid deployment service.
You can leverage the rapid deployment service to configure your instance with middleware. The rapid deployment service provides scripts to install and configure middleware. These scripts can be uploaded in the image through the Asset Catalog, copied to instance during the provisioning process through the activation_script directory, and launched in your newly created instance through a startup script. You can find more information about this technique in the developerWorks article: “Deploy products using rapid deployment service.”
- IBM Image Construction and Composition Tool (ICCT).
Since release 1.4 of the IBM SmartCloud Enterprise, the concept of bundles was introduced. The idea is to create reusable assets, which hold a given software configuration, and bundle these assets with your image, as you would fill your cart in a shop. Since release 2.0, the IBM ICCT, which is available as an image in the IBM SmartCloud Enterprise catalog, can help you to images based on this principle.
Read the developerWorks article: “Establish a system to build custom virtual cloud images“