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
140 description: SDNC Model Name metatada
143 description: SDNC Model Version metatada
146 description: SDNC Artifact Name metatada
156 # NETWORK_ROLE: pktgen_private
158 vpg_0_int_pktgen_private_port_0:
159 type: OS::Neutron::Port
161 network: { get_param: int_pktgen_private_net_id }
162 fixed_ips: [{"subnet": { get_param: int_pktgen_private_subnet_id }, "ip_address": { get_param: vpg_int_pktgen_private_ip_0 }}]
163 mac_address: { get_param: vpg_0_mac_address }
165 - { get_param: sec_group }
167 # NETWORK_ROLE: onap_private
169 vpg_0_onap_private_port_0:
170 type: OS::Neutron::Port
172 network: { get_param: onap_private_net_id }
173 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vpg_onap_private_ip_0 }}]
175 - { get_param: sec_group }
179 type: OS::Nova::Server
181 image: { get_param: vpg_image_name }
182 flavor: { get_param: vpg_flavor_name }
183 name: { get_param: vpg_name_0 }
184 key_name: { get_param: keypair }
186 vnf_id: { get_param: vnf_id }
187 vf_module_id: { get_param: vf_module_id }
188 vnf_name: { get_param: vnf_name }
189 sdnc_model_name: { get_param: sdnc_model_name }
190 sdnc_model_version: { get_param: sdnc_model_version }
191 sdnc_artifact_name: { get_param: sdnc_artifact_name }
193 - network: { get_param: public_net_id }
194 - port: { get_resource: vpg_0_int_pktgen_private_port_0 }
195 - port: { get_resource: vpg_0_onap_private_port_0 }
196 user_data_format: RAW
200 __local_private_ipaddr__: { get_param: vpg_int_pktgen_private_ip_0 }
201 __oam_private_ipaddr__: { get_param: vpg_onap_private_ip_0 }
202 __onap_private_net_cidr__: { get_param: onap_private_net_cidr }
203 __pktgen_private_net_cidr__: { get_param: pktgen_private_net_cidr }
204 __vlb_ipaddr__: { get_param: vlb_int_pktgen_private_ip_0 }
205 __demo_artifacts_version__: { get_param: demo_artifacts_version }
206 __nb_api_version__: { get_param: nb_api_version }
207 __install_script_version__: { get_param: install_script_version }
208 __pg_int__: { get_param: pg_int }
209 __vlb_mac__: { get_param: vlb_0_mac_address }
210 __cloud_env__: { get_param: cloud_env }
211 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
215 # Create configuration files
217 echo "__oam_private_ipaddr__" > /opt/config/oam_private_ipaddr.txt
218 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
219 echo "__local_private_ipaddr__" > /opt/config/local_private_ipaddr.txt
220 echo "__pktgen_private_net_cidr__" > /opt/config/pktgen_private_net_cidr.txt
221 echo "__vlb_ipaddr__" > /opt/config/vlb_ipaddr.txt
222 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
223 echo "__nb_api_version__" > /opt/config/nb_api_version.txt
224 echo "__install_script_version__" > /opt/config/install_script_version.txt
225 echo "__pg_int__" > /opt/config/pg_int.txt
226 echo "__vlb_mac__" > /opt/config/vlb_mac.txt
227 echo "__cloud_env__" > /opt/config/cloud_env.txt
228 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
230 # Download and run install script
232 apt-get -y install unzip
233 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
234 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
235 unzip -j /opt/vlbms-scripts-__install_script_version__.zip -d /opt v_packetgen_install.sh
237 chmod +x v_packetgen_install.sh
238 ./v_packetgen_install.sh