blob: a0a230947085e1754fea9d0e4a00c968be374079 [file] [log] [blame]
Jerry Floodc8bd4272017-10-19 13:43:43 -04001##########################################################################
2#
Jerry Floodc8bd4272017-10-19 13:43:43 -04003##########################################################################
4
DR695Hccff30b2017-02-17 18:44:24 -05005heat_template_version: 2013-05-23
6
Jerry Floodc8bd4272017-10-19 13:43:43 -04007description: Heat template that deploys vFirewall demo app for ONAP
8
9##############
10# #
11# PARAMETERS #
12# #
13##############
DR695Hccff30b2017-02-17 18:44:24 -050014
15parameters:
16 vfw_image_name:
17 type: string
18 label: Image name or ID
19 description: Image to be used for compute instance
20 vfw_flavor_name:
21 type: string
22 label: Flavor
23 description: Type of instance (flavor) to be used
24 public_net_id:
25 type: string
26 label: Public network name or ID
27 description: Public network that enables remote connection to VNF
28 unprotected_private_net_id:
29 type: string
30 label: Unprotected private network name or ID
31 description: Private network that connects vPacketGenerator with vFirewall
32 protected_private_net_id:
33 type: string
34 label: Protected private network name or ID
35 description: Private network that connects vFirewall with vSink
Jerry Floodc8bd4272017-10-19 13:43:43 -040036 onap_private_net_id:
DR695Hccff30b2017-02-17 18:44:24 -050037 type: string
Jerry Floodc8bd4272017-10-19 13:43:43 -040038 label: ONAP management network name or ID
39 description: Private network that connects ONAP components and the VNF
40 onap_private_subnet_id:
DR695Hccff30b2017-02-17 18:44:24 -050041 type: string
Jerry Floodc8bd4272017-10-19 13:43:43 -040042 label: ONAP management sub-network name or ID
43 description: Private sub-network that connects ONAP components and the VNF
DR695Hccff30b2017-02-17 18:44:24 -050044 unprotected_private_net_cidr:
45 type: string
46 label: Unprotected private network CIDR
47 description: The CIDR of the unprotected private network
48 protected_private_net_cidr:
49 type: string
50 label: Protected private network CIDR
51 description: The CIDR of the protected private network
Jerry Floodc8bd4272017-10-19 13:43:43 -040052 onap_private_net_cidr:
DR695Hccff30b2017-02-17 18:44:24 -050053 type: string
Jerry Floodc8bd4272017-10-19 13:43:43 -040054 label: ONAP private network CIDR
DR695Hccff30b2017-02-17 18:44:24 -050055 description: The CIDR of the protected private network
56 vfw_private_ip_0:
57 type: string
58 label: vFirewall private IP address towards the unprotected network
59 description: Private IP address that is assigned to the vFirewall to communicate with the vPacketGenerator
60 vfw_private_ip_1:
61 type: string
62 label: vFirewall private IP address towards the protected network
63 description: Private IP address that is assigned to the vFirewall to communicate with the vSink
64 vfw_private_ip_2:
65 type: string
Jerry Floodc8bd4272017-10-19 13:43:43 -040066 label: vFirewall private IP address towards the ONAP management network
67 description: Private IP address that is assigned to the vFirewall to communicate with ONAP components
DR695Hccff30b2017-02-17 18:44:24 -050068 vpg_private_ip_0:
69 type: string
70 label: vPacketGenerator private IP address towards the unprotected network
71 description: Private IP address that is assigned to the vPacketGenerator to communicate with the vFirewall
72 vpg_private_ip_1:
73 type: string
Jerry Floodc8bd4272017-10-19 13:43:43 -040074 label: vPacketGenerator private IP address towards the ONAP management network
75 description: Private IP address that is assigned to the vPacketGenerator to communicate with ONAP components
DR695Hccff30b2017-02-17 18:44:24 -050076 vsn_private_ip_0:
77 type: string
78 label: vSink private IP address towards the protected network
79 description: Private IP address that is assigned to the vSink to communicate with the vFirewall
80 vsn_private_ip_1:
81 type: string
Jerry Floodc8bd4272017-10-19 13:43:43 -040082 label: vSink private IP address towards the ONAP management network
83 description: Private IP address that is assigned to the vSink to communicate with ONAP components
DR695Hccff30b2017-02-17 18:44:24 -050084 vfw_name_0:
85 type: string
86 label: vFirewall name
87 description: Name of the vFirewall
88 vpg_name_0:
89 type: string
90 label: vPacketGenerator name
91 description: Name of the vPacketGenerator
92 vsn_name_0:
93 type: string
94 label: vSink name
95 description: Name of the vSink
96 vnf_id:
97 type: string
98 label: VNF ID
Jerry Floodc8bd4272017-10-19 13:43:43 -040099 description: The VNF ID is provided by ONAP
DR695Hccff30b2017-02-17 18:44:24 -0500100 vf_module_id:
101 type: string
102 label: vFirewall module ID
Jerry Floodc8bd4272017-10-19 13:43:43 -0400103 description: The vFirewall Module ID is provided by ONAP
DR695Hccff30b2017-02-17 18:44:24 -0500104 dcae_collector_ip:
105 type: string
106 label: DCAE collector IP address
107 description: IP address of the DCAE collector
108 dcae_collector_port:
109 type: string
110 label: DCAE collector port
111 description: Port of the DCAE collector
112 key_name:
113 type: string
114 label: Key pair name
115 description: Public/Private key pair name
116 pub_key:
117 type: string
118 label: Public key
119 description: Public key to be installed on the compute instance
jf98609ab26342017-02-28 15:07:36 -0500120 repo_url_blob:
DR695Hccff30b2017-02-17 18:44:24 -0500121 type: string
122 label: Repository URL
123 description: URL of the repository that hosts the demo packages
jf98609ab26342017-02-28 15:07:36 -0500124 repo_url_artifacts:
125 type: string
126 label: Repository URL
127 description: URL of the repository that hosts the demo packages
Jerry Floodc8bd4272017-10-19 13:43:43 -0400128 install_script_version:
129 type: string
130 label: Installation script version number
131 description: Version number of the scripts that install the vFW demo app
jf98609ab26342017-02-28 15:07:36 -0500132 demo_artifacts_version:
133 type: string
134 label: Artifacts version used in demo vnfs
135 description: Artifacts (jar, tar.gz) version used in demo vnfs
Jerry Floodc8bd4272017-10-19 13:43:43 -0400136 cloud_env:
137 type: string
138 label: Cloud environment
139 description: Cloud environment (e.g., openstack, rackspace)
140
141#############
142# #
143# RESOURCES #
144# #
145#############
DR695Hccff30b2017-02-17 18:44:24 -0500146
147resources:
jf98609ab26342017-02-28 15:07:36 -0500148 random-str:
149 type: OS::Heat::RandomString
150 properties:
151 length: 4
152
DR695Hccff30b2017-02-17 18:44:24 -0500153 my_keypair:
154 type: OS::Nova::KeyPair
155 properties:
Jerry Floodc8bd4272017-10-19 13:43:43 -0400156 name:
jf98609ab26342017-02-28 15:07:36 -0500157 str_replace:
158 template: base_rand
159 params:
160 base: { get_param: key_name }
Jerry Floodc8bd4272017-10-19 13:43:43 -0400161 rand: { get_resource: random-str }
DR695Hccff30b2017-02-17 18:44:24 -0500162 public_key: { get_param: pub_key }
163 save_private_key: false
164
165 unprotected_private_network:
166 type: OS::Neutron::Net
167 properties:
168 name: { get_param: unprotected_private_net_id }
169
170 protected_private_network:
171 type: OS::Neutron::Net
172 properties:
173 name: { get_param: protected_private_net_id }
174
175 unprotected_private_subnet:
176 type: OS::Neutron::Subnet
177 properties:
178 network_id: { get_resource: unprotected_private_network }
179 cidr: { get_param: unprotected_private_net_cidr }
180
181 protected_private_subnet:
182 type: OS::Neutron::Subnet
183 properties:
184 network_id: { get_resource: protected_private_network }
185 cidr: { get_param: protected_private_net_cidr }
186
Jerry Floodc8bd4272017-10-19 13:43:43 -0400187 # Virtual Firewall instantiation
188 vfw_private_0_port:
189 type: OS::Neutron::Port
190 properties:
191 network: { get_resource: unprotected_private_network }
192 fixed_ips: [{"subnet": { get_resource: unprotected_private_subnet }, "ip_address": { get_param: vfw_private_ip_0 }}]
193
194 vfw_private_1_port:
195 type: OS::Neutron::Port
196 properties:
197 allowed_address_pairs: [{ "ip_address": { get_param: vpg_private_ip_0 }}]
198 network: { get_resource: protected_private_network }
199 fixed_ips: [{"subnet": { get_resource: protected_private_subnet }, "ip_address": { get_param: vfw_private_ip_1 }}]
200
201 vfw_private_2_port:
202 type: OS::Neutron::Port
203 properties:
204 network: { get_param: onap_private_net_id }
205 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vfw_private_ip_2 }}]
206
DR695Hccff30b2017-02-17 18:44:24 -0500207 vfw_0:
208 type: OS::Nova::Server
209 properties:
210 image: { get_param: vfw_image_name }
211 flavor: { get_param: vfw_flavor_name }
212 name: { get_param: vfw_name_0 }
213 key_name: { get_resource: my_keypair }
214 networks:
215 - network: { get_param: public_net_id }
216 - port: { get_resource: vfw_private_0_port }
217 - port: { get_resource: vfw_private_1_port }
218 - port: { get_resource: vfw_private_2_port }
219 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
220 user_data_format: RAW
221 user_data:
222 str_replace:
223 params:
DR695Hccff30b2017-02-17 18:44:24 -0500224 __dcae_collector_ip__ : { get_param: dcae_collector_ip }
225 __dcae_collector_port__ : { get_param: dcae_collector_port }
jf98609ab26342017-02-28 15:07:36 -0500226 __repo_url_blob__ : { get_param: repo_url_blob }
227 __repo_url_artifacts__ : { get_param: repo_url_artifacts }
228 __demo_artifacts_version__ : { get_param: demo_artifacts_version }
Jerry Floodc8bd4272017-10-19 13:43:43 -0400229 __install_script_version__ : { get_param: install_script_version }
230 __vfw_private_ip_0__ : { get_param: vfw_private_ip_0 }
231 __vfw_private_ip_1__ : { get_param: vfw_private_ip_1 }
232 __vfw_private_ip_2__ : { get_param: vfw_private_ip_2 }
233 __unprotected_private_net_cidr__ : { get_param: unprotected_private_net_cidr }
234 __protected_private_net_cidr__ : { get_param: protected_private_net_cidr }
235 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
236 __cloud_env__ : { get_param: cloud_env }
DR695Hccff30b2017-02-17 18:44:24 -0500237 template: |
238 #!/bin/bash
Jerry Flood1973e2c2017-10-19 18:26:24 -0400239
Jerry Floodc8bd4272017-10-19 13:43:43 -0400240 # Create configuration files
Jerry Floodd7503152017-10-09 16:33:00 -0400241 mkdir /opt/config
Jerry Floodc8bd4272017-10-19 13:43:43 -0400242 echo "__dcae_collector_ip__" > /opt/config/dcae_collector_ip.txt
243 echo "__dcae_collector_port__" > /opt/config/dcae_collector_port.txt
244 echo "__repo_url_blob__" > /opt/config/repo_url_blob.txt
245 echo "__repo_url_artifacts__" > /opt/config/repo_url_artifacts.txt
246 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
247 echo "__install_script_version__" > /opt/config/install_script_version.txt
248 echo "__vfw_private_ip_0__" > /opt/config/vfw_private_ip_0.txt
249 echo "__vfw_private_ip_1__" > /opt/config/vfw_private_ip_1.txt
250 echo "__vfw_private_ip_2__" > /opt/config/vfw_private_ip_2.txt
251 echo "__unprotected_private_net_cidr__" > /opt/config/unprotected_private_net_cidr.txt
252 echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt
253 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
254 echo "__cloud_env__" > /opt/config/cloud_env.txt
Jerry Flood1973e2c2017-10-19 18:26:24 -0400255
Jerry Floodc8bd4272017-10-19 13:43:43 -0400256 # Download and run install script
257 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 -0500258 cd /opt
Jerry Floodc8bd4272017-10-19 13:43:43 -0400259 chmod +x v_firewall_install.sh
260 ./v_firewall_install.sh
DR695Hccff30b2017-02-17 18:44:24 -0500261
Jerry Floodd7503152017-10-09 16:33:00 -0400262
Jerry Floodc8bd4272017-10-19 13:43:43 -0400263 # Virtual Packet Generator instantiation
264 vpg_private_0_port:
DR695Hccff30b2017-02-17 18:44:24 -0500265 type: OS::Neutron::Port
266 properties:
267 network: { get_resource: unprotected_private_network }
Jerry Floodc8bd4272017-10-19 13:43:43 -0400268 fixed_ips: [{"subnet": { get_resource: unprotected_private_subnet }, "ip_address": { get_param: vpg_private_ip_0 }}]
DR695Hccff30b2017-02-17 18:44:24 -0500269
Jerry Floodc8bd4272017-10-19 13:43:43 -0400270 vpg_private_1_port:
DR695Hccff30b2017-02-17 18:44:24 -0500271 type: OS::Neutron::Port
272 properties:
Jerry Floodc8bd4272017-10-19 13:43:43 -0400273 network: { get_param: onap_private_net_id }
274 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vpg_private_ip_1 }}]
DR695Hccff30b2017-02-17 18:44:24 -0500275
276 vpg_0:
277 type: OS::Nova::Server
278 properties:
279 image: { get_param: vfw_image_name }
280 flavor: { get_param: vfw_flavor_name }
281 name: { get_param: vpg_name_0 }
282 key_name: { get_resource: my_keypair }
283 networks:
284 - network: { get_param: public_net_id }
285 - port: { get_resource: vpg_private_0_port }
286 - port: { get_resource: vpg_private_1_port }
287 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
288 user_data_format: RAW
289 user_data:
290 str_replace:
291 params:
DR695Hccff30b2017-02-17 18:44:24 -0500292 __fw_ipaddr__: { get_param: vfw_private_ip_0 }
293 __protected_net_cidr__: { get_param: protected_private_net_cidr }
294 __sink_ipaddr__: { get_param: vsn_private_ip_0 }
jf98609ab26342017-02-28 15:07:36 -0500295 __repo_url_blob__ : { get_param: repo_url_blob }
296 __repo_url_artifacts__ : { get_param: repo_url_artifacts }
297 __demo_artifacts_version__ : { get_param: demo_artifacts_version }
Jerry Floodc8bd4272017-10-19 13:43:43 -0400298 __install_script_version__ : { get_param: install_script_version }
299 __vpg_private_ip_0__ : { get_param: vpg_private_ip_0 }
300 __vpg_private_ip_1__ : { get_param: vpg_private_ip_1 }
301 __unprotected_private_net_cidr__ : { get_param: unprotected_private_net_cidr }
302 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
303 __cloud_env__ : { get_param: cloud_env }
DR695Hccff30b2017-02-17 18:44:24 -0500304 template: |
305 #!/bin/bash
Jerry Flood1973e2c2017-10-19 18:26:24 -0400306
Jerry Floodc8bd4272017-10-19 13:43:43 -0400307 # Create configuration files
DR695Hccff30b2017-02-17 18:44:24 -0500308 mkdir /opt/config
Jerry Floodc8bd4272017-10-19 13:43:43 -0400309 echo "__fw_ipaddr__" > /opt/config/fw_ipaddr.txt
310 echo "__protected_net_cidr__" > /opt/config/protected_net_cidr.txt
311 echo "__sink_ipaddr__" > /opt/config/sink_ipaddr.txt
312 echo "__repo_url_blob__" > /opt/config/repo_url_blob.txt
313 echo "__repo_url_artifacts__" > /opt/config/repo_url_artifacts.txt
314 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
315 echo "__install_script_version__" > /opt/config/install_script_version.txt
316 echo "__vpg_private_ip_0__" > /opt/config/vpg_private_ip_0.txt
317 echo "__vpg_private_ip_1__" > /opt/config/vpg_private_ip_1.txt
318 echo "__unprotected_private_net_cidr__" > /opt/config/unprotected_private_net_cidr.txt
319 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
320 echo "__cloud_env__" > /opt/config/cloud_env.txt
Jerry Flood1973e2c2017-10-19 18:26:24 -0400321
Jerry Floodc8bd4272017-10-19 13:43:43 -0400322 # Download and run install script
323 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 -0500324 cd /opt
Jerry Floodc8bd4272017-10-19 13:43:43 -0400325 chmod +x v_packetgen_install.sh
326 ./v_packetgen_install.sh
jf98609ab26342017-02-28 15:07:36 -0500327
328
Jerry Floodc8bd4272017-10-19 13:43:43 -0400329 # Virtual Sink instantiation
330 vsn_private_0_port:
DR695Hccff30b2017-02-17 18:44:24 -0500331 type: OS::Neutron::Port
332 properties:
Jerry Floodc8bd4272017-10-19 13:43:43 -0400333 network: { get_resource: protected_private_network }
334 fixed_ips: [{"subnet": { get_resource: protected_private_subnet }, "ip_address": { get_param: vsn_private_ip_0 }}]
DR695Hccff30b2017-02-17 18:44:24 -0500335
Jerry Floodc8bd4272017-10-19 13:43:43 -0400336 vsn_private_1_port:
DR695Hccff30b2017-02-17 18:44:24 -0500337 type: OS::Neutron::Port
338 properties:
Jerry Floodc8bd4272017-10-19 13:43:43 -0400339 network: { get_param: onap_private_net_id }
340 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vsn_private_ip_1 }}]
DR695Hccff30b2017-02-17 18:44:24 -0500341
342 vsn_0:
343 type: OS::Nova::Server
344 properties:
345 image: { get_param: vfw_image_name }
346 flavor: { get_param: vfw_flavor_name }
347 name: { get_param: vsn_name_0 }
348 key_name: { get_resource: my_keypair }
349 networks:
350 - network: { get_param: public_net_id }
351 - port: { get_resource: vsn_private_0_port }
352 - port: { get_resource: vsn_private_1_port }
353 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
354 user_data_format: RAW
355 user_data:
356 str_replace:
357 params:
DR695Hccff30b2017-02-17 18:44:24 -0500358 __protected_net_gw__: { get_param: vfw_private_ip_1 }
359 __unprotected_net__: { get_param: unprotected_private_net_cidr }
jf98609ab26342017-02-28 15:07:36 -0500360 __repo_url_blob__ : { get_param: repo_url_blob }
361 __repo_url_artifacts__ : { get_param: repo_url_artifacts }
Jerry Floodc8bd4272017-10-19 13:43:43 -0400362 __install_script_version__ : { get_param: install_script_version }
363 __vsn_private_ip_0__ : { get_param: vsn_private_ip_0 }
364 __vsn_private_ip_1__ : { get_param: vsn_private_ip_1 }
365 __protected_private_net_cidr__ : { get_param: protected_private_net_cidr }
366 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
367 __cloud_env__ : { get_param: cloud_env }
DR695Hccff30b2017-02-17 18:44:24 -0500368 template: |
369 #!/bin/bash
Jerry Flood1973e2c2017-10-19 18:26:24 -0400370
Jerry Floodc8bd4272017-10-19 13:43:43 -0400371 # Create configuration files
DR695Hccff30b2017-02-17 18:44:24 -0500372 mkdir /opt/config
Jerry Floodc8bd4272017-10-19 13:43:43 -0400373 echo "__protected_net_gw__" > /opt/config/protected_net_gw.txt
374 echo "__unprotected_net__" > /opt/config/unprotected_net.txt
375 echo "__repo_url_blob__" > /opt/config/repo_url_blob.txt
376 echo "__install_script_version__" > /opt/config/install_script_version.txt
377 echo "__vsn_private_ip_0__" > /opt/config/vsn_private_ip_0.txt
378 echo "__vsn_private_ip_1__" > /opt/config/vsn_private_ip_1.txt
379 echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt
380 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
381 echo "__cloud_env__" > /opt/config/cloud_env.txt
Jerry Flood1973e2c2017-10-19 18:26:24 -0400382
Jerry Floodc8bd4272017-10-19 13:43:43 -0400383 # Download and run install script
384 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 -0500385 cd /opt
Jerry Floodc8bd4272017-10-19 13:43:43 -0400386 chmod +x v_sink_install.sh
387 ./v_sink_install.sh