1 ##########################################################################
3 #==================LICENSE_START==========================================
6 # Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
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
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.
19 #==================LICENSE_END============================================
21 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
23 ##########################################################################
25 heat_template_version: 2013-05-23
27 description: Heat template to deploy vLoadBalancer/vDNS demo app for ONAP
38 label: Image name or ID
39 description: Image to be used for compute instance
43 description: Type of instance (flavor) to be used
47 description: Type of instance (flavor) to be used
51 description: Type of instance (flavor) to be used
54 label: Public network name or ID
55 description: Public network that enables remote connection to VNF
58 label: vLoadBalancer private network name or ID
59 description: Private network that connects vLoadBalancer with vDNSs
60 pktgen_private_net_id:
62 label: vPacketGen private network name or ID
63 description: Private network that connects vLoadBalancer with vPacketGen
66 label: ECOMP management network name or ID
67 description: Private network that connects ONAP component and the VNF
68 onap_private_subnet_id:
70 label: ECOMP management sub-network name or ID
71 description: Private sub-network that connects ONAP component and the VNF
74 label: vLoadBalancer private network CIDR
75 description: The CIDR of the vLoadBalancer private network
76 pktgen_private_net_cidr:
78 label: vPacketGen private network CIDR
79 description: The CIDR of the vPacketGen private network
80 onap_private_net_cidr:
82 label: ONAP private network CIDR
83 description: The CIDR of the protected private network
86 label: vLoadBalancer private IP address towards the private network
87 description: Private IP address that is assigned to the vLoadBalancer to communicate with the vDNSs
90 label: vLoadBalancer private IP address towards the ONAP management network
91 description: Private IP address that is assigned to the vLoadBalancer to communicate with ONAP components
94 label: vLoadBalancer private IP address towards the vPacketGen network
95 description: Private IP address that is assigned to the vLoadBalancer to communicate with vPacketGen
98 label: vDNS private IP address towards the private network
99 description: Private IP address that is assigned to the vDNS to communicate with the vLoadBalancer
102 label: vDNS private IP address towards the ONAP management network
103 description: Private IP address that is assigned to the vDNS to communicate with ONAP components
106 label: vPacketGen private IP address towards the vPacketGen private network
107 description: Private IP address that is assigned to the vPacketGen to communicate with the vLoadBalancer
110 label: vPacketGen private IP address towards the ONAP management network
111 description: Private IP address that is assigned to the vPacketGen to communicate with ONAP components
114 label: Virtual Private IP of the vLoadBalancer
115 description: Virtual Private IP that is assigned to the vLoadBalancer's VPP layer
118 label: IP Address of the GRE tunnel
119 description: IP address assigned to the GRE tunnel on the vLoadBalancer
122 label: IP Address of the output vPacketGen interface
123 description: IP address assigned to the output interface of the vPacketGen's VPP layer
126 label: vLoadBalancer name
127 description: Name of the vLoadBalancer
131 description: Name of the vDNS
135 description: Name of the vPKTGEN
139 description: The VNF ID is provided by ONAP
142 label: vFirewall module ID
143 description: The vLoadBalancer Module ID is provided by ONAP
146 label: DCAE collector IP address
147 description: IP address of the DCAE collector
150 label: DCAE collector port
151 description: Port of the DCAE collector
155 description: Public/Private key pair name
159 description: Public key to be installed on the compute instance
160 demo_artifacts_version:
162 label: Artifacts version used in demo vnfs
163 description: Artifacts (jar, tar.gz) version used in demo vnfs
166 description: Root URL for the Nexus repository for Maven artifacts.
167 default: "https://nexus.onap.org"
168 install_script_version:
170 label: Installation script version number
171 description: Version number of the scripts that install the vFW demo app
174 label: Cloud environment
175 description: Cloud environment (e.g., openstack, rackspace)
178 description: ONAP Security Group
190 type: OS::Heat::RandomString
195 type: OS::Nova::KeyPair
201 base: { get_param: key_name }
202 rand: { get_resource: random-str }
203 public_key: { get_param: pub_key }
204 save_private_key: false
207 type: OS::Neutron::Net
209 name: { get_param: vlb_private_net_id }
212 type: OS::Neutron::Subnet
214 name: { get_param: vlb_private_net_id }
215 network_id: { get_resource: vlb_private_network }
216 cidr: { get_param: vlb_private_net_cidr }
218 pktgen_private_network:
219 type: OS::Neutron::Net
221 name: { get_param: pktgen_private_net_id }
223 pktgen_private_subnet:
224 type: OS::Neutron::Subnet
226 name: { get_param: pktgen_private_net_id }
227 network_id: { get_resource: pktgen_private_network }
228 cidr: { get_param: pktgen_private_net_cidr }
231 type: OS::Neutron::Port
233 network: { get_resource: vlb_private_network }
234 fixed_ips: [{"subnet": { get_resource: vlb_private_subnet }, "ip_address": { get_param: vlb_private_ip_0 }}]
236 - { get_param: sec_group }
240 type: OS::Neutron::Port
242 network: { get_param: onap_private_net_id }
243 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vlb_private_ip_1 }}]
245 - { get_param: sec_group }
248 type: OS::Neutron::Port
250 network: { get_resource: pktgen_private_network }
251 fixed_ips: [{"subnet": { get_resource: pktgen_private_subnet }, "ip_address": { get_param: vlb_private_ip_2 }}]
253 - { get_param: sec_group }
256 type: OS::Nova::Server
258 image: { get_param: vlb_image_name }
259 flavor: { get_param: vlb_flavor_name }
260 name: { get_param: vlb_name_0 }
261 key_name: { get_resource: my_keypair }
263 - network: { get_param: public_net_id }
264 - port: { get_resource: vlb_private_0_port }
265 - port: { get_resource: vlb_private_1_port }
266 - port: { get_resource: vlb_private_2_port }
267 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
268 user_data_format: RAW
272 __dcae_collector_ip__: { get_param: dcae_collector_ip }
273 __dcae_collector_port__: { get_param: dcae_collector_port }
274 __ip_to_dns_net__: { get_param: vlb_private_ip_0 }
275 __ip_to_pktgen_net__: { get_param: vlb_private_ip_2 }
276 __vip__: { get_param: vip }
277 __gre_ipaddr__: { get_param: gre_ipaddr }
278 __pktgen_ipaddr__: { get_param: vpg_private_ip_0 }
279 __oam_private_ipaddr__: { get_param: vlb_private_ip_1 }
280 __demo_artifacts_version__: { get_param: demo_artifacts_version }
281 __install_script_version__: { get_param: install_script_version }
282 __vlb_private_net_cidr__: { get_param: vlb_private_net_cidr }
283 __onap_private_net_cidr__: { get_param: onap_private_net_cidr }
284 __pktgen_private_net_cidr__: { get_param: pktgen_private_net_cidr }
285 __pktgen_mac__: { get_attr: [vpg_private_0_port, mac_address] }
286 __cloud_env__: { get_param: cloud_env }
287 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
291 # Create configuration files
293 echo "__dcae_collector_ip__" > /opt/config/dcae_collector_ip.txt
294 echo "__dcae_collector_port__" > /opt/config/dcae_collector_port.txt
295 echo "__ip_to_dns_net__" > /opt/config/ip_to_dns_net.txt
296 echo "__ip_to_pktgen_net__" > /opt/config/ip_to_pktgen_net.txt
297 echo "__vip__" > /opt/config/vip.txt
298 echo "__gre_ipaddr__" > /opt/config/gre_ipaddr.txt
299 echo "__pktgen_ipaddr__" > /opt/config/pktgen_ipaddr.txt
300 echo "__oam_private_ipaddr__" > /opt/config/oam_private_ipaddr.txt
301 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
302 echo "__install_script_version__" > /opt/config/install_script_version.txt
303 echo "__vlb_private_net_cidr__" > /opt/config/vlb_private_net_cidr.txt
304 echo "__pktgen_private_net_cidr__" > /opt/config/pktgen_private_net_cidr.txt
305 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
306 echo "__pktgen_mac__" > /opt/config/pktgen_mac.txt
307 echo "__cloud_env__" > /opt/config/cloud_env.txt
308 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
310 # Download and run install script
312 apt-get -y install unzip
313 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
314 curl -k -L "__nexus_artifact_repo__/service/local/artifact/maven/redirect?r=${REPO}&g=org.onap.demo.vnf.vlb&a=vlb-scripts&e=zip&v=__install_script_version__" -o /opt/vlb-scripts-__install_script_version__.zip
315 unzip -j /opt/vlb-scripts-__install_script_version__.zip -d /opt v_lb_install.sh
317 chmod +x v_lb_install.sh
322 type: OS::Neutron::Port
324 network: { get_resource: vlb_private_network }
325 fixed_ips: [{"subnet": { get_resource: vlb_private_subnet }, "ip_address": { get_param: vdns_private_ip_0 }}]
327 - { get_param: sec_group }
330 type: OS::Neutron::Port
332 network: { get_param: onap_private_net_id }
333 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vdns_private_ip_1 }}]
335 - { get_param: sec_group }
339 type: OS::Nova::Server
341 image: { get_param: vlb_image_name }
342 flavor: { get_param: vdns_flavor_name }
343 name: { get_param: vdns_name_0 }
344 key_name: { get_resource: my_keypair }
346 - network: { get_param: public_net_id }
347 - port: { get_resource: vdns_private_0_port }
348 - port: { get_resource: vdns_private_1_port }
349 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
350 user_data_format: RAW
354 __lb_oam_int__: { get_param: vlb_private_ip_1 }
355 __lb_private_ipaddr__: { get_param: vlb_private_ip_0 }
356 __local_private_ipaddr__: { get_param: vdns_private_ip_0 }
357 __oam_private_ipaddr__: { get_param: vdns_private_ip_1 }
358 __demo_artifacts_version__: { get_param: demo_artifacts_version }
359 __install_script_version__: { get_param: install_script_version }
360 __vlb_private_net_cidr__: { get_param: vlb_private_net_cidr }
361 __onap_private_net_cidr__: { get_param: onap_private_net_cidr }
362 __cloud_env__: { get_param: cloud_env }
363 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
367 # Create configuration files
369 echo "__lb_oam_int__" > /opt/config/lb_oam_int.txt
370 echo "__lb_private_ipaddr__" > /opt/config/lb_private_ipaddr.txt
371 echo "__local_private_ipaddr__" > /opt/config/local_private_ipaddr.txt
372 echo "__oam_private_ipaddr__" > /opt/config/oam_private_ipaddr.txt
373 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
374 echo "__install_script_version__" > /opt/config/install_script_version.txt
375 echo "__vlb_private_net_cidr__" > /opt/config/vlb_private_net_cidr.txt
376 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
377 echo "__cloud_env__" > /opt/config/cloud_env.txt
378 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
380 # Download and run install script
382 apt-get -y install unzip
383 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
384 curl -k -L "__nexus_artifact_repo__/service/local/artifact/maven/redirect?r=${REPO}&g=org.onap.demo.vnf.vlb&a=vlb-scripts&e=zip&v=__install_script_version__" -o /opt/vlb-scripts-__install_script_version__.zip
385 unzip -j /opt/vlb-scripts-__install_script_version__.zip -d /opt v_dns_install.sh
387 chmod +x v_dns_install.sh
392 type: OS::Neutron::Port
394 network: { get_resource: pktgen_private_network }
395 fixed_ips: [{"subnet": { get_resource: pktgen_private_subnet }, "ip_address": { get_param: vpg_private_ip_0 }}]
397 - { get_param: sec_group }
400 type: OS::Neutron::Port
402 network: { get_param: onap_private_net_id }
403 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vpg_private_ip_1 }}]
405 - { get_param: sec_group }
408 type: OS::Nova::Server
410 image: { get_param: vlb_image_name }
411 flavor: { get_param: vpg_flavor_name }
412 name: { get_param: vpg_name_0 }
413 key_name: { get_resource: my_keypair }
415 - network: { get_param: public_net_id }
416 - port: { get_resource: vpg_private_0_port }
417 - port: { get_resource: vpg_private_1_port }
418 user_data_format: RAW
422 __local_private_ipaddr__: { get_param: vpg_private_ip_0 }
423 __oam_private_ipaddr__: { get_param: vpg_private_ip_1 }
424 __onap_private_net_cidr__: { get_param: onap_private_net_cidr }
425 __pktgen_private_net_cidr__: { get_param: pktgen_private_net_cidr }
426 __vlb_ipaddr__: { get_param: vlb_private_ip_2 }
427 __demo_artifacts_version__: { get_param: demo_artifacts_version }
428 __install_script_version__: { get_param: install_script_version }
429 __pg_int__: { get_param: pg_int }
430 __vlb_mac__: { get_attr: [vlb_private_2_port, mac_address] }
431 __cloud_env__: { get_param: cloud_env }
432 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
436 # Create configuration files
438 echo "__oam_private_ipaddr__" > /opt/config/oam_private_ipaddr.txt
439 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
440 echo "__local_private_ipaddr__" > /opt/config/local_private_ipaddr.txt
441 echo "__pktgen_private_net_cidr__" > /opt/config/pktgen_private_net_cidr.txt
442 echo "__vlb_ipaddr__" > /opt/config/vlb_ipaddr.txt
443 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
444 echo "__install_script_version__" > /opt/config/install_script_version.txt
445 echo "__pg_int__" > /opt/config/pg_int.txt
446 echo "__vlb_mac__" > /opt/config/vlb_mac.txt
447 echo "__cloud_env__" > /opt/config/cloud_env.txt
448 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
450 # Download and run install script
452 apt-get -y install unzip
453 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
454 curl -k -L "__nexus_artifact_repo__/service/local/artifact/maven/redirect?r=${REPO}&g=org.onap.demo.vnf.vlb&a=vlb-scripts&e=zip&v=__install_script_version__" -o /opt/vlb-scripts-__install_script_version__.zip
455 unzip -j /opt/vlb-scripts-__install_script_version__.zip -d /opt v_packetgen_install.sh
457 chmod +x v_packetgen_install.sh
458 ./v_packetgen_install.sh