add unittest for basic heat api management and template creation functions
[bottlenecks.git] / utils / infra_setup / heat / tests / data / generated_templates / experiment_1.yaml
1 heat_template_version: 2013-05-23
2
3 description: >
4   HOT template to create a new neutron network plus a router to the public
5   network, and for deploying nine servers into the new network. The template also
6   assigns floating IP addresses to rubbos_control server so it is routable from the
7   public network.
8 parameters:
9   key_name:
10     type: string
11     description: Name of keypair to assign to servers
12     default: bottlenecks-key
13   image:
14     type: string
15     description: Name of image to use for servers
16     default: bottlenecks-trusty-server
17   flavor:
18     type: string
19     description: Flavor to use for servers
20     default: bottlenecks-flavor
21   public_net:
22     type: string
23     description: >
24       ID or name of public network for which floating IP addresses will be allocated
25     default: net04_ext
26   private_net_name:
27     type: string
28     description: Name of private network to be created
29     default: bottlenecks-private
30   private_net_cidr:
31     type: string
32     description: Private network address (CIDR notation)
33     default: "10.0.10.0/24"
34   private_net_gateway:
35     type: string
36     description: Private network gateway address
37     default: "10.0.10.1"
38   private_net_pool_start:
39     type: string
40     description: Start of private network IP address allocation pool
41     default: "10.0.10.2"
42   private_net_pool_end:
43     type: string
44     description: End of private network IP address allocation pool
45     default: "10.0.10.199"
46
47 resources:
48   private_net:
49     type: OS::Neutron::Net
50     properties:
51       name: { get_param: private_net_name }
52
53   private_subnet:
54     type: OS::Neutron::Subnet
55     properties:
56       network_id: { get_resource: private_net }
57       cidr: { get_param: private_net_cidr }
58       gateway_ip: { get_param: private_net_gateway }
59       allocation_pools:
60         - start: { get_param: private_net_pool_start }
61           end: { get_param: private_net_pool_end }
62
63   router:
64     type: OS::Neutron::Router
65     properties:
66       external_gateway_info:
67         network: { get_param: public_net }
68
69   router_interface:
70     type: OS::Neutron::RouterInterface
71     properties:
72       router_id: { get_resource: router }
73       subnet_id: { get_resource: private_subnet }
74
75   rubbos_control:
76     type: OS::Nova::Server
77     properties:
78       name: rubbos_control
79       image: { get_param: image }
80       flavor: { get_param: flavor }
81       key_name: { get_param: key_name }
82       networks:
83         - port: { get_resource: rubbos_control_port }
84       admin_user: ubuntu
85
86   rubbos_control_port:
87     type: OS::Neutron::Port
88     properties:
89       network_id: { get_resource: private_net }
90       fixed_ips:
91         - subnet_id: { get_resource: private_subnet }
92       security_groups: [{ get_resource: server_security_group }]
93
94   rubbos_control_floating_ip:
95     type: OS::Neutron::FloatingIP
96     properties:
97       floating_network: { get_param: public_net }
98       port_id: { get_resource: rubbos_control_port }
99
100   rubbos_httpd:
101     type: OS::Nova::Server
102     properties:
103       name: rubbos_httpd
104       image: { get_param: image }
105       flavor: { get_param: flavor }
106       key_name: { get_param: key_name }
107       networks:
108         - port: { get_resource: rubbos_httpd_port }
109       admin_user: ubuntu
110
111   rubbos_httpd_port:
112     type: OS::Neutron::Port
113     properties:
114       network_id: { get_resource: private_net }
115       fixed_ips:
116         - subnet_id: { get_resource: private_subnet }
117       security_groups: [{ get_resource: server_security_group }]
118
119   rubbos_mysql1:
120     type: OS::Nova::Server
121     properties:
122       name: rubbos_mysql1
123       image: { get_param: image }
124       flavor: { get_param: flavor }
125       key_name: { get_param: key_name }
126       networks:
127         - port: { get_resource: rubbos_mysql1_port }
128       admin_user: ubuntu
129
130   rubbos_mysql1_port:
131     type: OS::Neutron::Port
132     properties:
133       network_id: { get_resource: private_net }
134       fixed_ips:
135         - subnet_id: { get_resource: private_subnet }
136       security_groups: [{ get_resource: server_security_group }]
137
138   rubbos_tomcat1:
139     type: OS::Nova::Server
140     properties:
141       name: rubbos_tomcat1
142       image: { get_param: image }
143       flavor: { get_param: flavor }
144       key_name: { get_param: key_name }
145       networks:
146         - port: { get_resource: rubbos_tomcat1_port }
147       admin_user: ubuntu
148
149   rubbos_tomcat1_port:
150     type: OS::Neutron::Port
151     properties:
152       network_id: { get_resource: private_net }
153       fixed_ips:
154         - subnet_id: { get_resource: private_subnet }
155       security_groups: [{ get_resource: server_security_group }]
156
157   rubbos_client1:
158     type: OS::Nova::Server
159     properties:
160       name: rubbos_client1
161       image: { get_param: image }
162       flavor: { get_param: flavor }
163       key_name: { get_param: key_name }
164       networks:
165         - port: { get_resource: rubbos_client1_port }
166       admin_user: ubuntu
167
168   rubbos_client1_port:
169     type: OS::Neutron::Port
170     properties:
171       network_id: { get_resource: private_net }
172       fixed_ips:
173         - subnet_id: { get_resource: private_subnet }
174       security_groups: [{ get_resource: server_security_group }]
175
176   rubbos_client2:
177     type: OS::Nova::Server
178     properties:
179       name: rubbos_client2
180       image: { get_param: image }
181       flavor: { get_param: flavor }
182       key_name: { get_param: key_name }
183       networks:
184         - port: { get_resource: rubbos_client2_port }
185       admin_user: ubuntu
186
187   rubbos_client2_port:
188     type: OS::Neutron::Port
189     properties:
190       network_id: { get_resource: private_net }
191       fixed_ips:
192         - subnet_id: { get_resource: private_subnet }
193       security_groups: [{ get_resource: server_security_group }]
194
195   rubbos_client3:
196     type: OS::Nova::Server
197     properties:
198       name: rubbos_client3
199       image: { get_param: image }
200       flavor: { get_param: flavor }
201       key_name: { get_param: key_name }
202       networks:
203         - port: { get_resource: rubbos_client3_port }
204       admin_user: ubuntu
205
206   rubbos_client3_port:
207     type: OS::Neutron::Port
208     properties:
209       network_id: { get_resource: private_net }
210       fixed_ips:
211         - subnet_id: { get_resource: private_subnet }
212       security_groups: [{ get_resource: server_security_group }]
213
214   rubbos_client4:
215     type: OS::Nova::Server
216     properties:
217       name: rubbos_client4
218       image: { get_param: image }
219       flavor: { get_param: flavor }
220       key_name: { get_param: key_name }
221       networks:
222         - port: { get_resource: rubbos_client4_port }
223       admin_user: ubuntu
224
225   rubbos_client4_port:
226     type: OS::Neutron::Port
227     properties:
228       network_id: { get_resource: private_net }
229       fixed_ips:
230         - subnet_id: { get_resource: private_subnet }
231       security_groups: [{ get_resource: server_security_group }]
232
233   rubbos_benchmark:
234     type: OS::Nova::Server
235     properties:
236       name: rubbos_benchmark
237       image: { get_param: image }
238       flavor: { get_param: flavor }
239       key_name: { get_param: key_name }
240       networks:
241         - port: { get_resource: rubbos_benchmark_port }
242       admin_user: ubuntu
243
244   rubbos_benchmark_port:
245     type: OS::Neutron::Port
246     properties:
247       network_id: { get_resource: private_net }
248       fixed_ips:
249         - subnet_id: { get_resource: private_subnet }
250       security_groups: [{ get_resource: server_security_group }]
251
252   server_security_group:
253     type: OS::Neutron::SecurityGroup
254     properties:
255       description: Rubbos group for servers access.
256       name: rubbos-security-group
257       rules: [
258         {remote_ip_prefix: 0.0.0.0/0,
259         protocol: tcp,
260         port_range_min: 1,
261         port_range_max: 65535},
262         {remote_ip_prefix: 0.0.0.0/0,
263         protocol: udp,
264         port_range_min: 1,
265         port_range_max: 65535},
266         {remote_ip_prefix: 0.0.0.0/0,
267         protocol: icmp}]
268
269 outputs:
270   rubbos_control_private_ip:
271     description: IP address of rubbos_control in private network
272     value: { get_attr: [ rubbos_control, first_address ] }
273   rubbos_control_public_ip:
274     description: Floating IP address of rubbos_control in public network
275     value: { get_attr: [ rubbos_control_floating_ip, floating_ip_address ] }
276   rubbos_httpd_private_ip:
277     description: IP address of rubbos_httpd in private network
278     value: { get_attr: [ rubbos_httpd, first_address ] }
279   rubbos_mysql1_private_ip:
280     description: IP address of rubbos_mysql1 in private network
281     value: { get_attr: [ rubbos_mysql1, first_address ] }
282   rubbos_tomcat1_private_ip:
283     description: IP address of rubbos_tomcat1 in private network
284     value: { get_attr: [ rubbos_tomcat1, first_address ] }
285   rubbos_client1_private_ip:
286     description: IP address of rubbos_client1 in private network
287     value: { get_attr: [ rubbos_client1, first_address ] }
288   rubbos_client2_private_ip:
289     description: IP address of rubbos_client2 in private network
290     value: { get_attr: [ rubbos_client2, first_address ] }
291   rubbos_client3_private_ip:
292     description: IP address of rubbos_client3 in private network
293     value: { get_attr: [ rubbos_client3, first_address ] }
294   rubbos_client4_private_ip:
295     description: IP address of rubbos_client4 in private network
296     value: { get_attr: [ rubbos_client4, first_address ] }
297   rubbos_benchmark_private_ip:
298     description: IP address of rubbos_benchmark in private network
299     value: { get_attr: [ rubbos_benchmark, first_address ] }
300