// removed jquery ui css and js

Capacity Management

Overview

When you deploy an application and if Capacity Management is enabled, then the CloudCenter platform is capable of automatically identifying the applicable VMware cluster or OpenStack zone with the most efficient CPU or memory and deploys the application to the identified cluster or zone. This Capacity Management feature helps make the most efficient use of system resources and enables the CloudCenter platform to automatically offload workloads based on capacity.

Requirements

To use this feature, you must:

  • Enable Capacity Management (On).

  • Enable Auto Select Cluster (for VMware) or Auto Select Zone (for OpenStack) on the Deployment Environment Defaults or the Deploy forms.

Enabling Capacity Management

By default, Capacity Management is disabled (Off).

To enable Capacity Management for a region, take either of these actions:

  • Access the Admin > Clouds page, click Configure Capacity Management for a region to display the Capacity Management tab, and then turn on the Capacity Management switch

  • Access the Admin > Clouds page, click a region name, click the Capacity Management tab, and then turn on the Capacity Management switch

When Capacity Management is enabled, you:

  • Cannot select a cluster or availability zone during deployment because the CloudCenter platform determines the cluster or zone for the deployment. The CloudCenter platform makes this determination when you deploy from the Define Default Cloud Settings form or from the Deployments (Job Submission) page.

  • Can turn on Auto Select Cluster (or Zone) in the Deployments or in Deployment Environment Defaults forms.

If Capacity Management is on and Auto Select Cluster is on, then:

  • The CloudCenter platform deploys on the cluster that has the lower VCPU utilization percentage.

  • If clusters have the same VCPU utilization, the CloudCenter platform uses the cluster that has the lowest memory utilization.

  • VCPU utilization has precedence over memory utilization.

  • On the Deployment Details page, in the node information area, Auto Selected appears in parentheses after the cluster name in the Cluster field or the Zone field if the cluster or zone has been auto selected, and Auto Selected appears next to the network name if the network has been auto selected. See the Deployment Details page for additional context.

You can override this auto selection behavior by specifying a custom script. With a script:

  • You can specify your own strategy for auto selection instead of using the CloudCenter auto selection strategy.

  • For example, a custom script might specify that memory utilization takes precedence over VCPU utilization.

If you turn Capacity Management off after it has been configured, configuration settings are maintained but collections of utilization metrics are stopped. If you then turn Capacity Management back on, collections of utilization metrics start again.

Limitations

The capacity management feature is only available for the following clouds:

  • VMware

  • OpenStack

Prerequisites

  • The Orchestrator must be configured for the region.

  • An admin account with the privilege to execute APIs on the cloud region must exist. This account should have cloud provider privileges with the capability of handling APIs in the cloud. Choose an account that has the privilege to access the capacity of every cluster or zone in the cloud.

  • The Auto Select Cluster (for VMware) or Auto Select Zone (for OpenStack) switch must be turned on in the Deployment Environment Defaults page, or in the Deploy form if no defaults are configured of defaults are unlocked.

Process

After you turn on Capacity Management, you can configure settings for this feature by clicking one of the following links:

  • To configure settings for the first time, click Add Capacity Management Settings.

  • To change settings for a configured resource, click Edit next to the corresponding resource.

Clicking either link displays the Capacity Management settings page. After you add or update the capacity management settings on this page, save your changes.

Capacity Management Tab

The Capacity Management tab provides information about regions for which Capacity Management is enabled and options for managing deployments.

Information displayed on the Capacity Management page refreshes from the cloud every 60 seconds by default (although the page refreshes every 10 seconds). You can change this interval by exporting the value of the COLLECTION_FREQUENCY_IN_SECONDS in the /etc/sysconfig/capacity-manager.conf file, restarting the capacity management service by using the systemctl restart capacitymanage command.

General Information on the Capacity Management Tab

The left side of the Capacity Management tab lists the regions for which Capacity Management is enabled. When Capacity Management is enabled and configured, the top part of this tab also provides the following summary information for the selected region:

  • Total number of clusters or zones in the region.

  • Total number of VMs in the region

  • vCPU utilization.

  • Memory utilization.

The information for vCPU utilization and memory utilization appears as a percentage value, followed by a fraction. The percentage shows the percentage of the total available resources that are consumed. The first number in the fraction shows the number of resources that are consumed. The second number shows the total number of resources, based on the configured capacity ratio. For example, a vCPU utilization display of "21% (55/256)" means that 55 out of 256 vCPUs are in use, which represents a usage of 21% of the total number of vCPUs.

Specific Information on the Capacity Management Tab

When Capacity Management is enabled and configured, the Capacity Management tab provides the following details under the summary information.

In this summary:

  • The vCPU utilization and memory utilization appears as a percentage value, followed by a fraction. The percentage shows the percentage of the total available resources that are consumed. The first number in the fraction shows the number of resources that are consumed. The second number shows the total number of resources, based on the configured capacity ratio. A yellow vCPU or memory value indicates that vCPU or memory usage is 10% less than the capacity threshold. A red value indicates that vCPU or memory usage has exceeded the capacity threshold.

  • The Data Center details follows the summary information and provides information about each datacenter. By default, this table is expanded and includes the name of the data center, the number of VMs that it encompasses, the number of clusters that it straddles, the vCPU utilization, and memory information.

  • For VMware, clusters follows the datacenter details. These tables provide the following information about each cluster in the datacenter. By default, these tables are expanded.

    • Cluster name, and cluster status (such as RUNNING).

    • Total number of powered on VMs.

    • vCPU utilization, for VMs that are powered on and straddled.

    • Memory utilization, for VMs that are powered on and straddled.

    • Actions, which are described later in the Actions table in this section.

  • For OpenStack, Availability Zones tables display. These tables provide the following information about each zone in the datacenter. By default, these tables are expanded.

    • Zone name, and zone status (such as RUNNING).

    • Total number of powered on VMs.

    • vCPU utilization, for VMs that are powered on and straddled.

    • Memory utilization, for VMs that are powered on and straddled.

    • Actions, which are described later in the Actions table in this section.

The Clusters tables and the Availability Zones provide the following options from the dropdown menu in the Actions column as described in the following table:

ActionsDescriptionCloud Nuances

Edit Cluster Deployment Settings

 

Displays the Edit Cluster Settings dialog box, which includes these options:
  • Resource Pool–Choose the resource pool that should be used for this cluster. See Resource Placement and Validation for additional context.
  • Enable Full Clone–Turn on to enable full cloning. See VMware Network Settings for additional context.

  • Datastore Cluster–This field appears when you turn on full cloning and a datastore is configured for this cluster. Choose the datastore cluster to use for cloning. See VMware Network Settings for additional context.

  • Datastore–This field appears when you turn on full cloning. To use cloning, choose this field. See VMware Network Settings for additional context.

  • Root Disk Resizable–Turn on to indicate that the root disk is resizable. See VMware Network Settings for additional context.

VMware
Exclude from DeploymentSelect this option to make the cluster or zone unavailable for a deployment. This setting is useful when you need to perform maintenance on the cluster or zone. When a cluster or zone is excluded from deployment, a blue circle with a diagonal line through it appears in the Name column. When you chose this option, the Exclude from Deployment / <cluster> dialog box displays with the following options:
  • Start Date – Enter the date and time at which the exclusion should begin. A designation such as now or in an hour or in 5 days appears next to the start date fields to indicate the length of the exclusion before it is scheduled to start.

  • End Date (Optional) – Turn on this switch and then enter the date and time at which the exclusion should end and the cluster should become available for deployments. If you do not specify an end date, the cluster remains in maintenance mode until you choose the Include in Deployment option.

  • Timezone – Select the time zone of your location.

VMware OpenStack

Include in DeploymentAvailable for a cluster or zone that has been excluded from deployment. Select this option to remove the cluster or zone from exclusion.

VMware

OpenStack
Cancel Scheduled ExclusionAppears if you configured a future start date or time for excluding a cluster or zone from deployment. Select this option to cancel a future exclusion of a cluster or zone.

VMware

OpenStack
Edit Scheduled ExclusionAppears if you configured a future start date or time for excluding a cluster or zone from deployment. Choose this option to edit a future exclusion period.

VMware

OpenStack

Sample Scripts During Auto Selection

Turning on the Use Script for Cluster Auto Select or Use Script for Zone Auto Select switches when configuring Capacity Management causes the CloudCenter platform to use a designated custom script to override the criteria that Capacity Management uses to select a VMware cluster or OpenStack zone. The script provides the set of clusters or zones that are not in maintenance and that have not exceeded the configured CPU and memory thresholds.

After you turn on one of these switches, you can also turn on the Use Script for Network Auto Select switch that appears. Turning on this switch causes the custom script to override the criteria that Capacity Management uses to select a network for the deployment. The corresponding cluster or zone should be also returned by the script. If you do not turn on the Use Script for Network Auto Select, the CloudCenter platform relies on the script to select a cluster or zone only from the set of clusters or zones that are not in maintenance and that have not exceeded the configured CPU and memory thresholds.

The following sample scripts are for Auto Select and are specific to VMware:

  • getresponse.sh

  • list_network.py

Both scripts are located in the cm.zip file and the getresponse.sh file calls the list_network.py file for network information when required . As long as you save these scripts in two separate files within the same folder at the cm.zip level, you can use both scripts as designed to manage your capacity effectively.


  •  VMware Sample Scripts
    Sample getosresponse.sh File
    #!/bin/bash
    . /utils.sh
    
    print_error_msg(){
        content="{\"error\":\"$1\"}"
        print_ext_service_result "$content"
        exit 422
    }
    
    check_null_empty(){
        if [ -z "$2" ];
        then
            print_error_msg "Missing Parameter $1"
        fi
    }
    
    check_null_empty "Cliqr_Cloud_ServiceUrl" "$Cliqr_Cloud_ServiceUrl"
    check_null_empty "Cliqr_Cloud_Account_Name" "$Cliqr_Cloud_Account_Name"
    check_null_empty "Cliqr_Cloud_Account_Pwd" "$Cliqr_Cloud_Account_Pwd"
    
    export VCenter_URL="$Cliqr_Cloud_ServiceUrl"
    export VCenter_Host=`echo $VCenter_URL | awk -F'/' '{print $3}'`
    export VCenter_User="$Cliqr_Cloud_Account_Name"
    export VCenter_Password="$Cliqr_Cloud_Account_Pwd"
    
    if [ -z $Cliqr_available_resources ];
    then
            content="{\"error\":\"No available Resources found in the environment variables\"}"
            print_ext_service_result "$content"
        exit 0
    fi
    export capacity=`echo $Cliqr_available_resources | awk '{split($0,a,","); print a[1]; print a[2]}' | awk '/./{line=$0} END{print line}'`
    export Cluster_Name="$capacity"
    
    if [ -z $Cliqr_nics_count ];
    then
        export num_nics="0"
    else
        export num_nics=$Cliqr_nics_count
    fi
    
    yum install -y python-requests
    wget http://dl.fedoraproject.org/pub/epel/7/x86_64/p/python2-pyvmomi-6.5-1.el7.noarch.rpm
    rpm -Uvh python2-pyvmomi-6.5-1.el7.noarch.rpm
    yum install python2-pyvmomi -y
    
    export networks=`python list_network.py -s $VCenter_Host -u $VCenter_User -p $VCenter_Password -c $Cluster_Name | sort | uniq`
    
    export network_list=`echo "$networks" 2>&1 | tail -$num_nics`
    
    #export network_list=`echo "$networks" | sed -n "$num_nics"p`
    export network_content=""; 
    for i in $(seq 1 $num_nics); 
    do 
        count=`expr $i - 1`; 
        selected_network=`echo "$network_list" | sed -n "$i"p`; 
        network_content="$network_content\"nicNetwork_$count\":\"$selected_network\","; 
    done; 
    
    content="{\"resource_name\":\"$capacity\",$network_content \"error\":\"\"}"
    print_ext_service_result "$content"

    The following is a dependent internal file, getresponse.sh, that is called by the cm.zip script.

    VMware Sample Python Script
    #!/usr/bin/env python
    
    import argparse
    import atexit
    
    from pyVmomi import vim
    from pyVmomi import vmodl
    from pyVim import connect
    
    
    def get_args():
        """
       Supports the command-line arguments listed below.
       """
        parser = argparse.ArgumentParser(
            description='Process args for retrieving all the Virtual Machines')
    
        parser.add_argument('-s', '--host',
                            required=True, action='store',
                            help='Remote host to connect to')
    
        parser.add_argument('-o', '--port',
                            type=int, default=443,
                            action='store', help='Port to connect on')
    
        parser.add_argument('-u', '--user', required=True,
                            action='store',
                            help='User name to use when connecting to host')
    
        parser.add_argument('-p', '--password',
                            required=True, action='store',
                            help='Password to use when connecting to host')
    
        parser.add_argument('-c', '--cluster',
                            required=True, action='store',
                            help='ClusterName to fetch the networks available in it')
    
        args = parser.parse_args()
        return args
    
    
    def main():
        args = get_args()
    
        try:
            service_instance = connect.SmartConnectNoSSL(host=args.host,
                                                    user=args.user,
                                                    pwd=args.password,
                                                    port=int(args.port))
            if not service_instance:
                print("Could not connect to the specified host using "
                      "specified username and password")
                return -1
    
            atexit.register(connect.Disconnect, service_instance)
    
            content = service_instance.RetrieveContent()
            obj_view = content.viewManager.CreateContainerView(content.rootFolder,
                                                               [vim.Network],
                                                               True)
            network_list = obj_view.view
            obj_view.Destroy()
    
        obj_view = content.viewManager.CreateContainerView(content.rootFolder,
                                                               [vim.ComputeResource],
                                                               True)
        cluster_list = obj_view.view
        obj_view.Destroy()
    
        for network in network_list:
            hosts = network.host
            for host in hosts:
                for cluster in cluster_list:
                    clusterhosts = cluster.host
                            for clusterhost in clusterhosts:
                                    if host.name == clusterhost.name:
                            if cluster.name == args.cluster:
                                print network.name
    
        except vmodl.MethodFault as error:
            print "Caught vmodl fault : " + error.msg
            return -1
    
        return 0
    
    # Start program
    if __name__ == "__main__":
        main()
    VMware Sample Script Input
    Cliqr_tier_type=CentOS
    Cliqr_QA-Automation_utilized_cpu=94
    Cliqr_QA-Automation_total_cpu=128
    Cliqr_available_resources_count=1
    Cliqr_memory_threshold=90
    Cliqr_QA-Automation_total_memory=261063
    Cliqr_Cloud_ServiceUrl=https://<HOST>:PORT>/sdk
    Cliqr_nics_count=2
    Cliqr_auto_select_network=true
    Cliqr_Cloud_Account_Name=dev@localhost.localdomain
    Cliqr_Cloud_Account_Pwd=welcome2cliqr
    Cliqr_QA-Automation_datacenter=dc1
    Cliqr_memory_ratio=1.5
    Cliqr_QA-Automation_utilized_memory=133434
    Cliqr_available_resources=QA-Automation
    Cliqr_Cloud_InstanceNamingStrategy=Default
    Cliqr_QA-Automation_total_vms=70
    Cliqr_cpu_ratio=5.0
    CLIQR_EXECUTE_SCRIPT=env
    Cliqr_cpu_threshold=90
    Cliqr_Cloud=Vmware
    Cliqr_Cloud_Account_Id=MyCloudAccount
    Cliqr_pending_request_networks=DS-Private-DVUplinks-212
    Cliqr_network_DS-Private-DVUplinks-212_IP_count=1
    VMware Sample Script Output
    {
       "resource_name":"QA-Automation",
       "nicNetwork_0":"DS-Private-DVUplinks-212",
       "nicNetwork_1":"DS-PrivatePortGroup",
       "error":""
    }
  •  OpenStack Sample Scripts
    OpenStack Sample Bash Script, API v2
    #!/bin/bash
    . /utils.sh
    
    print_error_msg(){
            content="{\"error\":\"$1\"}"
            print_ext_service_result "$content"
            exit 422
    }
    
    check_null_empty(){
            if [ -z "$2" ];
            then
                    print_error_msg "Missing Parameter $1"
            fi
    }
    
    install_retry_on_failure(){
        n=0
        until [ $n -ge 5 ]
        do
            $1 && break 
                  n=$[$n+1]
                  sleep 1
            if [ $n -eq 5 ];
            then
                print_error_msg "Failed to execute $1"
            fi
           done
    }
    
    check_null_empty "Cliqr_Cloud_Endpoint" "$Cliqr_Cloud_Endpoint"
    check_null_empty "Cliqr_Cloud_TenantName" "$Cliqr_Cloud_TenantName"
    check_null_empty "Cliqr_Cloud_Account_Name" "$Cliqr_Cloud_Account_Name"
    check_null_empty "Cliqr_Cloud_Account_Pwd" "$Cliqr_Cloud_Account_Pwd"
    
    check_null_empty "Cliqr_deployment_Cloud_Endpoint" "$Cliqr_deployment_Cloud_Endpoint"
    check_null_empty "Cliqr_deployment_Cloud_TenantName" "$Cliqr_deployment_Cloud_TenantName"
    check_null_empty "Cliqr_deployment_Cloud_Account_Name" "$Cliqr_deployment_Cloud_Account_Name"
    check_null_empty "Cliqr_deployment_Cloud_Account_Pwd" "$Cliqr_deployment_Cloud_Account_Pwd"
    
    install_retry_on_failure "yum install -y epel-release"
    install_retry_on_failure "yum install -y epel-release"
    install_retry_on_failure "yum install -y gcc openssl-devel python-pip python-wheel python-virtualenv python-virtualenvwrapper"
    install_retry_on_failure "pip install pip --upgrade"
    install_retry_on_failure "pip install python-openstackclient"
    
    #OpenStack Cli is Installed and should be ready to use
    
    export OS_AUTH_URL="$Cliqr_Cloud_Endpoint"
    export OS_TENANT_NAME="$Cliqr_Cloud_TenantName"
    export OS_USERNAME="$Cliqr_Cloud_Account_Name"
    export OS_PASSWORD="$Cliqr_Cloud_Account_Pwd"
    
    #We can Use the CLI for getting the zone details or metric using Admin Account as configured above.
    
    if [ -z $Cliqr_available_resources ];
    then
            content="{\"error\":\"No available Resources found in the environment variables\"}"
            print_ext_service_result "$content"
            exit 0
    fi
    
    export capacity=`echo $Cliqr_available_resources | awk '{split($0,a,","); print a[1]; print a[2]}' | awk '/./{line=$0} END{print line}'`
    export Cluster_Name="$capacity"
    
    get_networks(){
        #Network will be fetched using the Cloud Account with which Deployment is done which is as below.
        export OS_AUTH_URL="$Cliqr_deployment_Cloud_Endpoint"
        export OS_TENANT_NAME="$Cliqr_deployment_Cloud_TenantName"
        export OS_USERNAME="$Cliqr_deployment_Cloud_Account_Name"
        export OS_PASSWORD="$Cliqr_deployment_Cloud_Account_Pwd"
        export network_list=`openstack network list | awk '{print $4}' | sed '/^$/d' | sed -n '1!p'`
        internal_networks=""
    
        #Iterate over all networks and fetch only the internal networks
        while read -r line; do
            network_type=`openstack network show $line | grep -i "router:external" | awk '{print $4}'`
            if [ "$network_type" == "Internal" ]; 
            then 
                #netId=$line
                #Comment out the below line and uncomment above line if you want to pass network name instead of network UUID
                netId=`openstack network show $line | grep -i "id" | awk '{print $4}' | head -n 1`
                export internal_networks=$netId,$internal_networks; 
            fi
        done <<< "$network_list"
    
        export internal_networks=`echo $internal_networks | tr , '\n' | sed '/^$/d'`
        #echo "$internal_networks"
    }
    
    export network_content="";
    if [ -z $Cliqr_nics_count ];
    then
            export num_nics="0"
    else
            export num_nics=$Cliqr_nics_count
        get_networks
        export selected_network_list=`echo "$internal_networks" 2>&1 | head -n $num_nics`
        for i in $(seq 1 $num_nics);
        do
                count=`expr $i - 1`;
                selected_network=`echo "$selected_network_list" | sed -n "$i"p`;
                export network_content="$network_content\"nicNetwork_$count\":\"$selected_network\",";
            export network_content="$network_content\"nicPrivateIpAllocation_$count\":\"DHCP\",";
            export network_content="$network_content\"nicAssignPublicIp_$count\":\"true\",";
        done;    
    fi
    
    content="{\"resource_name\":\"$capacity\",$network_content \"error\":\"\"}"
    print_ext_service_result "$content"
    OpenStack Sample Bash Script, API v3
    #!/bin/bash
    . /utils.sh
    
    print_error_msg(){
            content="{\"error\":\"$1\"}"
            print_ext_service_result "$content"
            exit 422
    }
    
    check_null_empty(){
            if [ -z "$2" ];
            then
                    print_error_msg "Missing Parameter $1"
            fi
    }
    
    install_retry_on_failure(){
        n=0
        until [ $n -ge 5 ]
        do
            $1 && break 
                  n=$[$n+1]
                  sleep 1
            if [ $n -eq 5 ];
            then
                print_error_msg "Failed to execute $1"
            fi
           done
    }
    
    check_null_empty "Cliqr_Cloud_Endpoint" "$Cliqr_Cloud_Endpoint"
    check_null_empty "Cliqr_Cloud_TenantName" "$Cliqr_Cloud_TenantName"
    check_null_empty "Cliqr_Cloud_Account_Name" "$Cliqr_Cloud_Account_Name"
    check_null_empty "Cliqr_Cloud_Account_Pwd" "$Cliqr_Cloud_Account_Pwd"
    
    check_null_empty "Cliqr_deployment_Cloud_Endpoint" "$Cliqr_deployment_Cloud_Endpoint"
    check_null_empty "Cliqr_deployment_Cloud_TenantName" "$Cliqr_deployment_Cloud_TenantName"
    check_null_empty "Cliqr_deployment_Cloud_Account_Name" "$Cliqr_deployment_Cloud_Account_Name"
    check_null_empty "Cliqr_deployment_Cloud_Account_Pwd" "$Cliqr_deployment_Cloud_Account_Pwd"
    
    install_retry_on_failure "yum install -y epel-release"
    install_retry_on_failure "yum install -y epel-release"
    install_retry_on_failure "yum install -y gcc openssl-devel python-pip python-wheel python-virtualenv python-virtualenvwrapper"
    install_retry_on_failure "pip install pip --upgrade"
    install_retry_on_failure "pip install python-openstackclient"
    
    #OpenStack Cli is Installed and should be ready to use
    
    export OS_AUTH_URL="$Cliqr_Cloud_Endpoint"
    export OS_TENANT_NAME="$Cliqr_Cloud_TenantName"
    export OS_USERNAME="$Cliqr_Cloud_Account_Name"
    export OS_PASSWORD="$Cliqr_Cloud_Account_Pwd"
    
    #We can Use the CLI for getting the zone details or metric using Admin Account as configured above.
    
    if [ -z $Cliqr_available_resources ];
    then
            content="{\"error\":\"No available Resources found in the environment variables\"}"
            print_ext_service_result "$content"
            exit 0
    fi
    
    export capacity=`echo $Cliqr_available_resources | awk '{split($0,a,","); print a[1]; print a[2]}' | awk '/./{line=$0} END{print line}'`
    export Cluster_Name="$capacity"
    
    get_networks(){
        #Network will be fetched using the Cloud Account with which Deployment is done which is as below.
        export OS_AUTH_URL="$Cliqr_deployment_Cloud_Endpoint"
        export OS_TENANT_NAME="$Cliqr_deployment_Cloud_TenantName"
        export OS_USERNAME="$Cliqr_deployment_Cloud_Account_Name"
        export OS_PASSWORD="$Cliqr_deployment_Cloud_Account_Pwd"
        export OS_PROJECT_DOMAIN_NAME="default"
        export OS_USER_DOMAIN_NAME="default"
        export OS_IDENTITY_API_VERSION=3
        export network_list=`openstack network list | awk '{print $4}' | sed '/^$/d' | sed -n '1!p'`
        internal_networks=""
    
        #Iterate over all networks and fetch only the internal networks
        while read -r line; do
            network_type=`openstack network show $line | grep -i "router:external" | awk '{print $4}'`
            if [ "$network_type" == "Internal" ]; 
            then 
                #netId=$line
                #Comment out the below line and uncomment above line if you want to pass network name instead of network UUID
                netId=`openstack network show $line | grep -i "id" | awk '{print $4}' | head -n 1`
                export internal_networks=$netId,$internal_networks; 
            fi
        done <<< "$network_list"
    
        export internal_networks=`echo $internal_networks | tr , '\n' | sed '/^$/d'`
        #echo "$internal_networks"
    }
    
    export network_content="";
    if [ -z $Cliqr_nics_count ];
    then
            export num_nics="0"
    else
            export num_nics=$Cliqr_nics_count
        get_networks
        export selected_network_list=`echo "$internal_networks" 2>&1 | head -n $num_nics`
        for i in $(seq 1 $num_nics);
        do
                count=`expr $i - 1`;
                selected_network=`echo "$selected_network_list" | sed -n "$i"p`;
                export network_content="$network_content\"nicNetwork_$count\":\"$selected_network\",";
            export network_content="$network_content\"nicPrivateIpAllocation_$count\":\"DHCP\",";
            export network_content="$network_content\"nicAssignPublicIp_$count\":\"true\",";
        done;    
    fi
    
    content="{\"resource_name\":\"$capacity\",$network_content \"error\":\"\"}"
    print_ext_service_result "$content"
    OpenStack Sample Script Input
    Cliqr_Cloud_WindowsPasswordEscapeCharacters=
    Cliqr_deployment_Cloud_Account_Name=tiwa
    Cliqr_az1_total_memory=1195108
    HOSTNAME=20fa8a2eafd9
    Cliqr_Cloud_APIVersion=V3
    Cliqr_tier_type=CentOS
    Cliqr_Cloud_ConfigDrive=false
    TERM=xterm
    Cliqr_deployment_Cloud_TenantId=
    Cliqr_nova_total_memory=997461
    Cliqr_deployment_Cloud_InstanceNamingStrategy=Default
    Cliqr_deployment_Cloud_DomainId=default
    Cliqr_Cloud_DomainName=default
    Cliqr_bundle_path=
    scriptOrCommand=%REPO_ID_1%sumit/cm/getosresponse.sh
    Cliqr_deployment_Cloud_Account_Pwd=welcome2cliqr
    Cliqr_available_resources_count=2
    Cliqr_memory_threshold=90
    Cliqr_az1_utilized_cpu=90
    Cliqr_deployment_Cloud_NodeNameConfig=
    Cliqr_az1_utilized_memory=266764
    Cliqr_Cloud_TenantName=tiwa
    Cliqr_Cloud_InstanceIPAMStrategy=NoIPAM
    Cliqr_deployment_Cloud_Endpoint=http://ctlr.cisco.com:5000/v3/
    Cliqr_deployment_Cloud_NodesPerBatch=
    Cliqr_Cloud_Region=RegionOne
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    Cliqr_nics_count=1
    Cliqr_deployment_Cloud_Account_Id=OpenStack_Account
    repositories={"repositories":[{"@type":"STANDARD","id":1,"displayName":"MyRepo","description":"","type":"HTTP","ownerId":2,"encrypted":false,"deleted":false,"bundleStore":false,"hostname":"env.cliqrtech.com","port":80,"usernamePassword":{"username":"","password":""},"sslCredential":null}]}
    Cliqr_az1_total_cpu=336
    PWD=/
    Cliqr_auto_select_network=true
    Cliqr_deployment_Cloud_WindowsPasswordEscapeCharacters=
    Cliqr_Cloud_Account_Name=sumitiwa
    Cliqr_deployment_Cloud_APIVersion=V3
    Cliqr_nova_total_cpu=248
    JAVA_VERSION=1.8.0
    Cliqr_deployment_Cloud_ConfigDrive=false
    Cliqr_memory_ratio=1.5
    Cliqr_Cloud_TenantId=
    Cliqr_available_resources=az1,nova
    Cliqr_Cloud_InstanceNamingStrategy=Default
    Cliqr_Cloud_DomainId=default
    SHLVL=1
    HOME=/root
    Cliqr_script_enabled=true
    Cliqr_deployment_Cloud_DomainName=default
    Cliqr_cpu_ratio=8.0
    Cliqr_Cloud_Account_Pwd=welcome2cliqr
    CLIQR_EXECUTE_SCRIPT=%REPO_ID_1%sumit/cm/getosresponse.sh
    Cliqr_cpu_threshold=90
    Cliqr_Cloud=Openstack
    cliqrContainerExecuteScriptTimeout=9999
    Cliqr_Cloud_NodeNameConfig=
    Cliqr_nova_total_vms=126
    Cliqr_deployment_Cloud_TenantName=sumitiwa
    Cliqr_nova_utilized_cpu=199
    Cliqr_Cloud_Endpoint=http://ctlr.cisco.com:5000/v3/
    Cliqr_deployment_Cloud_InstanceIPAMStrategy=NoIPAM
    Cliqr_deployment_Cloud_Region=RegionOne
    Cliqr_Cloud_NodesPerBatch=
    Cliqr_az1_total_vms=54
    Cliqr_nova_utilized_memory=634880
    Cliqr_Cloud_Account_Id=OpenStack_Account_=/usr/bin/env
    OpenStack Sample Script Output
    {
       "resource_name":"nova",
       "nicNetwork_0":"0714d775-80fe-4758-91b7-d8bf151635d8",
       "nicPrivateIpAllocation_0":"DHCP",
       "nicAssignPublicIp_0":"true",
       "error":""
    }
  •  Script Variable Descriptions
    VariablesDescription
    Input variables
    Cliqr_Cloud_Account_NameCloud account user name used for logging in. For example, vCentre or OpenStack user name.

    Cliqr_Cloud_Account_Pwd

    Cloud account password used for logging in. For example,. vCentre password.

    Cliqr_available_resourcesComma separated list of cluster or zone names that have the required capacity.
    Cliqr_num_available_resources_countNumber of cluster or zone names that have the required capacity.
    Cliqr_$resourceName_total_cpuTotal number of CPUs in the clusters or zones, corresponding to clusters or zones that are defined by the $Cliqr_available_resources variable.
    Cliqr_$resourceName_utilized_cpu - utilisedNumber of CPUs that are utilized in the clusters or zones, corresponding to clusters or zones that are defined by the $Cliqr_available_resources variable.
    Cliqr_$resourceName_total_memoryTotal available memory in the clusters or zones, corresponding to clusters or zones that are defined by the $Cliqr_available_resources variable.
    Cliqr_$resourceName_utilized_memoryTotal utilized memory in the clusters or zones, corresponding to clusters or zones that are defined by the $Cliqr_available_resources variable.
    Cliqr_$resourceName_datacenterFor VMware only, the datacenter name of the given cluster,  corresponding to the Cliqr_available_resources variable.
    Cliqr_$resourceName_total_vmsNumber of already launched VMs  in the given cluster or zone, corresponding to the Cliqr_available_resources variable.
    Cliqr_allocated_tierNames

    Tiers on which the allocation of clusters or zones and networks complete. If the script should allocate the network based on previous tier networks, this variable can be used to obtain those tier names.

    Cliqr_cpu_thresholdCPU capacity threshold that has been configured on the Capacity Management settings page.
    Cliqr_memory_thresholdMemory threshold that has been configured on the Capacity Management settings page.
    Cliqr_cpu_ratioCPU capacity ratio that has been configured on the Capacity Management settings page.
    Cliqr_memory_ratioMemory capacity ratio that has been configured on the Capacity Management settings page.
    Cliqr_tier_typeService name of the tier as defined in the application profile. For example, apache, nginx, or tomcat.
    Cliqr_cloudType of the cloud (vmware or openstack)
    Network Specific Variables
    Cliqr_pending_request_networksComma separated list of reserved networks that are reserved for pending deployments.
    Cliqr_network_$networkName_IP_countNumber of IP addresses yet to be allocated from the reserved networks that are defined by the of the $Cliqr_pending_request_networks variable.
    Cliqr_simplified_network_nameName of the simplified network in the deployment environment, if simplified network is turned on.
    Cliqr_current_deployment_allocated_tiersComma separated list of tiers for which IP addresses are already allocated.
    Cliqr_tier_$tierName_networksComma separated list of networks allocated for the each tier of the application, corresponding to the $Cliqr_allocated_tierNames variable.
    Cliqr_nics_countNumber of NICs that the current tier requires.
    Output Variables (response should be an object)
    resource_nameName of the cluster or zone for this tier. The script must select one of the clusters or zones that the Cliqr_available_resources input variable defines.
     nicNetwork_$nicIndexNetwork name to be allocated for each NIC. The script must select one of networks that is accessible to the cluster or zone that is defined by the resource_name output variable..
    nicPrivateIpAllocation_$nicIndexFor OpenStack only, IP Allocation strategy for each NIC. Valid values are DHCP, IPAM_CALLOUT, STATIC_IP, or PREALLOCATE_IP.
    nicAssignPublicIp_$nicIndexFor OpenStack only, indicates whether to allocate a public IP address to the NIC. Valid values are true or false.

Error Messages and Causes

  • Message: Cluster IDC-Cluster-A does not have sufficient capacity. Please select another Cluster.
    Cause: The cluster selected that you selected during a deployment has exceeded the configured capacity thresholds.

  • Message: Auto Select Cluster is not possible, because all Clusters in IDC are unavailable. Select a different cloud or region to proceed.
    Cause: The Auto Select Cluster switch is turned on and all available clusters have been excluded or have exceeded the configured capacity  thresholds.

  • Message: Cluster IDC-Cluster-A is not available for deployment. Select another Cluster to proceed.
    Cause: The cluster that you selected has been excluded from deployment.

  • Message: All Clusters are excluded or not available for deployment.
    Cause: All clusters have been excluded from deployment.

  • Message: Cluster IDC-Cluster-A does not have sufficient capacity. Please select another Cluster.
    Cause: The cluster that you selected has exceeded its configured capacity threshold.

Use Case 1 – CloudCenter Selects the Least Utilized Cluster/Zone

  1. Turn on Capacity Management. Leave the Use Script for Cluster Auto Select switch at the default Off setting – in which case, the CloudCenter platform automatically selects a cluster for deployment.

  2. In the CloudCenter Environments or Deployment Environment Defaults page, assign a unique name.

    The Visibility (eye) icon allows the deployment owner to unlock or lock the deployment configurations so each user can change or not change the configured Cloud Setting defaults. See UI Behavior for additional context on icons.

    1. Select a Datacenter (or cloud) account.

    2. Change the Auto Select Cluster switch to On – in which case, the CloudCenter platform deploys on the cluster that has the lower vCPU utilization percentage. If clusters have the same vCPU utilization, the CloudCenter platform uses the cluster that has the lowest memory utilization. The vCPU utilization is assigned precedence over memory utilization to ensure efficiency and a balanced usage.

  3. Continue with the remaining configuration details that are described directly in the UI and save your configuration for the updates or additions to take effect.

Use Case 2 – User Selects the Cluster

  1. Turn on Capacity Management. Toggle the Use Script for Cluster Auto Select switch to Off to ensure that the user manually selects a cluster for deployment. The additional benefit of this setting is that the CloudCenter platform validates if the selected zone/cluster has sufficient capacity.

  2. In the CloudCenter Environments or Deployment Environment Defaults page, assign a unique name.
    The Visibility (eye) icon allows the deployment owner to unlock or lock the deployment configurations so each user can change or not change the configured Cloud Setting defaults. See UI Behavior for additional context on icons.

    1. Select a Datacenter (or cloud) account.

    2. Leave the Auto Select Cluster switch at the default Off setting.

  3. Continue with the remaining configuration details that are described directly in the UI and save your configuration for the updates or additions to take effect.

Use Case 3 – Auto Select Network Based on a Script

  1. Turn on Capacity Management. Toggle the Use Script for Cluster Auto Select switch to On to ensure that the CloudCenter platform uses the script to select the cluster and the network for a deployment.

    • VMware: Use your own script to select a cluster from within the group of clusters that have not crossed the threshold and not excluded. For example, you can create a .zip file from the above scripts (getresponse.sh and network.py) and use that .zip file in the Call Out Package. If the .zip is called cm.zip, and if you select the File in Package option for the Location dropdown, be sure to reference the getresponse.sh script in this field. For the Call Out Package field, be sure to reference the cm.zip file as it internally calls the network.py file for network data.

      This Call Out package usage is different from the Callout Scripts used for non-capacity related application deployments.


    • OpenStack: You have the ability to either select a single script file or use the Call Out Package to fetch the zone via the script – if you select the URL or Command option for the Location dropdown.

  2. In the CloudCenter Environments or Deployment Environment Defaults page, assign a unique name.

    Once the Use script for Network Selection switch is turned On the new Auto Select Network option shows up if the Auto Select Cluster setting is On!


    The Visibility (eye) icon allows the deployment owner to unlock or lock the deployment configurations so each user can change or not change the configured Cloud Setting defaults. See UI Behavior for additional context on icons.

    1. Select a Datacenter (or cloud) account.

      If users prefer to provide a preferred order, the CloudCenter platform accepts custom scripts to perform this assignment.

    2. Change the Auto Select Network switch to On – This switch is available if the Use Script for Network Auto Select switch is turned On in the Capacity Management configuration page.

      1. The Use Script for Network Auto Select switch is turned Off in the Capacity Management settings – you must explicitly specify the network to use and instruct the CloudCenter platform to manually select the network for deployment.

      2. The Use Script for Network Auto Select switch is turned On when you edit the Capacity MAnagement settings – you will see the Auto Select Network option, and if you turn it On, you must specify the number of NICs to use and the system determines the network. You should specify the number of NICs required as this variable is passed to the script to return the equivalent number of NICs.

  3. Continue with the remaining configuration details that are described directly in the UI and save your configuration for the updates or additions to take effect.

Use Case 4 – Simplified Networks

  1. In the CloudCenter Environments page, click New Environment to display the New Deployment Environment page.

  2. In the General Settings area, enter a name of the environment (for example, "SimplifiedAutoNetworkSelect").

  3. Turn on the Use Simplified Networks switch.

  4. Turn on Capacity Management.

    1. Toggle the Use Script for Cluster Auto Select switch to On to ensure that the CloudCenter platform uses the provided script for network selection.

    2. Toggle the Use Script for Network Auto Select switch to On to ensure that the CloudCenter platform automatically selects an efficient network for deployment.

    3. In the Simplified Networks section, toggle the switch to On to use Simplified Networks

    4. In the CloudCenter Environments or Deployment Environment Defaults page, assign a unique name AND toggle Leave Auto Select Cluster switch to On.

    5. Select a Cloud Tenant.

    6. You can create a simplified network with or without Auto Select Cluster option being On.

    7. Cloudcenter will pass the name of the simplified network to the script being used for network selection.

    8. Go back to the Cloud Settings section and select the required network from the Network Mappings dropdown. You will only see the ManualNetwork configuration in the dropdown list as you have not toggled Auto Select Zone to On.

    9. However, if you toggle Auto Select Zone to On, you will only see the AutoNetwork configureation in the dropdown list as only auto network selection is possible if the Auto Select Cluster setting is On.

    10. Continue with the remaining configuration details that are described directly in the UI and save your configuration for the updates or additions to take effect.



  • No labels
© 2017-2018 Cisco Systems, Inc. All rights reserved