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 that deploys the vFirewall Traffic Generator 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: Public network name or ID
47 description: Public network that enables remote connection to VNF
48 unprotected_private_net_id:
50 label: Unprotected private network name or ID
51 description: Private network that connects vPacketGenerator with vFirewall
52 unprotected_private_subnet_id:
54 label: Unprotected private sub-network name or ID
55 description: Private subnetwork for the unprotected network
56 unprotected_private_net_cidr:
58 label: Unprotected private network CIDR
59 description: The CIDR of the unprotected private network
60 protected_private_net_cidr:
62 label: Protected private network CIDR
63 description: The CIDR of the protected private network
66 label: ONAP management network name or ID
67 description: Private network that connects ONAP components and the VNF
68 onap_private_subnet_id:
70 label: ONAP management sub-network name or ID
71 description: Private sub-network that connects ONAP components and the VNF
72 onap_private_net_cidr:
74 label: ONAP private network CIDR
75 description: The CIDR of the protected private network
78 label: vFirewall private IP address towards the unprotected network
79 description: Private IP address that is assigned to the vFirewall to communicate with the vPacketGenerator
82 label: vSink private IP address towards the protected network
83 description: Private IP address that is assigned to the vSink to communicate with the vFirewall
86 label: vPacketGenerator private IP address towards the unprotected network
87 description: Private IP address that is assigned to the vPacketGenerator to communicate with the vFirewall
90 label: vPacketGenerator private IP address towards the ONAP management network
91 description: Private IP address that is assigned to the vPacketGenerator to communicate with ONAP components
94 label: vPacketGenerator name
95 description: Name of the vPacketGenerator
99 description: The VNF ID is provided by ONAP
102 label: vPNG Traffic Generator module ID
103 description: The vPNG Module ID is provided by ONAP
107 description: Public/Private key pair name
111 description: Public key to be installed on the compute instance
114 label: Repository URL
115 description: URL of the repository that hosts the demo packages
116 install_script_version:
118 label: Installation script version number
119 description: Version number of the scripts that install the vFW demo app
120 demo_artifacts_version:
122 label: Artifacts version used in demo vnfs
123 description: Artifacts (jar, tar.gz) version used in demo vnfs
126 description: Root URL for the Nexus repository for Maven artifacts.
127 default: "https://nexus.onap.org"
130 label: Cloud environment
131 description: Cloud environment (e.g., openstack, rackspace)
141 type: OS::Heat::RandomString
146 type: OS::Nova::KeyPair
152 base: { get_param: key_name }
153 rand: { get_resource: random-str }
154 public_key: { get_param: pub_key }
155 save_private_key: false
158 # Virtual Packet Generator instantiation
160 type: OS::Neutron::Port
162 network: { get_param: unprotected_private_net_id }
163 fixed_ips: [{"subnet": { get_param: unprotected_private_subnet_id }, "ip_address": { get_param: vpg_private_ip_0 }}]
166 type: OS::Neutron::Port
168 network: { get_param: onap_private_net_id }
169 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vpg_private_ip_1 }}]
172 type: OS::Nova::Server
174 image: { get_param: image_name }
175 flavor: { get_param: flavor_name }
176 name: { get_param: vpg_name_0 }
177 key_name: { get_resource: my_keypair }
179 - network: { get_param: public_net_id }
180 - port: { get_resource: vpg_private_0_port }
181 - port: { get_resource: vpg_private_1_port }
182 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
183 user_data_format: RAW
187 __fw_ipaddr__: { get_param: vfw_private_ip_0 }
188 __protected_net_cidr__: { get_param: protected_private_net_cidr }
189 __sink_ipaddr__: { get_param: vsn_private_ip_0 }
190 __repo_url_artifacts__ : { get_param: repo_url_artifacts }
191 __demo_artifacts_version__ : { get_param: demo_artifacts_version }
192 __install_script_version__ : { get_param: install_script_version }
193 __vpg_private_ip_0__ : { get_param: vpg_private_ip_0 }
194 __vpg_private_ip_1__ : { get_param: vpg_private_ip_1 }
195 __unprotected_private_net_cidr__ : { get_param: unprotected_private_net_cidr }
196 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
197 __cloud_env__ : { get_param: cloud_env }
198 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
202 # Create configuration files
204 echo "__fw_ipaddr__" > /opt/config/fw_ipaddr.txt
205 echo "__protected_net_cidr__" > /opt/config/protected_net_cidr.txt
206 echo "__sink_ipaddr__" > /opt/config/sink_ipaddr.txt
207 echo "__repo_url_artifacts__" > /opt/config/repo_url_artifacts.txt
208 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
209 echo "__install_script_version__" > /opt/config/install_script_version.txt
210 echo "__vpg_private_ip_0__" > /opt/config/vpg_private_ip_0.txt
211 echo "__vpg_private_ip_1__" > /opt/config/vpg_private_ip_1.txt
212 echo "__unprotected_private_net_cidr__" > /opt/config/unprotected_private_net_cidr.txt
213 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
214 echo "__cloud_env__" > /opt/config/cloud_env.txt
215 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
217 # Download and run install script
218 apt-get -y install unzip
219 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
220 curl -k -L "__nexus_artifact_repo__/service/local/artifact/maven/redirect?r=${REPO}&g=org.onap.demo.vnf.vfw&a=vfw-scripts&e=zip&v=__install_script_version__" -o /opt/vfw-scripts-__install_script_version__.zip
221 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_packetgen_install.sh
223 chmod +x v_packetgen_install.sh
224 ./v_packetgen_install.sh