Showing results for 
Search instead for 
Did you mean: 

CloudCenter IPAM Callout Module for Static IP Addressing assignment


Credit goes to demehta for writing this article!


At various stages in the deployment lifecycle of VMs, Cisco CloudCenter supports the ability to control the behavior of the provisioning process. The different lifecycle points where the behavior can be controlled are called topics. The behavior is controlled by scripts via callouts that are assigned to topics. Some common use cases for callouts are as follows

  • Query an IPAM tool during the IP Address Allocation (IPAM) topic to get an IP address and during the IP shutdown topic (IPAM2) to de-allocate the IP address.
  • Assign static IP address to the nodes during deployment time and release the IP address back to the pool upon tear down of the deployment.
  • Configure the name of the VM that is going to be deployed
  • Initiate some clean up action before terminating a deployment

The callout scripts are configured on a per-CCO (Cloud Center Orchestrator) basis and thus allowing users to control the deployment behavior based on the target cloud. Each callout consists of two key parts: a configuration file (callout.conf) and the script to be executed. These files are placed in the /usr/local/osmosix/callout/<name> path on the CCO. The name of the sub-folder that you use is arbitrary, but a best-practice is to use the name of the topic that the callout is for. Ex: /usr/local/osmosix/callout/ipam/<files>

Each callout script, when executed from CloudCenter, has access to a wide variety of environment variables that can be used, including cloud type, deployment environment, etc. A full list is available in the callout script log at /usr/local/osmosix/callout/<name>/logs/<logs>

The callout scripts use the same parameters and incoming variables. However, each callout script exposes a different variable and they are mutually exclusive.

Please refer to the following URL for more information about Callouts in CloudCenter

Use Case: Using callout to assign static IP address during deployment time

Sometimes there is a requirement to assign static IP addresses to the VM’s during application deployment. This may be due to the application requirement or the cloud environment requirement.

For this use case, we will use the IPAM callout topic to assign static IP addresses to the VM’s during deployment time.

We need to configure the callout on the CCO before we begin to deploy applications by providing static IP address at deployment time.

Following are the steps to configure the callout on the CCO

1. First, we need to create a folder on the CCO under the callout directory on the CCO.

To keep things simple, we will create a directory called ipam-static


2. Create the following file in the ipam-static directory


The key value pairs for the callout.conf are as follows








The name must match the dir name that we have configured in Step 1.

3. Create the script in the ipam-static dir

This script is that one that is going to fetch the IP address that we need to assign to the deployed node. The IP address can be read from a file or any other source. Also, all of the parameters specified during deployment time and the cloud environment variables are available to this script.

A sample that will fetch the IP Addr depending on the env is as follows:


# Get the Env Details. In this case as part of the App Profile we will define a custom variable "DEP_ENV" to indicate which list to pick the IP from

# CloudCenter CCO will be passed the variable by prefix it with eNV as shown below.


# File to fetch the IP from. These files will be stored on the CCO and will maintain the IP Addr list.


echo $fname

# Fetch the first available IP Address from the list and mark the status as used

ipAddr=`grep -m 1 "available" $fname | cut -d' ' -f1`

echo $ipAddr

# Change the status of the IP Address from available to used

sed -i -e /$ipAddr/s/available/used/ $fname

# Configure the key value pairs that are needed to be passed to the VM for static IP Address configuration

# These value pairs will be used by the CCO to configure the static IP Address for the deployed VM

echo "nicIP_0=$ipAddr"

echo "nicDnsServerList_0="; # DNS Server List can also be dynamically fetched from the file.

echo "nicGateway_0=" ; # Gateway can also be dynamically fetched from the file.

echo "nicNetmask_0="; # Netmask can also be dynamically fetched from the file.

4. Ensure that has executable permissions

          chmod +x

5. In this case, the 2 files (dep_ip_list and prod_ip_list) that maintain the ip list will also be in the same location as i.e /usr/local/osmosix/callout/ipam-static/

The sample entries in these files look like as follows

dev_ip_list available available available available available available available available available

At this point we have configured all of the steps that we need as part of the callout.

The next step is to configure the App profile so that we can specify a static IP address during deployment.

As part of the App profile, we are going to create a custom parameter as shown below


During deployment time, depending on the Environment that the user selects, the callout script will automatically fetch the IP address to be assigned to the VM's.

Please note that the script is a sample script to showcase how callout's can be configured in CloudCenter to manage static IP addresses.

The script can be customized to meet the user's requirement.

Some examples are as follows

  • User can specify the IP Address to be assigned as part of the App profile
    • In this can we can define a custom parameter to take the IP Address as input during deployment.
    • The logic for the callout script will read this IP and can check against a list to see if it is available or assigned and take actions accordingly.
  • Pick IP address depending on the Environment where the VM is deployed and configure a domain name for the deployed VM
    • In this case, we can also specify domain name as an additional parameter and the script will configure the IP Address and then configure the domain name as well.