Define Resource Placement

Overview

The Workload Manager has ability to deploy enterprise applications over public, private, or hybrid clouds by configuring user-specified cloud settings in the Workload Manager UI > Environments  > Edit Deployment  Environment > Define Default Cloud Settings page.

The Resource Placement integration features extends the Workload Manager capabilities by allowing users to define cloud settings based on third-party infrastructure tools or quota management tools using automated scripts instead of manually-selected settings.

You can configure these integrations using an automation callout script.

Resource Placement Flow

To use the resource placement script, specify a URL to the script that you want to run. The resource placement script runs inside a Docker container in the CloudCenter Suite cluster (or Cloud Remote, if installed). You cannot pass in any custom values. Your script must output the values specified in this section. 

The Resource Placement feature is only supported for AWS, VMware, and OpenStack clouds.

This script is executed for each Node launch (called for each VM). For example, if you have a single-tier application with the minimum number of nodes set to 2, then this script is executed twice – 1 tier x 2 nodes = 2 executions. However, the Workload Manager passes variables such as service types which allows you to decide where to place it in the VM.

  1. Toggle the switch to YES in the Resource Placement section, as shown in the following screenshot.

    If this feature is enabled, the Cloud Settings form in the Deployment Environments > Cloud Defaults page will be disabled.

  2. Identify the script location and the specific script for the Resource Placement Configuration.

  3. Be aware of the customizable options for AWS, OpenStack, and VMware:

    •  AWS Options
      • The following table describes AWS-specific cloud settings for the resource placement callout script.

        AWS SettingDescription
        vpcIdThe VPC for the node to be deployed.
        subnetIdThe subnet where the node should be deployed in the above VPC.
        securityGroupListThe security groups where the node should be associated in the above VPC.
        vmTagsListThe AWS tags to associate with the node.
        assignPublicIpIdentifies if the node should be assigned with a public IP.
        nodeInfoCustomizable node Information detail that is displayed in the Workload Manager UI Job Details Page for each node. If not provided, the Workload Manager generates the default nodeInfo based on the provided values.
      • Sample Amazon Resource Placement Callout Script
        #!/bin/bash
        
        . /utils.sh
        
        content="{\"vpcId\":\"vpc-1234abcd\",
        \"subnetId\":\"subnet-1234abcd\", \"securityGroupList\":\"sg-1234abcd\",
        \"vmTagsList\":\"Name:MyVm,PayProfile:Dev,BU:Engineering,User:DemoUser\",
        \"assignPublicIp\":\"true\", \"nodeInfo\":\"VpcID:
        vpc-1234abcd, subnetId: subnet-1234abcd,securityGroupList:sg-1234abcd \"}"
        
        print_ext_service_result "$content"


    •  OpenStack Options
      • The following table describes OpenStack-specific cloud settings for the resource placement callout script.

        OpenStack SettingDescription
        TenantNameThe name of OpenStack tenant.
        zoneThe availability zone as described in Availability Sets and Zones > OpenStack.
        nicInfoThe OpenStack network interface information.
        privateIPAllocationModeThe private IP allocation strategy (DHCP or PREALLOCATE_IP).
        networkIDThe OpenStack Network ID.
        publicIpAllocateA flag to allocate the public IP address (Boolean: true/false).
        nodeInfoCustomizable node Information detail that is displayed in the Workload Manager UI Job Details Page for each node. If not provided, the Workload Manager generates the default nodeInfo.
      • Sample OpenStack Resource Placement Callout Script
        #!/bin/bash
        . /utils.sh
        content="{\"TenantName\":\"sample\",\"zone\":\"nova\",
        \"nicInfo\":\"
        [{\\\"privateIPAllocationMode\\\":\\\"DHCP\\\",\\\"networkID\\\":\\\"19f56fa2-babc-4q22-9q9b-20c4e3243b85\\\",\\\"publicIpAllocate\\\":true},
        {\\\"privateIPAllocationMode\\\":\\\"PREALLOCATE_IP\\\",\\\"networkID\\\":\\\"19f56fa2-babc-4q22-9q9b-20c4e3243b85\\\",\\\"publicIpAllocate\\\":true},
        {\\\"privateIPAllocationMode\\\":\\\"PREALLOCATE_IP\\\",\\\"networkID\\\":\\\"19f56fa2-babc-4q22-9q9b-20c4e3243b85\\\",\\\"publicIpAllocate\\\":false}]
        \",
        \"nodeInfo\":\"zone:nova, TenantName:sample\"}"
        print_ext_service_result "$content"
    •  vCenter Options
      • The following table describes vCenter-specific cloud settings for the resource placement callout script:

        VMware SettingDescription
        vmTagsListThe AWS tags to associate with the node.
        UserDataCenterNameThe datacenter to deploy the node.
        UserClusterNameThe cluster to deploy the node in the above datacenter.
        UserResourcePoolNameThe resource pool used to deploy the node.
        UserDatastoreClusterThe datastore cluster to associate with the node.
        UserFolderNameThe user folder used for the node deployment.
        RootDiskResizable

        Identifies if the root disk is resizable (Boolean: true/false).

        The Root Disk setting is available as a separate field and you can only select the Root Disk size if the Cloning Mode is set to Full Clone (Enable Full Clone = Selected). See VMware Network Settings for additional context.

        FullCloneIdentifies if the node to be launched is with full clone (Boolean: true/false).
        SystemFolderNameThe folder from which the template is selected.
        networkList

        The list of networks to attach to the node. The following table describes the format that various network types require. See vCenter Configurations > Resource Placement for additional context.

        VMware NetworkFormat Required
        DVS and ACI networks

        DistributedPortGroupName (DistributedSwitchName)

        For Example:
        DistributedPortGroupName101 (DistributedSwitch2)

        Standard Network

        NetworkName

        For Example:
        NetworkName101

        UserHostThe ESX host to which the node is launched.
        nodeInfoCustomizable node Information detail that is displayed in the Workload Manager UI Job Details Page for each node. If not provided, the Workload Manager generates the default nodeInfo based on the provided values.
      • Sample VMware Resource Placement Callout Script
        #!/bin/bash
        
        . /utils.sh
        
        content="{\"UserDataCenterName\":\"SDC-01\",\"UserClusterName\":\"wm-Cluster\",\"UserResourcePoolName\":\"\",\"vmTagsList\":\"cloud:center\",\"UserDatastoreCluster\":\"wm-DS-Cluster\",
        \"RootFolderName\":\"vm\",
        \"UserFolderName\":\"CliqrUser-2\",
        \"RootDiskResizable\":\"false\",
        \"FullClone\":\"true\",
        \"SystemFolderName\":\"CliqrTemplates\",
        \"networkList\":\"VLAN-ENG-NET (CC-DSwitch)\",
        \"UserHost\":\"sc2-esx02.abc.private\",\"nodeInfo\":\"UserDataCenterName:
        SDC-01, UserClusterName: wm-Cluster,
        UserDatastoreCluster:wm-DS-Cluster, networkList VLAN-ENG-NET
        (CC-DSwitch)\"}"
        
        print_ext_service_result "$content"
        
      • Sample CWOM/Turbonomic Integration Script for Resource Placement for Vmware
        #!/bin/bash
        
        . /utils.sh
         
        export CWOM_URL="<VM_TURBO_HOST>"
        export CWOM_USER="<User>"
        export CWOM_PASSWORD="<pwd>"
        export CWOM_RESOURCE="http://$CWOM_USER:$CWOM_PASSWORD@$CWOM_URL"
        . /utils.sh
        
        #pre fixing a datacenter in the sample
        if [ -z $dcName ];
        then
            export dcName="SCL2"
        fi
        
        export vmTagsList="Name:myVm"
        export UserDataCenterName="$dcName"
        export UserClusterName="CliQr"
        export UserResourcePoolName="Eng"
        export RootFolderName="vm"
        export UserFolderName="CliqrUser-id"
        export RootDiskResizable="false"
        export FullClone="true"
        export SystemFolderName="CliqrTemplates"
        export networkList="10-DEV (DSwitch)"
        export instanceNameVar=`echo CliqrTier_"$eNV_cliqrAppTierName"_instanceType`
        eval instanceName='$'$instanceNameVar
        
        getProfileId() {
            result=`curl -s -X GET $CWOM_RESOURCE/cwom/api/templates 
        | grep $instanceName`
            export profileId=`echo $result | awk -F uuid=\" '{printf $2}' | awk -F \" '{printf $1}'`
        }
        getProfileId
        
        getDatacenterId() {
                DATACENTER=$1
            result=`curl -s -X GET
        $CWOM_RESOURCE/cwom/api/markets/Market/entities | grep
        \"DataCenter\" | grep $DATACENTER`
            export dcId=`echo $result | awk -F
        uuid=\" '{printf $2}' | awk -F \" '{printf $1}'`
        }
        getDatacenterId "$dcName"
        
        
        #echo "dcId=$dcId"
        
        getReservation() {
            reservationName="reserve-$RANDOM"
            export reserveId=`curl -s -X POST
        $CWOM_RESOURCE/cwom/api/reservations -d
        "reservationName=$reservationName&templateName=$profileId&count=1&segmentationUuid[]=$dcId"`
        }
        getReservation
        sleep 3
        
        getHostAndDS() {
            result=`curl -s -X GET
        $CWOM_RESOURCE/cwom/api/deployitems/$reserveId`
            export datastore=`echo $result |  awk -F datastore=\" '{printf $2}' | awk -F \" '{printf $1}'`-cluster
            export host=`echo $result |  awk -F host=\" '{printf $2}' | awk 
        -F
        \" '{printf $1}'`     
        }
        getHostAndDS
        export UserDatastoreCluster="$datastore" 
        export UserHost="$host"
        
        content="{\"UserDataCenterName\":\"$dcName\",\"UserClusterName\":\"$UserClusterName\",\"UserResourcePoolName\":\"$UserResourcePoolName\",\"vmTagsList\":\"$vmTagsList\",\"UserDatastoreCluster\":\"$UserDatastoreCluster\",
        \"RootFolderName\":\"$RootFolderName\",
        \"UserFolderName\":\"$UserFolderName\", \"RootDiskResizable\":\"$RootDiskResizable\",
        \"FullClone\":\"$FullClone\", 
        \"SystemFolderName\":\"$SystemFolderName\",
        \"networkList\":\"$networkList\", \"UserHost\":\"$UserHost\",\"nodeInfo\":\"UserDataCenterName:
        $dcName, UserClusterName: $UserClusterName, UserDatastoreCluster:
        $UserDatastoreCluster, networkList: $networkList \"}"
        
        print_ext_service_result "$content"
    •  vCenter Media Related Attributes

      You can specify media attributes for deployed VMs in vCenter for the following applications:

      1. Single Root I/O Virtualization (SR-IOV)
      2. PCI passthrough
      3. Shared PCI passthrough(vGPU)
      4. Available USB license dongles
      5. CPU pinning(CPU affinity)

      The following are sample callout scripts.

      SR-IOV example
      #!/bin/bash
      
      . /utils.sh
      content="{\"UserDataCenterName\":\"MediaPod\",\"UserClusterName\":\"GPU-Enabled\",\"UserResourcePoolName\":\"\",\"vmTagsList\":\"\",\"UserDatastoreCluster\":\"MP-NFS-1_Shared\",\"RootFolderName\":\"\",\"UserFolderName\":\"/CloudCenter/CC4.10.0/Deployments\",\"RootDiskResizable\":\"false\",\"FullClone\":\"true\", \"VmRelocationEnabled\":\"true\", \"LocalDataStoreEnabled\":\"flase\",
      \"SystemFolderName\":\"\",\"networkList\":\"VM Network\",\"UserHost\":\"\",
      \"mediaInfo\":[{\"networkId\":\"dv_VL041_CC-Deploy-1 (dvSwitch)\", \"type\": \"SRIOV\", \"pciAddress\": \"0000:d8:00.0\", \"model\":\"\"}],
      \"nodeInfo\":\"UserDataCenterName:MediaPod, UserClusterName: GPU-Enabled,UserDatastoreCluster:, networkList VM Network\"}"
      
      print_ext_service_result "$content"
      
      vGPU and CPU pinning example
      #!/bin/bash
      
      . /utils.sh
      content="{\"UserDataCenterName\":\"MediaPod\",\"UserClusterName\":\"GPU-Enabled\",\"UserResourcePoolName\":\"\",\"vmTagsList\":\"\",\"UserDatastoreCluster\":\"MP-NFS-1_Shared\",\"RootFolderName\":\"\",\"UserFolderName\":\"/CloudCenter/CC4.10.0/Deployments\",\"RootDiskResizable\":\"false\",\"FullClone\":\"true\", \"VmRelocationEnabled\":\"true\", \"LocalDataStoreEnabled\":\"flase\",
      \"SystemFolderName\":\"\",
      \"networkList\":\"VM Network\",\"UserHost\":\"\", \"CpuAffinitySet\":\"2, 4- 6 \",
      \"mediaInfo\":[{\"type\": \"PCI_SHARED\", \"vgpu\": \"\"}],
      \"nodeInfo\":\"UserDataCenterName:MediaPod, UserClusterName: GPU-Enabled,UserDatastoreCluster:, networkList VM Network\"}"
      
      print_ext_service_result "$content"
      
      xxx example
      #!/bin/bash
      
      . /utils.sh
      content="{\"UserDataCenterName\":\"MediaPod\",\"UserClusterName\":\"GPU-Enabled\",\"UserResourcePoolName\":\"\",\"vmTagsList\":\"\",\"UserDatastoreCluster\":\"MP-NFS-1_Shared\",\"RootFolderName\":\"\",\"UserFolderName\":\"/CloudCenter/CC4.10.0/Deployments\",\"RootDiskResizable\":\"false\",\"FullClone\":\"true\", \"VmRelocationEnabled\":\"true\", \"LocalDataStoreEnabled\":\"flase\",
      \"SystemFolderName\":\"\",
      \"networkList\":\"VM Network\",\"UserHost\":\"\", \"CpuAffinitySet\":\"2, 4- 6 \",
      \"mediaInfo\":[{\"type\": \"PCI\", \"pciAddress\": \"0000:d8:00.3\", \"model\":\"MT28800 Family [ConnectX-5 Ex Virtual Function]\",\"systemId\":\"5c50c62d-def1-5e0a-8f84-0025b50201af\"}],
      \"nodeInfo\":\"UserDataCenterName:MediaPod, UserClusterName: GPU-Enabled,UserDatastoreCluster:, networkList VM Network\"}"
      
      print_ext_service_result "$content"
      USB device and CPU pinning example
      #!/bin/bash
      
      . /utils.sh
      content="{\"UserDataCenterName\":\"MediaPod\",\"UserClusterName\":\"GPU-Enabled\",\"UserResourcePoolName\":\"\",\"vmTagsList\":\"\",\"UserDatastoreCluster\":\"MP-NFS-1_Shared\",\"RootFolderName\":\"\",\"UserFolderName\":\"/CloudCenter/CC4.10.0/Deployments\",\"RootDiskResizable\":\"false\",\"FullClone\":\"true\", \"VmRelocationEnabled\":\"true\", \"LocalDataStoreEnabled\":\"flase\",
      \"SystemFolderName\":\"\",
      \"networkList\":\"VM Network\",\"UserHost\":\"\", \"CpuAffinitySet\":\"2, 4- 6 \",
      \"mediaInfo\":[{\"type\": \"USB\",\"model\":\"path:0/1/1\"}],
      \"nodeInfo\":\"UserDataCenterName:MediaPod, UserClusterName: GPU-Enabled,UserDatastoreCluster:, networkList VM Network\"}"
      
      print_ext_service_result "$content"



  4. The following table describes available environment variables for the Resource Placement script.

    Environment VariableDescriptionCloud
    eNV_cliqrAppTierNameThe tier name.All clouds, except Container Clouds and Cisco UCSD.
    CliqrTier_<tierName>_instanceTypeThe Instance Type of the tier.
    eNV_imageNameThe image Name (for example: CentOS 6.x).
    serviceNameThe service name to identify settings like private subnet for a database service.
    eNV_parentJobName

    The unique Job Name for the deployment.

    CliqrCloudAccountIdThe cloud account ID.
    CliqrCloudAccountPwdThe cloud account password (for AWS, access key).
    CliqrCloudAccountNameThe cloud account username (for AWS, account email ID).
    Cloud_Setting_CloudFamilyThe cloud family of the region in the Workload Manager.
    CliqrCloud_AccessSecretKeyThe AWS account secret keyAWS

    CliqrCloud_ServiceUrl

    The SDK URL for VMware.VMware

    CliqrCloud_DomainId

    The default OpenStack domain ID.OpenStack

    CliqrCloud_Endpoint

    The OpenStack Keystone authentication endpoint.

    CliqrCloud_TenantName

    The OpenStack default tenant name.

    CliqrCloud_DomainName

    The OpenStack default domain name.

    CliqrCloudAccountPwd

    The OpenStack password.

    CliqrCloud_Region

    The OpenStack region.

    CliqrCloudAccountName

    The OpenStack user name for this account.

    CliqrCloud_TenantId

    The OpenStack default tenant ID.
  • No labels
Terms & Conditions Privacy Statement Cookies Trademarks