1 ##########################################################################
3 #==================LICENSE_START==========================================
6 # Copyright 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 vCPE vBRG Emulator (vBRGEMU)
29 #######################################################################
33 # 0_port should get IP address from DHCP discover through vBNG #
34 # DCAE is not monitoring the BRGEMULATOR #
35 #######################################################################
40 label: Image name or ID
41 description: Image to be used for compute instance
45 description: Type of instance (flavor) to be used
48 label: Public network name or ID
49 description: Public network that enables remote connection to VNF
50 vbrgemu_bng_private_net_id:
52 label: vBNG private network name or ID
53 description: Private network that connects vBRGEMU to vBNG
54 vbrgemu_bng_private_subnet_id:
56 label: vBNG private sub-network name or ID
57 description: vBNG private sub-network name or ID
58 vbrgemu_bng_private_net_cidr:
60 label: vBNG IN private network CIDR
61 description: The CIDR of the input side of vBNG private network
62 # vbrgemu_private_net_id:
64 # label: vBRGEMU Home private network name or ID
65 # description: Private network that connects vBRGEMU to local devices
66 #vbrgemu_private_net_cidr:
68 # label: vBRGEMU Home private network CIDR
69 # description: The CIDR of the input side of vBRGEMU Home private network
70 ## vbrgemu_private_ip_0:
72 ## label: vGW private IP address
73 ## description: Private IP address towards the BRGEMU-BNG network
74 ## VPP will use DHCP so does not need to be provided by preload
75 #vbrgemu_private_ip_1:
77 # label: vGW private IP address
78 # description: Private IP address towards the BRGEMU private network
82 description: Name of the vBRG
86 description: The VNF ID is provided by ONAP
90 description: The vCPE Module ID is provided by ONAP
94 description: Public/Private key pair name
98 description: Public key to be installed on the compute instance
101 label: Repository URL
102 description: URL of the repository that hosts the demo packages
105 label: Installation script version number
106 description: Version number of the scripts that install the vFW demo app
107 demo_artifacts_version:
109 label: Artifacts version used in demo vnfs
110 description: Artifacts (jar, tar.gz) version used in demo vnfs
113 description: Root URL for the Nexus repository for Maven artifacts.
114 default: "https://nexus.onap.org"
117 label: Cloud environment
118 description: Cloud environment (e.g., openstack, rackspace)
121 label: SDNC ip address
122 description: SDNC ip address used to set NAT
126 description: State to compile code or not; included for backwards compatibility
137 type: OS::Heat::RandomString
142 type: OS::Nova::KeyPair
148 base: { get_param: key_name }
149 rand: { get_resource: random-str }
150 public_key: { get_param: pub_key }
151 save_private_key: false
153 #vbrgemu_private_network:
154 # type: OS::Neutron::Net
156 # name: { get_param: vbrgemu_private_net_id }
158 #vbrgemu_private_subnet:
159 # type: OS::Neutron::Subnet
161 # name: { get_param: vbrgemu_private_net_id }
162 # network_id: { get_resource: vbrgemu_private_network }
163 # cidr: { get_param: vbrgemu_private_net_cidr }
165 # Virtual BRG Emulator Instantiation
166 # 0_port should get IP address from DHCP discover through vBNG once the VNF is running
167 vbrgemu_private_0_port:
168 type: OS::Neutron::Port
170 network: { get_param: vbrgemu_bng_private_net_id }
171 # fixed_ips: [{"subnet": { get_param: vbrgemu_bng_private_subnet_id }}]
172 ## fixed_ips: [{"subnet": { get_param: vbrgemu_bng_private_subnet_id }, "ip_address": { get_param: vbrgemu_private_ip_0 }}]
174 #vbrgemu_private_1_port:
175 # type: OS::Neutron::Port
177 # network: { get_resource: vbrgemu_private_network }
178 # fixed_ips: [{"subnet": { get_resource: vbrgemu_private_subnet }, "ip_address": { get_param: vbrgemu_private_ip_1 }}]
181 type: OS::Nova::Server
183 image: { get_param: vcpe_image_name }
184 flavor: { get_param: vcpe_flavor_name }
185 name: { get_param: vbrgemu_name_0 }
186 key_name: { get_resource: my_keypair }
188 - network: { get_param: public_net_id }
189 - port: { get_resource: vbrgemu_private_0_port }
190 #- port: { get_resource: vbrgemu_private_1_port }
191 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
192 user_data_format: RAW
196 # __brgemu_net_ipaddr__: { get_param: vbrgemu_private_ip_1 }
197 # __brgemu_cidr__: { get_param: vbrgemu_private_net_cidr }
198 __brgemu_bng_private_net_cidr__: { get_param: vbrgemu_bng_private_net_cidr }
199 __repo_url_artifacts__ : { get_param: repo_url_artifacts }
200 __demo_artifacts_version__ : { get_param: demo_artifacts_version }
201 __script_version__ : { get_param: script_version }
202 __cloud_env__ : { get_param: cloud_env }
203 __sdnc_ip__ : { get_param: sdnc_ip }
204 __compile_state__ : { get_param: compile_state }
205 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
209 # Create configuration files
211 #echo "__brgemu_net_ipaddr__" > /opt/config/brgemu_net_ipaddr.txt
212 #echo "__brgemu_cidr__" > /opt/config/brgemu_net_cidr.txt
213 echo "__brgemu_bng_private_net_cidr__" > /opt/config/brgemu_bng_private_net_cidr.txt
214 echo "__repo_url_artifacts__" > /opt/config/repo_url_artifacts.txt
215 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
216 echo "__script_version__" > /opt/config/script_version.txt
217 echo "__cloud_env__" > /opt/config/cloud_env.txt
218 echo "__sdnc_ip__" > /opt/config/sdnc_ip.txt
219 echo "__compile_state__" > /opt/config/compile_state.txt
220 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
222 # Download and run install script
223 apt-get -y install unzip
224 if [[ "__script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
225 curl -k -L "__nexus_artifact_repo__/service/local/artifact/maven/redirect?r=${REPO}&g=org.onap.demo.vnf.vcpe&a=vcpe-scripts&e=zip&v=__script_version__" -o /opt/vcpe-scripts-__script_version__.zip
226 unzip -j /opt/vcpe-scripts-__script_version__.zip -d /opt v_brgemu_install.sh
228 chmod +x v_brgemu_install.sh
229 ./v_brgemu_install.sh