1 ##########################################################################
3 #==================LICENSE_START==========================================
6 # Copyright (c) 2019 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 that deploys a vPacketGen 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: Public network name or ID
47 description: Public network that enables remote connection to VNF
48 int_pktgen_private_net_id:
50 label: vPacketGen private network name or ID
51 description: Private network that connects vLoadBalancer with vPacketGen
52 int_pktgen_private_subnet_id:
54 label: vPacketGen private subnet name or ID
55 description: Private subnet of the network that connects vLoadBalancer with vPacketGen
58 label: ONAP management network name or ID
59 description: Private network that connects ONAP component and the VNF
60 onap_private_subnet_id:
62 label: ONAP management sub-network name or ID
63 description: Private sub-network that connects ONAP component and the VNF
64 pktgen_private_net_cidr:
66 label: vPacketGen private network CIDR
67 description: The CIDR of the vPacketGen private network
68 onap_private_net_cidr:
70 label: ONAP private network CIDR
71 description: The CIDR of the protected private network
72 vpg_int_pktgen_private_ip_0:
74 label: vPacketGen private IP address towards the vPacketGen private network
75 description: Private IP address that is assigned to the vPacketGen to communicate with the vLoadBalancer
76 vpg_onap_private_ip_0:
78 label: vPacketGen private IP address towards the ONAP management network
79 description: Private IP address that is assigned to the vPacketGen to communicate with ONAP components
80 vlb_int_pktgen_private_ip_0:
82 label: vLoadBalancer private IP address towards the vPacketGen network
83 description: Private IP address that is assigned to the vLoadBalancer to communicate with vPacketGen
86 label: vLB MAC address
87 description: MAC address of the vLB used by the vPacketGen VM
90 label: vPacketGen MAC address
91 description: MAC address of the vPacketGen used by the vLB VM
94 label: IP Address of the output vPacketGen interface
95 description: IP address assigned to the output interface of the vPacketGen's VPP layer
99 description: Name of the vPKTGEN
103 description: The VNF ID is provided by ONAP
107 description: The VNF NAME is provided by ONAP
110 label: vFirewall module ID
111 description: The vLoadBalancer Module ID is provided by ONAP
115 description: Public/Private key pair name
116 demo_artifacts_version:
118 label: Artifacts version used in demo vnfs
119 description: Version number for downloading the vPacketGen streams for VPP and VES
122 label: Northbound API version
123 description: Version number of the health check and config APIs
124 install_script_version:
126 label: Installation script version number
127 description: Version number of the scripts that install the vLB demo app
130 label: Cloud environment
131 description: Cloud environment (e.g., openstack, rackspace)
134 description: Root URL for the Nexus repository for Maven artifacts.
137 description: ONAP Security Group
147 # NETWORK_ROLE: pktgen_private
149 vpg_0_int_pktgen_private_port_0:
150 type: OS::Neutron::Port
152 network: { get_param: int_pktgen_private_net_id }
153 fixed_ips: [{"subnet": { get_param: int_pktgen_private_subnet_id }, "ip_address": { get_param: vpg_int_pktgen_private_ip_0 }}]
154 mac_address: { get_param: vpg_0_mac_address }
156 - { get_param: sec_group }
158 # NETWORK_ROLE: onap_private
160 vpg_0_onap_private_port_0:
161 type: OS::Neutron::Port
163 network: { get_param: onap_private_net_id }
164 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vpg_onap_private_ip_0 }}]
166 - { get_param: sec_group }
170 type: OS::Nova::Server
172 image: { get_param: vpg_image_name }
173 flavor: { get_param: vpg_flavor_name }
174 name: { get_param: vpg_name_0 }
175 key_name: { get_param: keypair }
177 vnf_id: { get_param: vnf_id }
178 vf_module_id: { get_param: vf_module_id }
179 vnf_name: { get_param: vnf_name }
181 - network: { get_param: public_net_id }
182 - port: { get_resource: vpg_0_int_pktgen_private_port_0 }
183 - port: { get_resource: vpg_0_onap_private_port_0 }
184 user_data_format: RAW
188 __local_private_ipaddr__: { get_param: vpg_int_pktgen_private_ip_0 }
189 __oam_private_ipaddr__: { get_param: vpg_onap_private_ip_0 }
190 __onap_private_net_cidr__: { get_param: onap_private_net_cidr }
191 __pktgen_private_net_cidr__: { get_param: pktgen_private_net_cidr }
192 __vlb_ipaddr__: { get_param: vlb_int_pktgen_private_ip_0 }
193 __demo_artifacts_version__: { get_param: demo_artifacts_version }
194 __nb_api_version__: { get_param: nb_api_version }
195 __install_script_version__: { get_param: install_script_version }
196 __pg_int__: { get_param: pg_int }
197 __vlb_mac__: { get_param: vlb_0_mac_address }
198 __cloud_env__: { get_param: cloud_env }
199 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
203 # Create configuration files
205 echo "__oam_private_ipaddr__" > /opt/config/oam_private_ipaddr.txt
206 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
207 echo "__local_private_ipaddr__" > /opt/config/local_private_ipaddr.txt
208 echo "__pktgen_private_net_cidr__" > /opt/config/pktgen_private_net_cidr.txt
209 echo "__vlb_ipaddr__" > /opt/config/vlb_ipaddr.txt
210 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
211 echo "__nb_api_version__" > /opt/config/nb_api_version.txt
212 echo "__install_script_version__" > /opt/config/install_script_version.txt
213 echo "__pg_int__" > /opt/config/pg_int.txt
214 echo "__vlb_mac__" > /opt/config/vlb_mac.txt
215 echo "__cloud_env__" > /opt/config/cloud_env.txt
216 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
218 # Download and run install script
220 apt-get -y install unzip
221 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
222 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
223 unzip -j /opt/vlbms-scripts-__install_script_version__.zip -d /opt v_packetgen_install.sh
225 chmod +x v_packetgen_install.sh
226 ./v_packetgen_install.sh