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
46 label: Image name or ID
47 description: Image to be used for compute instance
51 description: Type of instance (flavor) to be used
54 label: Image name or ID
55 description: Image to be used for compute instance
59 description: Type of instance (flavor) to be used
62 label: Public network name or ID
63 description: Public network that enables remote connection to VNF
66 label: vLoadBalancer private network name or ID
67 description: Private network that connects vLoadBalancer with vDNSs
68 pktgen_private_net_id:
70 label: vPacketGen private network name or ID
71 description: Private network that connects vLoadBalancer with vPacketGen
74 label: ECOMP management network name or ID
75 description: Private network that connects ONAP component and the VNF
76 onap_private_subnet_id:
78 label: ECOMP management sub-network name or ID
79 description: Private sub-network that connects ONAP component and the VNF
82 label: vLoadBalancer private network CIDR
83 description: The CIDR of the vLoadBalancer private network
84 pktgen_private_net_cidr:
86 label: vPacketGen private network CIDR
87 description: The CIDR of the vPacketGen private network
88 onap_private_net_cidr:
90 label: ONAP private network CIDR
91 description: The CIDR of the protected private network
94 label: vLoadBalancer private IP address towards the private network
95 description: Private IP address that is assigned to the vLoadBalancer to communicate with the vDNSs
96 vlb_onap_private_ip_0:
98 label: vLoadBalancer private IP address towards the ONAP management network
99 description: Private IP address that is assigned to the vLoadBalancer to communicate with ONAP components
100 vlb_int_pktgen_private_ip_0:
102 label: vLoadBalancer private IP address towards the vPacketGen network
103 description: Private IP address that is assigned to the vLoadBalancer to communicate with vPacketGen
104 vdns_int_private_ip_0:
106 label: vDNS private IP address towards the private network
107 description: Private IP address that is assigned to the vDNS to communicate with the vLoadBalancer
108 vdns_onap_private_ip_0:
110 label: vDNS private IP address towards the ONAP management network
111 description: Private IP address that is assigned to the vDNS to communicate with ONAP components
112 vpg_int_pktgen_private_ip_0:
114 label: vPacketGen private IP address towards the vPacketGen private network
115 description: Private IP address that is assigned to the vPacketGen to communicate with the vLoadBalancer
116 vpg_onap_private_ip_0:
118 label: vPacketGen private IP address towards the ONAP management network
119 description: Private IP address that is assigned to the vPacketGen to communicate with ONAP components
122 label: Virtual Private IP of the vLoadBalancer
123 description: Virtual Private IP that is assigned to the vLoadBalancer's VPP layer
126 label: IP Address of the GRE tunnel
127 description: IP address assigned to the GRE tunnel on the vLoadBalancer
130 label: IP Address of the output vPacketGen interface
131 description: IP address assigned to the output interface of the vPacketGen's VPP layer
134 label: vLoadBalancer name
135 description: Name of the vLoadBalancer
139 description: Name of the vDNS
143 description: Name of the vPKTGEN
147 description: The VNF ID is provided by ONAP
151 description: The VNF NAME is provided by ONAP
154 label: vFirewall module ID
155 description: The vLoadBalancer Module ID is provided by ONAP
158 label: DCAE collector IP address
159 description: IP address of the DCAE collector
162 label: DCAE collector port
163 description: Port of the DCAE collector
167 description: Public/Private key pair name
171 description: Public key to be installed on the compute instance
172 demo_artifacts_version:
174 label: Artifacts version used in demo vnfs
175 description: Version number for downloading the vPacketGen streams for VPP and VES
178 label: Northbound API version
179 description: Version number of the health check and config APIs
180 install_script_version:
182 label: Installation script version number
183 description: Version number of the scripts that install the vLB demo app
186 label: Cloud environment
187 description: Cloud environment (e.g., openstack, rackspace)
190 description: Root URL for the Nexus repository for Maven artifacts.
193 description: ONAP Security Group
204 type: OS::Heat::RandomString
209 type: OS::Nova::KeyPair
213 template: vnfname_base_rand
215 base: { get_param: key_name }
216 rand: { get_resource: random-str_0 }
217 vnfname: { get_param: vnf_name }
218 public_key: { get_param: pub_key }
219 save_private_key: false
221 # NETWORK_ROLE: private
223 type: OS::Neutron::Net
227 template: vnfname_privatenetid
229 privatenetid: { get_param: vlb_private_net_id }
230 vnfname: { get_param: vnf_name }
232 # NETWORK_ROLE: private
233 int_private_subnet_0:
234 type: OS::Neutron::Subnet
238 template: vnfname_privatenetid_subnet
240 privatenetid: { get_param: vlb_private_net_id }
241 vnfname: { get_param: vnf_name }
242 network: { get_resource: int_private_network }
243 cidr: { get_param: vlb_private_net_cidr }
245 # NETWORK_ROLE: pktgen_private
246 int_pktgen_private_network:
247 type: OS::Neutron::Net
251 template: vnfname_privatenetid
253 privatenetid: { get_param: pktgen_private_net_id }
254 vnfname: { get_param: vnf_name }
256 # NETWORK_ROLE: pktgen_private
257 int_pktgen_private_subnet_0:
258 type: OS::Neutron::Subnet
262 template: vnfname_privatenetid_subnet
264 privatenetid: { get_param: pktgen_private_net_id }
265 vnfname: { get_param: vnf_name }
266 network: { get_resource: int_pktgen_private_network }
267 cidr: { get_param: pktgen_private_net_cidr }
269 # NETWORK_ROLE: private
271 vlb_0_int_private_port_0:
272 type: OS::Neutron::Port
274 network: { get_resource: int_private_network }
275 fixed_ips: [{"subnet": { get_resource: int_private_subnet_0 }, "ip_address": { get_param: vlb_int_private_ip_0 }}]
277 - { get_param: sec_group }
279 # NETWORK_ROLE: onap_private
281 vlb_0_onap_private_port_0:
282 type: OS::Neutron::Port
284 network: { get_param: onap_private_net_id }
285 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vlb_onap_private_ip_0 }}]
287 - { get_param: sec_group }
289 # NETWORK_ROLE: pktgen_private
291 vlb_0_int_pktgen_private_port_0:
292 type: OS::Neutron::Port
294 network: { get_resource: int_pktgen_private_network }
295 fixed_ips: [{"subnet": { get_resource: int_pktgen_private_subnet_0 }, "ip_address": { get_param: vlb_int_pktgen_private_ip_0 }}]
297 - { get_param: sec_group }
301 type: OS::Nova::Server
303 image: { get_param: vlb_image_name }
304 flavor: { get_param: vlb_flavor_name }
305 name: { get_param: vlb_name_0 }
306 key_name: { get_resource: my_keypair_0 }
308 - network: { get_param: public_net_id }
309 - port: { get_resource: vlb_0_int_private_port_0 }
310 - port: { get_resource: vlb_0_onap_private_port_0 }
311 - port: { get_resource: vlb_0_int_pktgen_private_port_0 }
313 vnf_id: { get_param: vnf_id }
314 vf_module_id: { get_param: vf_module_id }
315 vnf_name: { get_param: vnf_name }
316 user_data_format: RAW
320 __dcae_collector_ip__: { get_param: dcae_collector_ip }
321 __dcae_collector_port__: { get_param: dcae_collector_port }
322 __ip_to_dns_net__: { get_param: vlb_int_private_ip_0 }
323 __ip_to_pktgen_net__: { get_param: vlb_int_pktgen_private_ip_0 }
324 __oam_vpktgen_ip__: { get_param: vpg_onap_private_ip_0 }
325 __oam_vdns_ip__: { get_param: vdns_onap_private_ip_0 }
326 __vip__: { get_param: vip }
327 __gre_ipaddr__: { get_param: gre_ipaddr }
328 __pktgen_ipaddr__: { get_param: vpg_int_pktgen_private_ip_0 }
329 __vdns_ipaddr__: { get_param: vdns_int_private_ip_0 }
330 __oam_private_ipaddr__: { get_param: vlb_onap_private_ip_0 }
331 __demo_artifacts_version__: { get_param: demo_artifacts_version }
332 __nb_api_version__: { get_param: nb_api_version }
333 __install_script_version__: { get_param: install_script_version }
334 __vlb_private_net_cidr__: { get_param: vlb_private_net_cidr }
335 __onap_private_net_cidr__: { get_param: onap_private_net_cidr }
336 __pktgen_private_net_cidr__: { get_param: pktgen_private_net_cidr }
337 __pktgen_mac__: { get_attr: [vpg_0_int_pktgen_private_port_0, mac_address] }
338 __cloud_env__: { get_param: cloud_env }
339 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
343 # Create configuration files
345 echo "__dcae_collector_ip__" > /opt/config/dcae_collector_ip.txt
346 echo "__dcae_collector_port__" > /opt/config/dcae_collector_port.txt
347 echo "__ip_to_dns_net__" > /opt/config/ip_to_dns_net.txt
348 echo "__ip_to_pktgen_net__" > /opt/config/ip_to_pktgen_net.txt
349 echo "__oam_vpktgen_ip__" > /opt/config/oam_vpktgen_ip.txt
350 echo "__oam_vdns_ip__" > /opt/config/oam_vdns_ip.txt
351 echo "__vip__" > /opt/config/vip.txt
352 echo "__gre_ipaddr__" > /opt/config/gre_ipaddr.txt
353 echo "__pktgen_ipaddr__" > /opt/config/pktgen_ipaddr.txt
354 echo "__vdns_ipaddr__" > /opt/config/vdns_ipaddr.txt
355 echo "__oam_private_ipaddr__" > /opt/config/oam_private_ipaddr.txt
356 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
357 echo "__nb_api_version__" > /opt/config/nb_api_version.txt
358 echo "__install_script_version__" > /opt/config/install_script_version.txt
359 echo "__vlb_private_net_cidr__" > /opt/config/vlb_private_net_cidr.txt
360 echo "__pktgen_private_net_cidr__" > /opt/config/pktgen_private_net_cidr.txt
361 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
362 echo "__pktgen_mac__" > /opt/config/pktgen_mac.txt
363 echo "__cloud_env__" > /opt/config/cloud_env.txt
364 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
366 # Download and run install script
368 apt-get -y install unzip
369 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
370 curl -k -L "__nexus_artifact_repo__/service/local/artifact/maven/redirect?r=${REPO}&g=org.onap.demo.vnf.vlbms&a=vlbms-scripts&e=zip&v=__install_script_version__" -o /opt/vlbms-scripts-__install_script_version__.zip
371 unzip -j /opt/vlbms-scripts-__install_script_version__.zip -d /opt v_lb_install.sh
373 chmod +x v_lb_install.sh
377 # NETWORK_ROLE: private
379 vdns_0_int_private_port_0:
380 type: OS::Neutron::Port
382 network: { get_resource: int_private_network }
383 fixed_ips: [{"subnet": { get_resource: int_private_subnet_0 }, "ip_address": { get_param: vdns_int_private_ip_0 }}]
385 - { get_param: sec_group }
387 # NETWORK_ROLE: onap_private
389 vdns_0_onap_private_port_0:
390 type: OS::Neutron::Port
392 network: { get_param: onap_private_net_id }
393 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vdns_onap_private_ip_0 }}]
395 - { get_param: sec_group }
399 type: OS::Nova::Server
401 image: { get_param: vdns_image_name }
402 flavor: { get_param: vdns_flavor_name }
403 name: { get_param: vdns_name_0 }
404 key_name: { get_resource: my_keypair_0 }
406 - network: { get_param: public_net_id }
407 - port: { get_resource: vdns_0_int_private_port_0 }
408 - port: { get_resource: vdns_0_onap_private_port_0 }
410 vnf_id: { get_param: vnf_id }
411 vf_module_id: { get_param: vf_module_id }
412 vnf_name: { get_param: vnf_name }
413 user_data_format: RAW
417 __lb_oam_int__: { get_param: vlb_onap_private_ip_0 }
418 __lb_private_ipaddr__: { get_param: vlb_int_private_ip_0 }
419 __lb_to_pktgen_if__: { get_param: vlb_int_pktgen_private_ip_0}
420 __local_private_ipaddr__: { get_param: vdns_int_private_ip_0 }
421 __oam_private_ipaddr__: { get_param: vdns_onap_private_ip_0 }
422 __nb_api_version__: { get_param: nb_api_version }
423 __install_script_version__: { get_param: install_script_version }
424 __vlb_private_net_cidr__: { get_param: vlb_private_net_cidr }
425 __onap_private_net_cidr__: { get_param: onap_private_net_cidr }
426 __cloud_env__: { get_param: cloud_env }
427 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
431 # Create configuration files
433 echo "__lb_oam_int__" > /opt/config/lb_oam_int.txt
434 echo "__lb_private_ipaddr__" > /opt/config/lb_private_ipaddr.txt
435 echo "__lb_to_pktgen_if__" > /opt/config/lb_to_pktgen_if.txt
436 echo "__local_private_ipaddr__" > /opt/config/local_private_ipaddr.txt
437 echo "__oam_private_ipaddr__" > /opt/config/oam_private_ipaddr.txt
438 echo "__nb_api_version__" > /opt/config/nb_api_version.txt
439 echo "__install_script_version__" > /opt/config/install_script_version.txt
440 echo "__vlb_private_net_cidr__" > /opt/config/vlb_private_net_cidr.txt
441 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
442 echo "__cloud_env__" > /opt/config/cloud_env.txt
443 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
445 # Download and run install script
447 apt-get -y install unzip
448 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
449 curl -k -L "__nexus_artifact_repo__/service/local/artifact/maven/redirect?r=${REPO}&g=org.onap.demo.vnf.vlbms&a=vlbms-scripts&e=zip&v=__install_script_version__" -o /opt/vlbms-scripts-__install_script_version__.zip
450 unzip -j /opt/vlbms-scripts-__install_script_version__.zip -d /opt v_dns_install.sh
452 chmod +x v_dns_install.sh
456 # NETWORK_ROLE: pktgen_private
458 vpg_0_int_pktgen_private_port_0:
459 type: OS::Neutron::Port
461 network: { get_resource: int_pktgen_private_network }
462 fixed_ips: [{"subnet": { get_resource: int_pktgen_private_subnet_0 }, "ip_address": { get_param: vpg_int_pktgen_private_ip_0 }}]
464 - { get_param: sec_group }
466 # NETWORK_ROLE: onap_private
468 vpg_0_onap_private_port_0:
469 type: OS::Neutron::Port
471 network: { get_param: onap_private_net_id }
472 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vpg_onap_private_ip_0 }}]
474 - { get_param: sec_group }
478 type: OS::Nova::Server
480 image: { get_param: vpg_image_name }
481 flavor: { get_param: vpg_flavor_name }
482 name: { get_param: vpg_name_0 }
483 key_name: { get_resource: my_keypair_0 }
485 vnf_id: { get_param: vnf_id }
486 vf_module_id: { get_param: vf_module_id }
487 vnf_name: { get_param: vnf_name }
489 - network: { get_param: public_net_id }
490 - port: { get_resource: vpg_0_int_pktgen_private_port_0 }
491 - port: { get_resource: vpg_0_onap_private_port_0 }
492 user_data_format: RAW
496 __local_private_ipaddr__: { get_param: vpg_int_pktgen_private_ip_0 }
497 __oam_private_ipaddr__: { get_param: vpg_onap_private_ip_0 }
498 __onap_private_net_cidr__: { get_param: onap_private_net_cidr }
499 __pktgen_private_net_cidr__: { get_param: pktgen_private_net_cidr }
500 __vlb_ipaddr__: { get_param: vlb_int_pktgen_private_ip_0 }
501 __demo_artifacts_version__: { get_param: demo_artifacts_version }
502 __nb_api_version__: { get_param: nb_api_version }
503 __install_script_version__: { get_param: install_script_version }
504 __pg_int__: { get_param: pg_int }
505 __vlb_mac__: { get_attr: [vlb_0_int_pktgen_private_port_0, mac_address] }
506 __cloud_env__: { get_param: cloud_env }
507 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
511 # Create configuration files
513 echo "__oam_private_ipaddr__" > /opt/config/oam_private_ipaddr.txt
514 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
515 echo "__local_private_ipaddr__" > /opt/config/local_private_ipaddr.txt
516 echo "__pktgen_private_net_cidr__" > /opt/config/pktgen_private_net_cidr.txt
517 echo "__vlb_ipaddr__" > /opt/config/vlb_ipaddr.txt
518 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
519 echo "__nb_api_version__" > /opt/config/nb_api_version.txt
520 echo "__install_script_version__" > /opt/config/install_script_version.txt
521 echo "__pg_int__" > /opt/config/pg_int.txt
522 echo "__vlb_mac__" > /opt/config/vlb_mac.txt
523 echo "__cloud_env__" > /opt/config/cloud_env.txt
524 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
526 # Download and run install script
528 apt-get -y install unzip
529 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
530 curl -k -L "__nexus_artifact_repo__/service/local/artifact/maven/redirect?r=${REPO}&g=org.onap.demo.vnf.vlbms&a=vlbms-scripts&e=zip&v=__install_script_version__" -o /opt/vlbms-scripts-__install_script_version__.zip
531 unzip -j /opt/vlbms-scripts-__install_script_version__.zip -d /opt v_packetgen_install.sh
533 chmod +x v_packetgen_install.sh
534 ./v_packetgen_install.sh
537 int_private_subnet_id:
538 value: { get_resource: int_private_subnet_0 }
540 value: { get_resource: int_private_network }