Actions

You define the desired actions as sections inside the actions: section and give them unique label names. Those names will be referenced later in the policies: section of the template.

Actions are defined with a section name, type and properties.

section name

Example: scale_up:

Type

The type: specifies the type of policy action:

  • type: dcm.policy.action.ScaleUpGroup
  • type: dcm.policy.action.ScaleDownGroup

Properties

The following properties are supported on the actions:

  • changeType: - The actual action to perform.
  • ADD - Adds resources.
  • This is the default for the type dcm.policy.action.ScaleUpGroup.
  • REMOVE - Removes resources.
  • This is the default for the type dcm.policy.action.ScaleDownGroup.

Example: changeType: ADD

  • instances: - The number of resources to ADD or REMOVE.
  • The default for type dcm.policy.action.ScaleUpGroup is 1
  • The default for type dcm.policy.action.ScaleDownGroup is 1

Example: instances: 2

  • recordTask: - Determines whether or not the auto scaling action will be attempted even in situations where scaling would not occur because the number of resources is already at the minimum or maximum.
  • ALWAYS - 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).
  • The downside of this setting is that there could be “do nothing” scaling tasks activity logged and displayed on the Dell Cloud Manager console for the stack.
  • For instance a scale down operation is recorded even though the number of resources is already at the minInstances value.
  • For instance a scale up operation is recorded even though the number of resources is already at the maxInstances value.
  • The upside of this setting is that this is a good way to to determine if your policy’s minInstances and maxInstances are properly configured.
  • This is the default value for type dcm.policy.action.ScaleUpGroup.
  • RESOURCES_CHANGE - 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.
  • This is the default value for type dcm.policy.action.ScaleDownGroup.

Example: recordTask: ALWAYS

Tip

You might want to set the initial value of recordTask: to ALWAYS for both ScaleUpGroup and ScaleDownGroup and monitor the stacks scaling activity and tune the minInstances and maxInstances as appropriate. Then change the value to RESOURCES_CHANGE.

Example

    # 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.