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