Policy Example

    policies:
    # This scale up policy will perform a scale up when the last 3 periods of idle time reported are all < 20%
      scale_up_on_cpu:
        type: dcm.policy.types.BasicPolicy
        actions: [scale_up]                  # The scale_up action is defined in the actions: section of the template
        measurement: cpu_idle_time           # The cpu_idle_time label is defined in the measurements: section of the template
        criterion: less_than_20              # The less_than_20 is a label defined in the criteria: section of the template

    # This scale down policy will perform a scale down when the last 2 periods of idle time reported are all > 80%
      scale_down_on_cpu:
        type: dcm.policy.types.BasicPolicy
        actions: [scale_down]                # The scale_down action is defined in the actions: section of the template
        measurement: cpu_idle_time           # The cpu_idle_time label is defined in the measurements: section of the template
        criterion: more_than_80              # The more_than_80 is a label defined in the criteria: section of the template
    # Actions define the details of the various actions that could be taken.
    actions:
      scale_up:                              # The scale_up action label is referenced in the policy in the actions[] statement
        type: dcm.policy.action.ScaleUpGroup
        properties:
          instances: 1                       # The number of resources to scale up on a scale_up action
          changeType: ADD                    # Add resource(s) on a scale_up action
          recordTask: ALWAYS                 # Check to see if the scale up action would actually create a new resource, 
                                             # or a scale-down operation would actually destroy a resource before creating a task to perform the action.

      scale_down:                            # The scale_down action label is referenced in the policy in the actions[] statement
        type: dcm.policy.action.ScaleDownGroup
        properties:
          instances: 1                       # The number of resources to scale down on a scale_down action 
          changeType: REMOVE                 # Remove resource(s) on a scale_down action
          recordTask: RESOURCES_CHANGE       # Always attempt to perform a scale up or scale down action when the policy determines the actions should occur.
                                             # Do not check the minInstances and maxInstances limits beforehand.
    # Measurements define the "measurements" used to determine when to perform the actions
    measurements:
      cpu_idle_time:                         # The cpu_idle_time measurements label is referenced in the policy in a measurements: statement
      # The Dell Cloud Manager agent will collect and store the last 15 samples of cpu %idle time measured in 30-second intervals
        type: dcm.policy.measurement.CpuIdle
        properties:
          period: 30                         # Take a measurement every 30 seconds
          count: 15                          # Take 15 measurements
    # Criteria specify the "criteria" which is used along with the measurements to determine when to perform the actions
    criteria:
      less_than_20:                          # The less_than_20 criteria label is referenced in the policy in a criterion: statement
        type: dcm.policy.criteria.SeriesLessThan
        properties:
            count: 3                         # 3 consecutive periods 
            threshold: 20                    # Threshold is 20% 

      more_than_80:                          # The more_than_80 criteria label is referenced in the policy in a criterion: statement 
        type: dcm.policy.criteria.SeriesMoreThan
        properties:
            count: 2                         # 2 consecutive periods
            threshold: 80                    # Threshold is 80%

Policy displayed from the console

You can display the blueprint auto scaling policies from the Dell Cloud Manager console by selecting the Automation page and clicking on the policy names. In this blueprint the policies are named: scale_up_on_cpu and scale_down_on_cpu.

../../_images/console_auto_scaling_policy1.png

scale_up_on_cpu policy

../../_images/console_auto_scaling_policy2.png

scale_down_on_cpu policy

../../_images/console_auto_scaling_policy3.png