In this new post I would like to describe how you can script the building of virtual images using the Image Construction and Composition Tool provided by IBM Smart Cloud Provisioning.
The upcoming release of IBM Smart Cloud Provisioning 2.1 embeds, among other things, a new version of the Image Construction and Composition Tool. Image Construction and Composition Tool allows to build virtual images that are self-descriptive, customizable and manageable; at the end it produces Open Virtualization Appliance (OVA) images that can be deployed into a cloud environment.
the new features of this tool is the capability of performing image
management operations directly through a command-line interface. This
capability enables a set of new use cases through a scripting
command-line interface of Image Construction and Composition Tool
provides a scripting environment based on Jython (i.e. the Java-based
implementation of Python) and in addition to issuing commands
specific to the Image Construction and Composition Tool, you can also
issue Python commands at the command prompt.
such interface, you can manage the Image Construction and Composition
Tool remotely since you can download it to any machine and then point
to the system where the tool is running: it communicates with the
server using the HTTPS protocol so that all the communications are
encrypted. The command-line interface can be installed on both Linux
and Windows operating systems and can run in both interactive and
that can be managed in the Image Construction and Composition Tool is
modelled by a resource object on the command-line interface that
exposes a set of methods for performing the related management
actions. The following objects are available: software bundles
references (for defining software configurations to be deployed on a
virtual machine), cloud providers references (for defining the
hypervisors used by Image Construction and Composition Tool to build
and capture images), images references (for handling virtual machine
images to be used for import, extend, capture and export operations)
and users references (for administering the user of Image
Construction and Composition Tool ).
you have downloaded and configured the command-line to start a new
session in interactive mode you can issue the following command from
a shell prompt:
-h <icct server> -u username -p password
you get the interactive shell you can start issuing commands.
are a few examples.
get a list of all the images for a cloud provider, you can use a
command like the following:
import a software bundle and wait for the import to complete, you can
use a set of commands like the following:
if importingBundle.currentState == 'import_failed':
... print 'Bundle import failed!'
get a list of all the images, you can use a command like the
allImages = icct.images
can also use the Image Construction and Composition Tool command-line
interface in batch mode, by creating your own script and then
launching it. For example, to run a script called myScript.py
you can issue the following command:
-h <icct server> -u username -p password -f myScript.py arg1
samples come directly with Image Construction and Composition Tool.
They are located under the following directory:
cover some of the Image Construction and Composition Tool basic
flows, such as creating a new cloud provider configuration, importing
an image, extending an image, etc..
can use them as a starting point for creating your own workflows.
all for now.
have just provided a quick introduction of all the capabilities of
the Image Construction and Composition Tool command-line interface.
If you are interested in discovering more about Image Construction
and Composition Tool, its command-line interface and SCP 2.1, you
can have a look at what is included in IBM Smart Cloud Provisioning