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.
191 # Default parameters prohibited
192 # default: "https://nexus.onap.org"
195 description: ONAP Security Group
196 # all params must be used
199 # description: Enable/disable DNS (by default use true)
210 type: OS::Heat::RandomString
215 type: OS::Nova::KeyPair
219 template: vnfname_base_rand
221 base: { get_param: key_name }
222 rand: { get_resource: random-str_0 }
223 vnfname: { get_param: vnf_name }
224 public_key: { get_param: pub_key }
225 save_private_key: false
227 # NETWORK_ROLE: private
229 type: OS::Neutron::Net
233 template: vnfname_privatenetid
235 privatenetid: { get_param: vlb_private_net_id }
236 vnfname: { get_param: vnf_name }
238 # NETWORK_ROLE: private
239 int_private_subnet_0:
240 type: OS::Neutron::Subnet
244 template: vnfname_privatenetid_subnet
246 privatenetid: { get_param: vlb_private_net_id }
247 vnfname: { get_param: vnf_name }
248 network: { get_resource: int_private_network }
249 cidr: { get_param: vlb_private_net_cidr }
251 # NETWORK_ROLE: pktgen_private
252 int_pktgen_private_network:
253 type: OS::Neutron::Net
257 template: vnfname_privatenetid
259 privatenetid: { get_param: pktgen_private_net_id }
260 vnfname: { get_param: vnf_name }
262 # NETWORK_ROLE: pktgen_private
263 int_pktgen_private_subnet_0:
264 type: OS::Neutron::Subnet
268 template: vnfname_privatenetid_subnet
270 privatenetid: { get_param: pktgen_private_net_id }
271 vnfname: { get_param: vnf_name }
272 network: { get_resource: int_pktgen_private_network }
273 cidr: { get_param: pktgen_private_net_cidr }
275 # NETWORK_ROLE: private
277 vlb_0_int_private_port_0:
278 type: OS::Neutron::Port
280 network: { get_resource: int_private_network }
281 fixed_ips: [{"subnet": { get_resource: int_private_subnet_0 }, "ip_address": { get_param: vlb_int_private_ip_0 }}]
283 - { get_param: sec_group }
285 # NETWORK_ROLE: onap_private
287 vlb_0_onap_private_port_0:
288 type: OS::Neutron::Port
290 network: { get_param: onap_private_net_id }
291 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vlb_onap_private_ip_0 }}]
293 - { get_param: sec_group }
295 # NETWORK_ROLE: pktgen_private
297 vlb_0_int_pktgen_private_port_0:
298 type: OS::Neutron::Port
300 network: { get_resource: int_pktgen_private_network }
301 fixed_ips: [{"subnet": { get_resource: int_pktgen_private_subnet_0 }, "ip_address": { get_param: vlb_int_pktgen_private_ip_0 }}]
303 - { get_param: sec_group }
307 type: OS::Nova::Server
309 image: { get_param: vlb_image_name }
310 flavor: { get_param: vlb_flavor_name }
311 name: { get_param: vlb_name_0 }
312 key_name: { get_resource: my_keypair_0 }
314 - network: { get_param: public_net_id }
315 - port: { get_resource: vlb_0_int_private_port_0 }
316 - port: { get_resource: vlb_0_onap_private_port_0 }
317 - port: { get_resource: vlb_0_int_pktgen_private_port_0 }
319 vnf_id: { get_param: vnf_id }
320 vf_module_id: { get_param: vf_module_id }
321 vnf_name: { get_param: vnf_name }
322 user_data_format: RAW
326 __dcae_collector_ip__: { get_param: dcae_collector_ip }
327 __dcae_collector_port__: { get_param: dcae_collector_port }
328 __ip_to_dns_net__: { get_param: vlb_int_private_ip_0 }
329 __ip_to_pktgen_net__: { get_param: vlb_int_pktgen_private_ip_0 }
330 __oam_vpktgen_ip__: { get_param: vpg_onap_private_ip_0 }
331 __oam_vdns_ip__: { get_param: vdns_onap_private_ip_0 }
332 __vip__: { get_param: vip }
333 __gre_ipaddr__: { get_param: gre_ipaddr }
334 __pktgen_ipaddr__: { get_param: vpg_int_pktgen_private_ip_0 }
335 __vdns_ipaddr__: { get_param: vdns_int_private_ip_0 }
336 __oam_private_ipaddr__: { get_param: vlb_onap_private_ip_0 }
337 __demo_artifacts_version__: { get_param: demo_artifacts_version }
338 __nb_api_version__: { get_param: nb_api_version }
339 __install_script_version__: { get_param: install_script_version }
340 __vlb_private_net_cidr__: { get_param: vlb_private_net_cidr }
341 __onap_private_net_cidr__: { get_param: onap_private_net_cidr }
342 __pktgen_private_net_cidr__: { get_param: pktgen_private_net_cidr }
343 __pktgen_mac__: { get_attr: [vpg_0_int_pktgen_private_port_0, mac_address] }
344 __cloud_env__: { get_param: cloud_env }
345 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
349 # Create configuration files
351 echo "__dcae_collector_ip__" > /opt/config/dcae_collector_ip.txt
352 echo "__dcae_collector_port__" > /opt/config/dcae_collector_port.txt
353 echo "__ip_to_dns_net__" > /opt/config/ip_to_dns_net.txt
354 echo "__ip_to_pktgen_net__" > /opt/config/ip_to_pktgen_net.txt
355 echo "__oam_vpktgen_ip__" > /opt/config/oam_vpktgen_ip.txt
356 echo "__oam_vdns_ip__" > /opt/config/oam_vdns_ip.txt
357 echo "__vip__" > /opt/config/vip.txt
358 echo "__gre_ipaddr__" > /opt/config/gre_ipaddr.txt
359 echo "__pktgen_ipaddr__" > /opt/config/pktgen_ipaddr.txt
360 echo "__vdns_ipaddr__" > /opt/config/vdns_ipaddr.txt
361 echo "__oam_private_ipaddr__" > /opt/config/oam_private_ipaddr.txt
362 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
363 echo "__nb_api_version__" > /opt/config/nb_api_version.txt
364 echo "__install_script_version__" > /opt/config/install_script_version.txt
365 echo "__vlb_private_net_cidr__" > /opt/config/vlb_private_net_cidr.txt
366 echo "__pktgen_private_net_cidr__" > /opt/config/pktgen_private_net_cidr.txt
367 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
368 echo "__pktgen_mac__" > /opt/config/pktgen_mac.txt
369 echo "__cloud_env__" > /opt/config/cloud_env.txt
370 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
372 # Download and run install script
374 apt-get -y install unzip
375 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
376 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
377 unzip -j /opt/vlbms-scripts-__install_script_version__.zip -d /opt v_lb_install.sh
379 chmod +x v_lb_install.sh
383 # NETWORK_ROLE: private
385 vdns_0_int_private_port_0:
386 type: OS::Neutron::Port
388 network: { get_resource: int_private_network }
389 fixed_ips: [{"subnet": { get_resource: int_private_subnet_0 }, "ip_address": { get_param: vdns_int_private_ip_0 }}]
391 - { get_param: sec_group }
393 # NETWORK_ROLE: onap_private
395 vdns_0_onap_private_port_0:
396 type: OS::Neutron::Port
398 network: { get_param: onap_private_net_id }
399 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vdns_onap_private_ip_0 }}]
401 - { get_param: sec_group }
405 type: OS::Nova::Server
407 image: { get_param: vdns_image_name }
408 flavor: { get_param: vdns_flavor_name }
409 name: { get_param: vdns_name_0 }
410 key_name: { get_resource: my_keypair_0 }
412 - network: { get_param: public_net_id }
413 - port: { get_resource: vdns_0_int_private_port_0 }
414 - port: { get_resource: vdns_0_onap_private_port_0 }
416 vnf_id: { get_param: vnf_id }
417 vf_module_id: { get_param: vf_module_id }
418 vnf_name: { get_param: vnf_name }
419 user_data_format: RAW
423 __lb_oam_int__: { get_param: vlb_onap_private_ip_0 }
424 __lb_private_ipaddr__: { get_param: vlb_int_private_ip_0 }
425 __lb_to_pktgen_if__: { get_param: vlb_int_pktgen_private_ip_0}
426 __local_private_ipaddr__: { get_param: vdns_int_private_ip_0 }
427 __oam_private_ipaddr__: { get_param: vdns_onap_private_ip_0 }
428 __nb_api_version__: { get_param: nb_api_version }
429 __install_script_version__: { get_param: install_script_version }
430 __vlb_private_net_cidr__: { get_param: vlb_private_net_cidr }
431 __onap_private_net_cidr__: { get_param: onap_private_net_cidr }
432 __cloud_env__: { get_param: cloud_env }
433 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
437 # Create configuration files
439 echo "__lb_oam_int__" > /opt/config/lb_oam_int.txt
440 echo "__lb_private_ipaddr__" > /opt/config/lb_private_ipaddr.txt
441 echo "__lb_to_pktgen_if__" > /opt/config/lb_to_pktgen_if.txt
442 echo "__local_private_ipaddr__" > /opt/config/local_private_ipaddr.txt
443 echo "__oam_private_ipaddr__" > /opt/config/oam_private_ipaddr.txt
444 echo "__nb_api_version__" > /opt/config/nb_api_version.txt
445 echo "__install_script_version__" > /opt/config/install_script_version.txt
446 echo "__vlb_private_net_cidr__" > /opt/config/vlb_private_net_cidr.txt
447 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
448 echo "__cloud_env__" > /opt/config/cloud_env.txt
449 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
451 # Download and run install script
453 apt-get -y install unzip
454 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
455 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
456 unzip -j /opt/vlbms-scripts-__install_script_version__.zip -d /opt v_dns_install.sh
458 chmod +x v_dns_install.sh
462 # NETWORK_ROLE: pktgen_private
464 vpg_0_int_pktgen_private_port_0:
465 type: OS::Neutron::Port
467 network: { get_resource: int_pktgen_private_network }
468 fixed_ips: [{"subnet": { get_resource: int_pktgen_private_subnet_0 }, "ip_address": { get_param: vpg_int_pktgen_private_ip_0 }}]
470 - { get_param: sec_group }
472 # NETWORK_ROLE: onap_private
474 vpg_0_onap_private_port_0:
475 type: OS::Neutron::Port
477 network: { get_param: onap_private_net_id }
478 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vpg_onap_private_ip_0 }}]
480 - { get_param: sec_group }
484 type: OS::Nova::Server
486 image: { get_param: vpg_image_name }
487 flavor: { get_param: vpg_flavor_name }
488 name: { get_param: vpg_name_0 }
489 key_name: { get_resource: my_keypair_0 }
491 vnf_id: { get_param: vnf_id }
492 vf_module_id: { get_param: vf_module_id }
493 vnf_name: { get_param: vnf_name }
495 - network: { get_param: public_net_id }
496 - port: { get_resource: vpg_0_int_pktgen_private_port_0 }
497 - port: { get_resource: vpg_0_onap_private_port_0 }
498 user_data_format: RAW
502 __local_private_ipaddr__: { get_param: vpg_int_pktgen_private_ip_0 }
503 __oam_private_ipaddr__: { get_param: vpg_onap_private_ip_0 }
504 __onap_private_net_cidr__: { get_param: onap_private_net_cidr }
505 __pktgen_private_net_cidr__: { get_param: pktgen_private_net_cidr }
506 __vlb_ipaddr__: { get_param: vlb_int_pktgen_private_ip_0 }
507 __demo_artifacts_version__: { get_param: demo_artifacts_version }
508 __nb_api_version__: { get_param: nb_api_version }
509 __install_script_version__: { get_param: install_script_version }
510 __pg_int__: { get_param: pg_int }
511 __vlb_mac__: { get_attr: [vlb_0_int_pktgen_private_port_0, mac_address] }
512 __cloud_env__: { get_param: cloud_env }
513 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
517 # Create configuration files
519 echo "__oam_private_ipaddr__" > /opt/config/oam_private_ipaddr.txt
520 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
521 echo "__local_private_ipaddr__" > /opt/config/local_private_ipaddr.txt
522 echo "__pktgen_private_net_cidr__" > /opt/config/pktgen_private_net_cidr.txt
523 echo "__vlb_ipaddr__" > /opt/config/vlb_ipaddr.txt
524 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
525 echo "__nb_api_version__" > /opt/config/nb_api_version.txt
526 echo "__install_script_version__" > /opt/config/install_script_version.txt
527 echo "__pg_int__" > /opt/config/pg_int.txt
528 echo "__vlb_mac__" > /opt/config/vlb_mac.txt
529 echo "__cloud_env__" > /opt/config/cloud_env.txt
530 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
532 # Download and run install script
534 apt-get -y install unzip
535 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
536 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
537 unzip -j /opt/vlbms-scripts-__install_script_version__.zip -d /opt v_packetgen_install.sh
539 chmod +x v_packetgen_install.sh
540 ./v_packetgen_install.sh
543 int_private_subnet_id:
544 value: { get_resource: int_private_subnet_0 }
546 value: { get_resource: int_private_network }