92bebe5c38c24ef209e6919a317212b2e451539e
[sdc/sdc-distribution-client.git] /
1 tosca_definitions_version: tosca_simple_yaml_1_0
2
3 description: >
4   Template for deploying servers based on policies.
5
6 imports:
7   - custom_definitions.yaml
8
9 topology_template:
10   node_templates:
11     my_server_1:
12       type: tosca.nodes.Compute
13       capabilities:
14         # Host container properties
15         host:
16          properties:
17            num_cpus: 2
18            disk_size: 10 GB
19            mem_size: 512 MB
20         # Guest Operating System properties
21         os:
22           properties:
23             # host Operating System image properties
24             architecture: x86_64
25             type: Linux
26             distribution: RHEL
27             version: 6.5
28
29     my_server_2:
30       type: tosca.nodes.Compute
31       capabilities:
32         host:
33           properties:
34             disk_size: 10 GB
35             num_cpus: 2
36             mem_size: 4096 MB
37         os:
38           properties:
39             architecture: x86_64
40             type: Linux
41             distribution: Ubuntu
42             version: 14.04
43
44   groups:
45     webserver_group:
46       members: [ my_server_1, my_server_2 ]
47       type: tosca.groups.Root
48       metadata: { user1: 1008, user2: 1002 }
49
50
51   policies:
52     - my_compute_placement_policy:
53         type: tosca.policies.Placement
54         description: Apply placement policy to servers
55         metadata: { user1: 1001, user2: 1002 }
56         targets: [ my_server_1, my_server_2 ]
57         triggers:
58            resize_compute:
59              description: trigger
60              event_type: tosca.events.resource.utilization
61              schedule:
62                start_time: "2015-05-07T07:00:00Z"
63                end_time: "2015-06-07T07:00:00Z"
64              target_filter:
65                node: master-container
66                requirement: host
67                capability: Container
68              condition:
69                constraint: utilization greater_than 50%
70                period: 60
71                evaluations: 1
72                method: average
73              action:
74                resize: # Operation name
75                 inputs:
76                  strategy: LEAST_USED
77                  implementation: Senlin.webhook()
78     - my_groups_placement:
79         type: mycompany.mytypes.myScalingPolicy
80         targets: [ webserver_group ]
81         description: my company scaling policy
82         metadata:
83           user1: 1001
84           user2: 1003
85