blob: 1c22c9b730788a52ff31acf2eb655a4f4d250515 [file] [log] [blame]
Jerry Floodc8bd4272017-10-19 13:43:43 -04001##########################################################################
2#
3#==================LICENSE_START==========================================
4#
5#
6# Copyright © 2017 AT&T Intellectual Property. All rights reserved.
7#
8# Licensed under the Apache License, Version 2.0 (the "License");
9# you may not use this file except in compliance with the License.
10# You may obtain a copy of the License at
11# http://www.apache.org/licenses/LICENSE-2.0
12#
13# Unless required by applicable law or agreed to in writing, software
14# distributed under the License is distributed on an "AS IS" BASIS,
15# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16# See the License for the specific language governing permissions and
17# limitations under the License.
18#
19#==================LICENSE_END============================================
20#
21# ECOMP is a trademark and service mark of AT&T Intellectual Property.
22#
23##########################################################################
24
DR695Hccff30b2017-02-17 18:44:24 -050025heat_template_version: 2013-05-23
26
Jerry Floodc8bd4272017-10-19 13:43:43 -040027description: Heat template that deploys vFirewall demo app for ONAP
28
29##############
30# #
31# PARAMETERS #
32# #
33##############
DR695Hccff30b2017-02-17 18:44:24 -050034
35parameters:
36 vfw_image_name:
37 type: string
38 label: Image name or ID
39 description: Image to be used for compute instance
40 vfw_flavor_name:
41 type: string
42 label: Flavor
43 description: Type of instance (flavor) to be used
44 public_net_id:
45 type: string
46 label: Public network name or ID
47 description: Public network that enables remote connection to VNF
48 unprotected_private_net_id:
49 type: string
50 label: Unprotected private network name or ID
51 description: Private network that connects vPacketGenerator with vFirewall
52 protected_private_net_id:
53 type: string
54 label: Protected private network name or ID
55 description: Private network that connects vFirewall with vSink
Jerry Floodc8bd4272017-10-19 13:43:43 -040056 onap_private_net_id:
DR695Hccff30b2017-02-17 18:44:24 -050057 type: string
Jerry Floodc8bd4272017-10-19 13:43:43 -040058 label: ONAP management network name or ID
59 description: Private network that connects ONAP components and the VNF
60 onap_private_subnet_id:
DR695Hccff30b2017-02-17 18:44:24 -050061 type: string
Jerry Floodc8bd4272017-10-19 13:43:43 -040062 label: ONAP management sub-network name or ID
63 description: Private sub-network that connects ONAP components and the VNF
DR695Hccff30b2017-02-17 18:44:24 -050064 unprotected_private_net_cidr:
65 type: string
66 label: Unprotected private network CIDR
67 description: The CIDR of the unprotected private network
68 protected_private_net_cidr:
69 type: string
70 label: Protected private network CIDR
71 description: The CIDR of the protected private network
Jerry Floodc8bd4272017-10-19 13:43:43 -040072 onap_private_net_cidr:
DR695Hccff30b2017-02-17 18:44:24 -050073 type: string
Jerry Floodc8bd4272017-10-19 13:43:43 -040074 label: ONAP private network CIDR
DR695Hccff30b2017-02-17 18:44:24 -050075 description: The CIDR of the protected private network
76 vfw_private_ip_0:
77 type: string
78 label: vFirewall private IP address towards the unprotected network
79 description: Private IP address that is assigned to the vFirewall to communicate with the vPacketGenerator
80 vfw_private_ip_1:
81 type: string
82 label: vFirewall private IP address towards the protected network
83 description: Private IP address that is assigned to the vFirewall to communicate with the vSink
84 vfw_private_ip_2:
85 type: string
Jerry Floodc8bd4272017-10-19 13:43:43 -040086 label: vFirewall private IP address towards the ONAP management network
87 description: Private IP address that is assigned to the vFirewall to communicate with ONAP components
DR695Hccff30b2017-02-17 18:44:24 -050088 vpg_private_ip_0:
89 type: string
90 label: vPacketGenerator private IP address towards the unprotected network
91 description: Private IP address that is assigned to the vPacketGenerator to communicate with the vFirewall
92 vpg_private_ip_1:
93 type: string
Jerry Floodc8bd4272017-10-19 13:43:43 -040094 label: vPacketGenerator private IP address towards the ONAP management network
95 description: Private IP address that is assigned to the vPacketGenerator to communicate with ONAP components
DR695Hccff30b2017-02-17 18:44:24 -050096 vsn_private_ip_0:
97 type: string
98 label: vSink private IP address towards the protected network
99 description: Private IP address that is assigned to the vSink to communicate with the vFirewall
100 vsn_private_ip_1:
101 type: string
Jerry Floodc8bd4272017-10-19 13:43:43 -0400102 label: vSink private IP address towards the ONAP management network
103 description: Private IP address that is assigned to the vSink to communicate with ONAP components
DR695Hccff30b2017-02-17 18:44:24 -0500104 vfw_name_0:
105 type: string
106 label: vFirewall name
107 description: Name of the vFirewall
108 vpg_name_0:
109 type: string
110 label: vPacketGenerator name
111 description: Name of the vPacketGenerator
112 vsn_name_0:
113 type: string
114 label: vSink name
115 description: Name of the vSink
116 vnf_id:
117 type: string
118 label: VNF ID
Jerry Floodc8bd4272017-10-19 13:43:43 -0400119 description: The VNF ID is provided by ONAP
DR695Hccff30b2017-02-17 18:44:24 -0500120 vf_module_id:
121 type: string
122 label: vFirewall module ID
Jerry Floodc8bd4272017-10-19 13:43:43 -0400123 description: The vFirewall Module ID is provided by ONAP
DR695Hccff30b2017-02-17 18:44:24 -0500124 dcae_collector_ip:
125 type: string
126 label: DCAE collector IP address
127 description: IP address of the DCAE collector
128 dcae_collector_port:
129 type: string
130 label: DCAE collector port
131 description: Port of the DCAE collector
132 key_name:
133 type: string
134 label: Key pair name
135 description: Public/Private key pair name
136 pub_key:
137 type: string
138 label: Public key
139 description: Public key to be installed on the compute instance
jf98609ab26342017-02-28 15:07:36 -0500140 repo_url_blob:
DR695Hccff30b2017-02-17 18:44:24 -0500141 type: string
142 label: Repository URL
143 description: URL of the repository that hosts the demo packages
jf98609ab26342017-02-28 15:07:36 -0500144 repo_url_artifacts:
145 type: string
146 label: Repository URL
147 description: URL of the repository that hosts the demo packages
Jerry Floodc8bd4272017-10-19 13:43:43 -0400148 install_script_version:
149 type: string
150 label: Installation script version number
151 description: Version number of the scripts that install the vFW demo app
jf98609ab26342017-02-28 15:07:36 -0500152 demo_artifacts_version:
153 type: string
154 label: Artifacts version used in demo vnfs
155 description: Artifacts (jar, tar.gz) version used in demo vnfs
Jerry Floodc8bd4272017-10-19 13:43:43 -0400156 cloud_env:
157 type: string
158 label: Cloud environment
159 description: Cloud environment (e.g., openstack, rackspace)
160
161#############
162# #
163# RESOURCES #
164# #
165#############
DR695Hccff30b2017-02-17 18:44:24 -0500166
167resources:
jf98609ab26342017-02-28 15:07:36 -0500168 random-str:
169 type: OS::Heat::RandomString
170 properties:
171 length: 4
172
DR695Hccff30b2017-02-17 18:44:24 -0500173 my_keypair:
174 type: OS::Nova::KeyPair
175 properties:
Jerry Floodc8bd4272017-10-19 13:43:43 -0400176 name:
jf98609ab26342017-02-28 15:07:36 -0500177 str_replace:
178 template: base_rand
179 params:
180 base: { get_param: key_name }
Jerry Floodc8bd4272017-10-19 13:43:43 -0400181 rand: { get_resource: random-str }
DR695Hccff30b2017-02-17 18:44:24 -0500182 public_key: { get_param: pub_key }
183 save_private_key: false
184
185 unprotected_private_network:
186 type: OS::Neutron::Net
187 properties:
188 name: { get_param: unprotected_private_net_id }
189
190 protected_private_network:
191 type: OS::Neutron::Net
192 properties:
193 name: { get_param: protected_private_net_id }
194
195 unprotected_private_subnet:
196 type: OS::Neutron::Subnet
197 properties:
198 network_id: { get_resource: unprotected_private_network }
199 cidr: { get_param: unprotected_private_net_cidr }
200
201 protected_private_subnet:
202 type: OS::Neutron::Subnet
203 properties:
204 network_id: { get_resource: protected_private_network }
205 cidr: { get_param: protected_private_net_cidr }
206
Jerry Floodc8bd4272017-10-19 13:43:43 -0400207 # Virtual Firewall instantiation
208 vfw_private_0_port:
209 type: OS::Neutron::Port
210 properties:
211 network: { get_resource: unprotected_private_network }
212 fixed_ips: [{"subnet": { get_resource: unprotected_private_subnet }, "ip_address": { get_param: vfw_private_ip_0 }}]
213
214 vfw_private_1_port:
215 type: OS::Neutron::Port
216 properties:
217 allowed_address_pairs: [{ "ip_address": { get_param: vpg_private_ip_0 }}]
218 network: { get_resource: protected_private_network }
219 fixed_ips: [{"subnet": { get_resource: protected_private_subnet }, "ip_address": { get_param: vfw_private_ip_1 }}]
220
221 vfw_private_2_port:
222 type: OS::Neutron::Port
223 properties:
224 network: { get_param: onap_private_net_id }
225 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vfw_private_ip_2 }}]
226
DR695Hccff30b2017-02-17 18:44:24 -0500227 vfw_0:
228 type: OS::Nova::Server
229 properties:
230 image: { get_param: vfw_image_name }
231 flavor: { get_param: vfw_flavor_name }
232 name: { get_param: vfw_name_0 }
233 key_name: { get_resource: my_keypair }
234 networks:
235 - network: { get_param: public_net_id }
236 - port: { get_resource: vfw_private_0_port }
237 - port: { get_resource: vfw_private_1_port }
238 - port: { get_resource: vfw_private_2_port }
239 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
240 user_data_format: RAW
241 user_data:
242 str_replace:
243 params:
DR695Hccff30b2017-02-17 18:44:24 -0500244 __dcae_collector_ip__ : { get_param: dcae_collector_ip }
245 __dcae_collector_port__ : { get_param: dcae_collector_port }
jf98609ab26342017-02-28 15:07:36 -0500246 __repo_url_blob__ : { get_param: repo_url_blob }
247 __repo_url_artifacts__ : { get_param: repo_url_artifacts }
248 __demo_artifacts_version__ : { get_param: demo_artifacts_version }
Jerry Floodc8bd4272017-10-19 13:43:43 -0400249 __install_script_version__ : { get_param: install_script_version }
250 __vfw_private_ip_0__ : { get_param: vfw_private_ip_0 }
251 __vfw_private_ip_1__ : { get_param: vfw_private_ip_1 }
252 __vfw_private_ip_2__ : { get_param: vfw_private_ip_2 }
253 __unprotected_private_net_cidr__ : { get_param: unprotected_private_net_cidr }
254 __protected_private_net_cidr__ : { get_param: protected_private_net_cidr }
255 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
256 __cloud_env__ : { get_param: cloud_env }
DR695Hccff30b2017-02-17 18:44:24 -0500257 template: |
258 #!/bin/bash
Jerry Flood3fc36a32017-10-11 11:09:19 -0400259
Jerry Floodc8bd4272017-10-19 13:43:43 -0400260 # Create configuration files
Jerry Floodd7503152017-10-09 16:33:00 -0400261 mkdir /opt/config
Jerry Floodc8bd4272017-10-19 13:43:43 -0400262 echo "__dcae_collector_ip__" > /opt/config/dcae_collector_ip.txt
263 echo "__dcae_collector_port__" > /opt/config/dcae_collector_port.txt
264 echo "__repo_url_blob__" > /opt/config/repo_url_blob.txt
265 echo "__repo_url_artifacts__" > /opt/config/repo_url_artifacts.txt
266 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
267 echo "__install_script_version__" > /opt/config/install_script_version.txt
268 echo "__vfw_private_ip_0__" > /opt/config/vfw_private_ip_0.txt
269 echo "__vfw_private_ip_1__" > /opt/config/vfw_private_ip_1.txt
270 echo "__vfw_private_ip_2__" > /opt/config/vfw_private_ip_2.txt
271 echo "__unprotected_private_net_cidr__" > /opt/config/unprotected_private_net_cidr.txt
272 echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt
273 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
274 echo "__cloud_env__" > /opt/config/cloud_env.txt
275
276 # Download and run install script
277 curl -k __repo_url_blob__/org.onap.demo/vnfs/vfw/__install_script_version__/v_firewall_install.sh -o /opt/v_firewall_install.sh
DR695Hccff30b2017-02-17 18:44:24 -0500278 cd /opt
Jerry Floodc8bd4272017-10-19 13:43:43 -0400279 chmod +x v_firewall_install.sh
280 ./v_firewall_install.sh
DR695Hccff30b2017-02-17 18:44:24 -0500281
Jerry Floodd7503152017-10-09 16:33:00 -0400282
Jerry Floodc8bd4272017-10-19 13:43:43 -0400283 # Virtual Packet Generator instantiation
284 vpg_private_0_port:
DR695Hccff30b2017-02-17 18:44:24 -0500285 type: OS::Neutron::Port
286 properties:
287 network: { get_resource: unprotected_private_network }
Jerry Floodc8bd4272017-10-19 13:43:43 -0400288 fixed_ips: [{"subnet": { get_resource: unprotected_private_subnet }, "ip_address": { get_param: vpg_private_ip_0 }}]
DR695Hccff30b2017-02-17 18:44:24 -0500289
Jerry Floodc8bd4272017-10-19 13:43:43 -0400290 vpg_private_1_port:
DR695Hccff30b2017-02-17 18:44:24 -0500291 type: OS::Neutron::Port
292 properties:
Jerry Floodc8bd4272017-10-19 13:43:43 -0400293 network: { get_param: onap_private_net_id }
294 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vpg_private_ip_1 }}]
DR695Hccff30b2017-02-17 18:44:24 -0500295
296 vpg_0:
297 type: OS::Nova::Server
298 properties:
299 image: { get_param: vfw_image_name }
300 flavor: { get_param: vfw_flavor_name }
301 name: { get_param: vpg_name_0 }
302 key_name: { get_resource: my_keypair }
303 networks:
304 - network: { get_param: public_net_id }
305 - port: { get_resource: vpg_private_0_port }
306 - port: { get_resource: vpg_private_1_port }
307 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
308 user_data_format: RAW
309 user_data:
310 str_replace:
311 params:
DR695Hccff30b2017-02-17 18:44:24 -0500312 __fw_ipaddr__: { get_param: vfw_private_ip_0 }
313 __protected_net_cidr__: { get_param: protected_private_net_cidr }
314 __sink_ipaddr__: { get_param: vsn_private_ip_0 }
jf98609ab26342017-02-28 15:07:36 -0500315 __repo_url_blob__ : { get_param: repo_url_blob }
316 __repo_url_artifacts__ : { get_param: repo_url_artifacts }
317 __demo_artifacts_version__ : { get_param: demo_artifacts_version }
Jerry Floodc8bd4272017-10-19 13:43:43 -0400318 __install_script_version__ : { get_param: install_script_version }
319 __vpg_private_ip_0__ : { get_param: vpg_private_ip_0 }
320 __vpg_private_ip_1__ : { get_param: vpg_private_ip_1 }
321 __unprotected_private_net_cidr__ : { get_param: unprotected_private_net_cidr }
322 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
323 __cloud_env__ : { get_param: cloud_env }
DR695Hccff30b2017-02-17 18:44:24 -0500324 template: |
325 #!/bin/bash
Jerry Flood3fc36a32017-10-11 11:09:19 -0400326
Jerry Floodc8bd4272017-10-19 13:43:43 -0400327 # Create configuration files
DR695Hccff30b2017-02-17 18:44:24 -0500328 mkdir /opt/config
Jerry Floodc8bd4272017-10-19 13:43:43 -0400329 echo "__fw_ipaddr__" > /opt/config/fw_ipaddr.txt
330 echo "__protected_net_cidr__" > /opt/config/protected_net_cidr.txt
331 echo "__sink_ipaddr__" > /opt/config/sink_ipaddr.txt
332 echo "__repo_url_blob__" > /opt/config/repo_url_blob.txt
333 echo "__repo_url_artifacts__" > /opt/config/repo_url_artifacts.txt
334 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
335 echo "__install_script_version__" > /opt/config/install_script_version.txt
336 echo "__vpg_private_ip_0__" > /opt/config/vpg_private_ip_0.txt
337 echo "__vpg_private_ip_1__" > /opt/config/vpg_private_ip_1.txt
338 echo "__unprotected_private_net_cidr__" > /opt/config/unprotected_private_net_cidr.txt
339 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
340 echo "__cloud_env__" > /opt/config/cloud_env.txt
341
342 # Download and run install script
343 curl -k __repo_url_blob__/org.onap.demo/vnfs/vfw/__install_script_version__/v_packetgen_install.sh -o /opt/v_packetgen_install.sh
DR695Hccff30b2017-02-17 18:44:24 -0500344 cd /opt
Jerry Floodc8bd4272017-10-19 13:43:43 -0400345 chmod +x v_packetgen_install.sh
346 ./v_packetgen_install.sh
jf98609ab26342017-02-28 15:07:36 -0500347
348
Jerry Floodc8bd4272017-10-19 13:43:43 -0400349 # Virtual Sink instantiation
350 vsn_private_0_port:
DR695Hccff30b2017-02-17 18:44:24 -0500351 type: OS::Neutron::Port
352 properties:
Jerry Floodc8bd4272017-10-19 13:43:43 -0400353 network: { get_resource: protected_private_network }
354 fixed_ips: [{"subnet": { get_resource: protected_private_subnet }, "ip_address": { get_param: vsn_private_ip_0 }}]
DR695Hccff30b2017-02-17 18:44:24 -0500355
Jerry Floodc8bd4272017-10-19 13:43:43 -0400356 vsn_private_1_port:
DR695Hccff30b2017-02-17 18:44:24 -0500357 type: OS::Neutron::Port
358 properties:
Jerry Floodc8bd4272017-10-19 13:43:43 -0400359 network: { get_param: onap_private_net_id }
360 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vsn_private_ip_1 }}]
DR695Hccff30b2017-02-17 18:44:24 -0500361
362 vsn_0:
363 type: OS::Nova::Server
364 properties:
365 image: { get_param: vfw_image_name }
366 flavor: { get_param: vfw_flavor_name }
367 name: { get_param: vsn_name_0 }
368 key_name: { get_resource: my_keypair }
369 networks:
370 - network: { get_param: public_net_id }
371 - port: { get_resource: vsn_private_0_port }
372 - port: { get_resource: vsn_private_1_port }
373 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
374 user_data_format: RAW
375 user_data:
376 str_replace:
377 params:
DR695Hccff30b2017-02-17 18:44:24 -0500378 __protected_net_gw__: { get_param: vfw_private_ip_1 }
379 __unprotected_net__: { get_param: unprotected_private_net_cidr }
jf98609ab26342017-02-28 15:07:36 -0500380 __repo_url_blob__ : { get_param: repo_url_blob }
381 __repo_url_artifacts__ : { get_param: repo_url_artifacts }
Jerry Floodc8bd4272017-10-19 13:43:43 -0400382 __install_script_version__ : { get_param: install_script_version }
383 __vsn_private_ip_0__ : { get_param: vsn_private_ip_0 }
384 __vsn_private_ip_1__ : { get_param: vsn_private_ip_1 }
385 __protected_private_net_cidr__ : { get_param: protected_private_net_cidr }
386 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
387 __cloud_env__ : { get_param: cloud_env }
DR695Hccff30b2017-02-17 18:44:24 -0500388 template: |
389 #!/bin/bash
Jerry Flood3fc36a32017-10-11 11:09:19 -0400390
Jerry Floodc8bd4272017-10-19 13:43:43 -0400391 # Create configuration files
DR695Hccff30b2017-02-17 18:44:24 -0500392 mkdir /opt/config
Jerry Floodc8bd4272017-10-19 13:43:43 -0400393 echo "__protected_net_gw__" > /opt/config/protected_net_gw.txt
394 echo "__unprotected_net__" > /opt/config/unprotected_net.txt
395 echo "__repo_url_blob__" > /opt/config/repo_url_blob.txt
396 echo "__install_script_version__" > /opt/config/install_script_version.txt
397 echo "__vsn_private_ip_0__" > /opt/config/vsn_private_ip_0.txt
398 echo "__vsn_private_ip_1__" > /opt/config/vsn_private_ip_1.txt
399 echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt
400 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
401 echo "__cloud_env__" > /opt/config/cloud_env.txt
402
403 # Download and run install script
404 curl -k __repo_url_blob__/org.onap.demo/vnfs/vfw/__install_script_version__/v_sink_install.sh -o /opt/v_sink_install.sh
DR695Hccff30b2017-02-17 18:44:24 -0500405 cd /opt
Jerry Floodc8bd4272017-10-19 13:43:43 -0400406 chmod +x v_sink_install.sh
407 ./v_sink_install.sh