JIRA: BOTTLENECKS-29
[bottlenecks.git] / utils / infra_setup / heat_template / vstf_heat_template / bottleneck_vstf.yaml
1 heat_template_version: 2013-05-23
2 description: >
3   This template is used for creating a new environment on the Openstack Release L ,
4   and the deployment will create three virtual machine on the compute node, one manager
5   and two agent vm included. Each vm will has a nic on the controlplane switch and two
6   agent vms will has a additional nic on the dataplane.
7 parameters:
8   #nova keypair-list to query available key pair
9   key_name:
10     type: string
11     description: Name of keypair to assign to servers
12     default: vstf-key
13   #nova image-list to query available images
14   image:
15     type: string
16     description: Name of image to use for servers
17     default: bottlenecks-trusty-server
18   #new addition image for the actual deployment
19   image_vstf_manager:
20     type: string
21     description: Name of image to use for servers
22     default: vstf-manager
23   image_vstf_agent:
24     type: string
25     description: Name of image to use for servers
26     default: vstf-agent
27   #nova flavor-list to query available flavors
28   flavor:
29     type: string
30     description: Flavor to use for servers
31     default: m1.large
32   #nova net-list to query available
33   public_net:
34     type: string
35     description: >
36       ID or name of public network for which floating IP addresses will be allocated
37     default: net04_ext
38
39   #private controlplane
40   private_net_name:
41     type: string
42     description: Name of private network to be created
43     default: vstf-private
44   private_net_cidr:
45     type: string
46     description: Private network address (CIDR notation)
47     default: "10.0.11.0/24"
48   private_net_gateway:
49     type: string
50     description: Private network gateway address
51     default: "10.0.11.1"
52   private_net_pool_start:
53     type: string
54     description: Start of private network IP address allocation pool
55     default: "10.0.11.2"
56   private_net_pool_end:
57     type: string
58     description: End of private network IP address allocation pool
59     default: "10.0.11.199"
60
61   #testing dataplane
62   testing_net_name:
63     type: string
64     description: Name of private network to be created
65     default: bottlenecks-testing
66   testing_net_cidr:
67     type: string
68     description: Private network address (CIDR notation)
69     default: "10.0.20.0/24"
70   testing_net_gateway:
71     type: string
72     description: Private network gateway address
73     default: "10.0.20.1"
74   testing_net_pool_start:
75     type: string
76     description: Start of private network IP address allocation pool
77     default: "10.0.20.2"
78   testing_net_pool_end:
79     type: string
80     description: End of private network IP address allocation pool
81     default: "10.0.20.199"
82
83
84 resources:
85   #control plane
86   private_net:
87     type: OS::Neutron::Net
88     properties:
89       name: { get_param: private_net_name }
90   private_subnet:
91     type: OS::Neutron::Subnet
92     properties:
93       network_id: { get_resource: private_net }
94       cidr: { get_param: private_net_cidr }
95       gateway_ip: { get_param: private_net_gateway }
96       allocation_pools:
97         - start: { get_param: private_net_pool_start }
98           end: { get_param: private_net_pool_end }
99
100   #dataplane
101   testing_net:
102     type: OS::Neutron::Net
103     properties:
104       name: { get_param: testing_net_name }
105   testing_subnet:
106     type: OS::Neutron::Subnet
107     properties:
108       network_id: { get_resource: testing_net }
109       cidr: { get_param: testing_net_cidr }
110       gateway_ip: { get_param: testing_net_gateway }
111       allocation_pools:
112         - start: { get_param: testing_net_pool_start }
113           end: { get_param: testing_net_pool_end }
114
115   #router info
116   router:
117     type: OS::Neutron::Router
118     properties:
119       external_gateway_info:
120         network: { get_param: public_net }
121   router_interface:
122     type: OS::Neutron::RouterInterface
123     properties:
124       router_id: { get_resource: router }
125       subnet_id: { get_resource: private_subnet }
126
127   #security_group
128   server_security_group:
129     type: OS::Neutron::SecurityGroup
130     properties:
131       description: vstf group for servers access.
132       name: vstf-security-group
133       rules: [
134         {remote_ip_prefix: 0.0.0.0/0,
135         protocol: tcp,
136         port_range_min: 1,
137         port_range_max: 65535},
138         {remote_ip_prefix: 0.0.0.0/0,
139         protocol: udp,
140         port_range_min: 1,
141         port_range_max: 65535},
142         {remote_ip_prefix: 0.0.0.0/0,
143         protocol: icmp}]
144
145   #nova server vstf manager definition info
146   vstf-manager:
147     type: OS::Nova::Server
148     properties:
149       name: vstf-manager
150       image: { get_param: image_vstf_manager }
151       flavor: { get_param: flavor }
152       key_name: { get_param: key_name }
153       networks:
154         - port: { get_resource: manager_control_port }
155   manager_control_port:
156     type: OS::Neutron::Port
157     properties:
158       network_id: { get_resource: private_net }
159       fixed_ips:
160         - subnet_id: { get_resource: private_subnet }
161       security_groups: [{ get_resource: server_security_group }]
162   manager_control_floating_ip:
163     type: OS::Neutron::FloatingIP
164     properties:
165       floating_network: { get_param: public_net }
166       port_id: { get_resource: manager_control_port }
167
168   #nova server vstf target definition info
169   vstf-target:
170     type: OS::Nova::Server
171     properties:
172       name: vstf-target
173       image: { get_param: image_vstf_agent }
174       flavor: { get_param: flavor }
175       key_name: { get_param: key_name }
176       networks:
177         - port: { get_resource: target_control_port }
178         - port: { get_resource: target_testing_port }
179   target_control_port:
180     type: OS::Neutron::Port
181     properties:
182       network_id: { get_resource: private_net }
183       fixed_ips:
184         - subnet_id: { get_resource: private_subnet }
185       security_groups: [{ get_resource: server_security_group }]
186   target_testing_port:
187     type: OS::Neutron::Port
188     properties:
189       network_id: { get_resource: testing_net }
190       fixed_ips:
191         - subnet_id: { get_resource: testing_subnet }
192       security_groups: [{ get_resource: server_security_group }]
193   target_control_floating_ip:
194     type: OS::Neutron::FloatingIP
195     properties:
196       floating_network: { get_param: public_net }
197       port_id: { get_resource: target_control_port }
198
199   #nova server vstf tester definition info
200   vstf-tester:
201     type: OS::Nova::Server
202     properties:
203       name: vstf-tester
204       image: { get_param: image_vstf_agent }
205       flavor: { get_param: flavor }
206       key_name: { get_param: key_name }
207       networks:
208         - port: { get_resource: tester_control_port }
209         - port: { get_resource: tester_testing_port }
210   tester_control_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       security_groups: [{ get_resource: server_security_group }]
217   tester_testing_port:
218     type: OS::Neutron::Port
219     properties:
220       network_id: { get_resource: testing_net }
221       fixed_ips:
222         - subnet_id: { get_resource: testing_subnet }
223       security_groups: [{ get_resource: server_security_group }]
224   tester_control_floating_ip:
225     type: OS::Neutron::FloatingIP
226     properties:
227       floating_network: { get_param: public_net }
228       port_id: { get_resource: tester_control_port }
229
230 outputs:
231   manager_control_private_ip:
232     description: IP address of manager_control in private network
233     value: { get_attr: [ vstf-manager, first_address ] }
234   manager_control_public_ip:
235     description: Floating IP address of manager_control in public network
236     value: { get_attr: [ manager_control_floating_ip, floating_ip_address ] }
237   target_control_private_ip:
238     description: IP address of manager_control in private network
239     value: { get_attr: [ vstf-target, first_address ] }
240   target_control_public_ip:
241     description: Floating IP address of manager_control in public network
242     value: { get_attr: [ target_control_floating_ip, floating_ip_address ] }
243   tester_control_private_ip:
244     description: IP address of manager_control in private network
245     value: { get_attr: [ vstf-tester, first_address ] }
246   tester_control_public_ip:
247     description: Floating IP address of manager_control in public network
248     value: { get_attr: [ tester_control_floating_ip, floating_ip_address ] }