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
64 vlb_private_provider_net:
66 label: name of provider network to be used to create vlb_private_net
67 description: provider network for private network that connects vLoadBalancer with vDNSs
68 pktgen_private_provider_net:
70 label: name of provider network to be used to create pktgen_private_net_id
71 description: provider network for private network that connects vLoadBalancer with vPacketGen
74 label: ONAP management network name or ID
75 description: Private network that connects ONAP component and the VNF
76 onap_private_subnet_id:
78 label: ONAP 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
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
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
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
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
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
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
120 vlb_private_0_port_vnic_type:
122 description: vlb port 0 vnic type (normal, direct)
124 vlb_private_1_port_vnic_type:
126 description: vlb port 1 vnic type (normal, direct)
128 vlb_private_2_port_vnic_type:
130 description: vlb port 2 vnic type (normal, direct)
132 vpg_private_0_port_vnic_type:
134 description: vpg port 0 vnic type (normal, direct)
136 vpg_private_1_port_vnic_type:
138 description: vpg port 1 vnic type (normal, direct)
140 vdns_private_0_port_vnic_type:
142 description: vdns port 0 vnic type (normal, direct)
144 vdns_private_1_port_vnic_type:
146 description: vdns port 1 vnic type (normal, direct)
150 label: Virtual Private IP of the vLoadBalancer
151 description: Virtual Private IP that is assigned to the vLoadBalancer's VPP layer
154 label: IP Address of the GRE tunnel
155 description: IP address assigned to the GRE tunnel on the vLoadBalancer
158 label: IP Address of the output vPacketGen interface
159 description: IP address assigned to the output interface of the vPacketGen's VPP layer
162 label: vLoadBalancer name
163 description: Name of the vLoadBalancer
167 description: Name of the vDNS
171 description: Name of the vPKTGEN
175 description: The VNF ID is provided by ONAP
178 label: vFirewall module ID
179 description: The vLoadBalancer Module ID is provided by ONAP
182 label: DCAE collector IP address
183 description: IP address of the DCAE collector
186 label: DCAE collector port
187 description: Port of the DCAE collector
191 description: Public/Private key pair name
195 description: Public key to be installed on the compute instance
196 demo_artifacts_version:
198 label: Artifacts version used in demo vnfs
199 description: Artifacts (jar, tar.gz) version used in demo vnfs
202 description: Root URL for the Nexus repository for Maven artifacts.
203 default: "https://nexus.onap.org"
204 install_script_version:
206 label: Installation script version number
207 description: Version number of the scripts that install the vFW demo app
210 label: Cloud environment
211 description: Cloud environment (e.g., openstack, rackspace)
214 description: ONAP Security Group
226 type: OS::Heat::RandomString
231 type: OS::Nova::KeyPair
237 base: { get_param: key_name }
238 rand: { get_resource: random-str }
239 public_key: { get_param: pub_key }
240 save_private_key: false
243 type: OS::Neutron::ProviderNet
245 name: { get_param: vlb_private_net_id }
246 physical_network: {get_param: vlb_private_provider_net}
250 type: OS::Neutron::Subnet
252 name: { get_param: vlb_private_net_id }
253 network_id: { get_resource: vlb_private_network }
254 cidr: { get_param: vlb_private_net_cidr }
256 pktgen_private_network:
257 type: OS::Neutron::ProviderNet
259 name: { get_param: pktgen_private_net_id }
260 physical_network: {get_param: pktgen_private_provider_net}
263 pktgen_private_subnet:
264 type: OS::Neutron::Subnet
266 name: { get_param: pktgen_private_net_id }
267 network_id: { get_resource: pktgen_private_network }
268 cidr: { get_param: pktgen_private_net_cidr }
271 type: OS::Neutron::Port
273 network: { get_resource: vlb_private_network }
274 binding:vnic_type: { get_param: vlb_private_0_port_vnic_type}
275 fixed_ips: [{"subnet": { get_resource: vlb_private_subnet }, "ip_address": { get_param: vlb_private_ip_0 }}]
277 - { get_param: sec_group }
281 type: OS::Neutron::Port
283 network: { get_param: onap_private_net_id }
284 binding:vnic_type: { get_param: vlb_private_1_port_vnic_type}
285 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vlb_private_ip_1 }}]
287 - { get_param: sec_group }
290 type: OS::Neutron::Port
292 network: { get_resource: pktgen_private_network }
293 binding:vnic_type: { get_param: vlb_private_2_port_vnic_type}
294 fixed_ips: [{"subnet": { get_resource: pktgen_private_subnet }, "ip_address": { get_param: vlb_private_ip_2 }}]
296 - { get_param: sec_group }
299 type: OS::Nova::Server
301 image: { get_param: vlb_image_name }
302 flavor: { get_param: vlb_flavor_name }
303 name: { get_param: vlb_name_0 }
304 key_name: { get_resource: my_keypair }
306 - network: { get_param: public_net_id }
307 - port: { get_resource: vlb_private_0_port }
308 - port: { get_resource: vlb_private_1_port }
309 - port: { get_resource: vlb_private_2_port }
310 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
311 user_data_format: RAW
315 __dcae_collector_ip__: { get_param: dcae_collector_ip }
316 __dcae_collector_port__: { get_param: dcae_collector_port }
317 __ip_to_dns_net__: { get_param: vlb_private_ip_0 }
318 __ip_to_pktgen_net__: { get_param: vlb_private_ip_2 }
319 __vip__: { get_param: vip }
320 __gre_ipaddr__: { get_param: gre_ipaddr }
321 __pktgen_ipaddr__: { get_param: vpg_private_ip_0 }
322 __oam_private_ipaddr__: { get_param: vlb_private_ip_1 }
323 __demo_artifacts_version__: { get_param: demo_artifacts_version }
324 __install_script_version__: { get_param: install_script_version }
325 __vlb_private_net_cidr__: { get_param: vlb_private_net_cidr }
326 __onap_private_net_cidr__: { get_param: onap_private_net_cidr }
327 __pktgen_private_net_cidr__: { get_param: pktgen_private_net_cidr }
328 __pktgen_mac__: { get_attr: [vpg_private_0_port, mac_address] }
329 __cloud_env__: { get_param: cloud_env }
330 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
334 # Create configuration files
336 echo "__dcae_collector_ip__" > /opt/config/dcae_collector_ip.txt
337 echo "__dcae_collector_port__" > /opt/config/dcae_collector_port.txt
338 echo "__ip_to_dns_net__" > /opt/config/ip_to_dns_net.txt
339 echo "__ip_to_pktgen_net__" > /opt/config/ip_to_pktgen_net.txt
340 echo "__vip__" > /opt/config/vip.txt
341 echo "__gre_ipaddr__" > /opt/config/gre_ipaddr.txt
342 echo "__pktgen_ipaddr__" > /opt/config/pktgen_ipaddr.txt
343 echo "__oam_private_ipaddr__" > /opt/config/oam_private_ipaddr.txt
344 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
345 echo "__install_script_version__" > /opt/config/install_script_version.txt
346 echo "__vlb_private_net_cidr__" > /opt/config/vlb_private_net_cidr.txt
347 echo "__pktgen_private_net_cidr__" > /opt/config/pktgen_private_net_cidr.txt
348 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
349 echo "__pktgen_mac__" > /opt/config/pktgen_mac.txt
350 echo "__cloud_env__" > /opt/config/cloud_env.txt
351 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
353 # Download and run install script
355 apt-get -y install unzip
356 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
357 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
358 unzip -j /opt/vlb-scripts-__install_script_version__.zip -d /opt v_lb_install.sh
360 chmod +x v_lb_install.sh
365 type: OS::Neutron::Port
367 network: { get_resource: vlb_private_network }
368 binding:vnic_type: { get_param: vdns_private_0_port_vnic_type}
369 fixed_ips: [{"subnet": { get_resource: vlb_private_subnet }, "ip_address": { get_param: vdns_private_ip_0 }}]
371 - { get_param: sec_group }
374 type: OS::Neutron::Port
376 network: { get_param: onap_private_net_id }
377 binding:vnic_type: { get_param: vdns_private_1_port_vnic_type}
378 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vdns_private_ip_1 }}]
380 - { get_param: sec_group }
384 type: OS::Nova::Server
386 image: { get_param: vlb_image_name }
387 flavor: { get_param: vdns_flavor_name }
388 name: { get_param: vdns_name_0 }
389 key_name: { get_resource: my_keypair }
391 - network: { get_param: public_net_id }
392 - port: { get_resource: vdns_private_0_port }
393 - port: { get_resource: vdns_private_1_port }
394 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
395 user_data_format: RAW
399 __lb_oam_int__: { get_param: vlb_private_ip_1 }
400 __lb_private_ipaddr__: { get_param: vlb_private_ip_0 }
401 __local_private_ipaddr__: { get_param: vdns_private_ip_0 }
402 __oam_private_ipaddr__: { get_param: vdns_private_ip_1 }
403 __demo_artifacts_version__: { get_param: demo_artifacts_version }
404 __install_script_version__: { get_param: install_script_version }
405 __vlb_private_net_cidr__: { get_param: vlb_private_net_cidr }
406 __onap_private_net_cidr__: { get_param: onap_private_net_cidr }
407 __cloud_env__: { get_param: cloud_env }
408 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
412 # Create configuration files
414 echo "__lb_oam_int__" > /opt/config/lb_oam_int.txt
415 echo "__lb_private_ipaddr__" > /opt/config/lb_private_ipaddr.txt
416 echo "__local_private_ipaddr__" > /opt/config/local_private_ipaddr.txt
417 echo "__oam_private_ipaddr__" > /opt/config/oam_private_ipaddr.txt
418 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
419 echo "__install_script_version__" > /opt/config/install_script_version.txt
420 echo "__vlb_private_net_cidr__" > /opt/config/vlb_private_net_cidr.txt
421 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
422 echo "__cloud_env__" > /opt/config/cloud_env.txt
423 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
425 # Download and run install script
427 apt-get -y install unzip
428 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
429 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
430 unzip -j /opt/vlb-scripts-__install_script_version__.zip -d /opt v_dns_install.sh
432 chmod +x v_dns_install.sh
437 type: OS::Neutron::Port
439 network: { get_resource: pktgen_private_network }
440 binding:vnic_type: { get_param: vpg_private_0_port_vnic_type}
441 fixed_ips: [{"subnet": { get_resource: pktgen_private_subnet }, "ip_address": { get_param: vpg_private_ip_0 }}]
443 - { get_param: sec_group }
446 type: OS::Neutron::Port
448 network: { get_param: onap_private_net_id }
449 binding:vnic_type: { get_param: vpg_private_1_port_vnic_type}
450 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vpg_private_ip_1 }}]
452 - { get_param: sec_group }
455 type: OS::Nova::Server
457 image: { get_param: vlb_image_name }
458 flavor: { get_param: vpg_flavor_name }
459 name: { get_param: vpg_name_0 }
460 key_name: { get_resource: my_keypair }
462 - network: { get_param: public_net_id }
463 - port: { get_resource: vpg_private_0_port }
464 - port: { get_resource: vpg_private_1_port }
465 user_data_format: RAW
469 __local_private_ipaddr__: { get_param: vpg_private_ip_0 }
470 __oam_private_ipaddr__: { get_param: vpg_private_ip_1 }
471 __onap_private_net_cidr__: { get_param: onap_private_net_cidr }
472 __pktgen_private_net_cidr__: { get_param: pktgen_private_net_cidr }
473 __vlb_ipaddr__: { get_param: vlb_private_ip_2 }
474 __demo_artifacts_version__: { get_param: demo_artifacts_version }
475 __install_script_version__: { get_param: install_script_version }
476 __pg_int__: { get_param: pg_int }
477 __vlb_mac__: { get_attr: [vlb_private_2_port, mac_address] }
478 __cloud_env__: { get_param: cloud_env }
479 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
483 # Create configuration files
485 echo "__oam_private_ipaddr__" > /opt/config/oam_private_ipaddr.txt
486 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
487 echo "__local_private_ipaddr__" > /opt/config/local_private_ipaddr.txt
488 echo "__pktgen_private_net_cidr__" > /opt/config/pktgen_private_net_cidr.txt
489 echo "__vlb_ipaddr__" > /opt/config/vlb_ipaddr.txt
490 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
491 echo "__install_script_version__" > /opt/config/install_script_version.txt
492 echo "__pg_int__" > /opt/config/pg_int.txt
493 echo "__vlb_mac__" > /opt/config/vlb_mac.txt
494 echo "__cloud_env__" > /opt/config/cloud_env.txt
495 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
497 # Download and run install script
499 apt-get -y install unzip
500 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
501 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
502 unzip -j /opt/vlb-scripts-__install_script_version__.zip -d /opt v_packetgen_install.sh
504 chmod +x v_packetgen_install.sh
505 ./v_packetgen_install.sh