8233356c59d28a4487ce4f3b5626e4d1793f1771
[bottlenecks.git] / utils / infra_setup / heat_template / bottlenecks_rubbos_hot.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
85   rubbos_control_port:
86     type: OS::Neutron::Port
87     properties:
88       network_id: { get_resource: private_net }
89       fixed_ips:
90         - subnet_id: { get_resource: private_subnet }
91
92   rubbos_control_floating_ip:
93     type: OS::Neutron::FloatingIP
94     properties:
95       floating_network: { get_param: public_net }
96       port_id: { get_resource: rubbos_control_port }
97
98   rubbos_httpd:
99     type: OS::Nova::Server
100     properties:
101       name: rubbos_httpd
102       image: { get_param: image }
103       flavor: { get_param: flavor }
104       key_name: { get_param: key_name }
105       networks:
106         - port: { get_resource: rubbos_httpd_port }
107
108   rubbos_httpd_port:
109     type: OS::Neutron::Port
110     properties:
111       network_id: { get_resource: private_net }
112       fixed_ips:
113         - subnet_id: { get_resource: private_subnet }
114
115   rubbos_mysql1:
116     type: OS::Nova::Server
117     properties:
118       name: rubbos_mysql1
119       image: { get_param: image }
120       flavor: { get_param: flavor }
121       key_name: { get_param: key_name }
122       networks:
123         - port: { get_resource: rubbos_mysql1_port }
124
125   rubbos_mysql1_port:
126     type: OS::Neutron::Port
127     properties:
128       network_id: { get_resource: private_net }
129       fixed_ips:
130         - subnet_id: { get_resource: private_subnet }
131
132   rubbos_tomcat1:
133     type: OS::Nova::Server
134     properties:
135       name: rubbos_tomcat1
136       image: { get_param: image }
137       flavor: { get_param: flavor }
138       key_name: { get_param: key_name }
139       networks:
140         - port: { get_resource: rubbos_tomcat1_port }
141
142   rubbos_tomcat1_port:
143     type: OS::Neutron::Port
144     properties:
145       network_id: { get_resource: private_net }
146       fixed_ips:
147         - subnet_id: { get_resource: private_subnet }
148
149   rubbos_client1:
150     type: OS::Nova::Server
151     properties:
152       name: rubbos_client1
153       image: { get_param: image }
154       flavor: { get_param: flavor }
155       key_name: { get_param: key_name }
156       networks:
157         - port: { get_resource: rubbos_client1_port }
158
159   rubbos_client1_port:
160     type: OS::Neutron::Port
161     properties:
162       network_id: { get_resource: private_net }
163       fixed_ips:
164         - subnet_id: { get_resource: private_subnet }
165
166   rubbos_client2:
167     type: OS::Nova::Server
168     properties:
169       name: rubbos_client2
170       image: { get_param: image }
171       flavor: { get_param: flavor }
172       key_name: { get_param: key_name }
173       networks:
174         - port: { get_resource: rubbos_client2_port }
175
176   rubbos_client2_port:
177     type: OS::Neutron::Port
178     properties:
179       network_id: { get_resource: private_net }
180       fixed_ips:
181         - subnet_id: { get_resource: private_subnet }
182
183   rubbos_client3:
184     type: OS::Nova::Server
185     properties:
186       name: rubbos_client3
187       image: { get_param: image }
188       flavor: { get_param: flavor }
189       key_name: { get_param: key_name }
190       networks:
191         - port: { get_resource: rubbos_client3_port }
192
193   rubbos_client3_port:
194     type: OS::Neutron::Port
195     properties:
196       network_id: { get_resource: private_net }
197       fixed_ips:
198         - subnet_id: { get_resource: private_subnet }
199
200   rubbos_client4:
201     type: OS::Nova::Server
202     properties:
203       name: rubbos_client4
204       image: { get_param: image }
205       flavor: { get_param: flavor }
206       key_name: { get_param: key_name }
207       networks:
208         - port: { get_resource: rubbos_client4_port }
209
210   rubbos_client4_port:
211     type: OS::Neutron::Port
212     properties:
213       network_id: { get_resource: private_net }
214       fixed_ips:
215         - subnet_id: { get_resource: private_subnet }
216
217   rubbos_benchmark:
218     type: OS::Nova::Server
219     properties:
220       name: rubbos_benchmark
221       image: { get_param: image }
222       flavor: { get_param: flavor }
223       key_name: { get_param: key_name }
224       networks:
225         - port: { get_resource: rubbos_benchmark_port }
226
227   rubbos_benchmark_port:
228     type: OS::Neutron::Port
229     properties:
230       network_id: { get_resource: private_net }
231       fixed_ips:
232         - subnet_id: { get_resource: private_subnet }
233
234 outputs:
235   rubbos_control_private_ip:
236     description: IP address of rubbos_control in private network
237     value: { get_attr: [ rubbos_control, first_address ] }
238   rubbos_control_public_ip:
239     description: Floating IP address of rubbos_control in public network
240     value: { get_attr: [ rubbos_control_floating_ip, floating_ip_address ] }
241   rubbos_httpd_private_ip:
242     description: IP address of rubbos_httpd in private network
243     value: { get_attr: [ rubbos_httpd, first_address ] }
244   rubbos_mysql1_private_ip:
245     description: IP address of rubbos_mysql1 in private network
246     value: { get_attr: [ rubbos_mysql1, first_address ] }
247   rubbos_tomcat1_private_ip:
248     description: IP address of rubbos_tomcat1 in private network
249     value: { get_attr: [ rubbos_tomcat1, first_address ] }
250   rubbos_client1_private_ip:
251     description: IP address of rubbos_client1 in private network
252     value: { get_attr: [ rubbos_client1, first_address ] }
253   rubbos_client2_private_ip:
254     description: IP address of rubbos_client2 in private network
255     value: { get_attr: [ rubbos_client2, first_address ] }
256   rubbos_client3_private_ip:
257     description: IP address of rubbos_client3 in private network
258     value: { get_attr: [ rubbos_client3, first_address ] }
259   rubbos_client4_private_ip:
260     description: IP address of rubbos_client4 in private network
261     value: { get_attr: [ rubbos_client4, first_address ] }
262   rubbos_benchmark_private_ip:
263     description: IP address of rubbos_benchmark in private network
264     value: { get_attr: [ rubbos_benchmark, first_address ] }
265