Policies

policies enable you to configure reusable behavior by referencing the groups for which a policy applies.

Declaration

policies:
  my_scaling_policy:
    type: cloudify.policies.scaling
    properties:
      ...
    targets: ...

Schema

Keyname Required Type Description
type yes string The policy type.
properties no dict The specific policy properties. The properties schema is defined by the policy type.
targets yes list A list of group names. The policy is applied on the groups specified in this list.

cloudify.policies.scaling Policy Schema

Keyname Required Type Default Description
default_instances no integer 1 The number of instances the groups referenced by this policy will have.
min_instances no integer 0 The minimum number of permitted group instances. (Not enforced by the scale workflow.)
max_instances no integer UNBOUNDED The maximum number of permitted group instances. (Not enforced by the scale workflow.)

Example

node_templates:
  vm: ...
  ip: ...

groups:
  vm_and_ip:
    members: [vm, ip]

policies:
  scaling_policy1:
    type: cloudify.policies.scaling
    properties:
      default_instances: 2
    targets: [vm_and_ip]