summaryrefslogtreecommitdiff
path: root/hot/autohealing/autohealing_group.yaml
blob: 069a7e84d7c3905ba3265de4c81e8731ef206c0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
heat_template_version: 2017-02-24

description: >
  A stack containing an Autoscaling Group whose members automatically heal
  themselves if they are stopped, deleted, or go into an error state, using an
  Aodh alarm delivered to a Zaqar queue that triggers a Mistral workflow to
  replace the stopped server. Note that this requires event alarms to be
  enabled in Aodh, following the instructions at
  http://docs.openstack.org/developer/aodh/event-alarm.html - specifically by
  adding the publisher "notifier://?topic=alarm.all" in
  /etc/ceilometer/event_pipeline.yaml.

parameters:
  flavor:
    type: string
    description: Flavor for the instances to be created
    default: cirros256
    constraints:
      - custom_constraint: nova.flavor
        description: Must be a flavor known to Nova
  image:
    type: string
    description: >
      Name or ID of the image to use for the instances.
    default: cirros-0.3.4-x86_64-uec
    constraints:
      - custom_constraint: glance.image
        description: Must identify an image known to Glance
  network:
    type: string
    description: The network for the VM
    default: private
  port:
    type: number
    description: The port to reply to requests on
    default: 8080

resources:
  servers:
    type: OS::Heat::AutoScalingGroup
    properties:
      resource:
        type: autohealing_server.yaml
        properties:
          flavor: {get_param: flavor}
          image: {get_param: image}
          network: {get_param: network}
          port: {get_param: port}
          root_stack_id: {get_param: "OS::stack_id"}
      min_size: 1
      desired_capacity: 2
      max_size: 4

outputs:
  server_ids:
    description: A list of the current server UUIDs
    value: {get_attr: [servers, refs]}
  ip_addresses:
    description: A list of server IP addresses
    value: {get_attr: [servers, outputs_list, first_address]}