Update INFO.yaml with new PTL
[demo.git] / heat / vCPE / vbng / base_vcpe_vbng_rackspace.yaml
1 ##########################################################################
2 #
3 #==================LICENSE_START==========================================
4 #
5 #
6 # Copyright 2017 AT&T Intellectual Property. All rights reserved.
7 #
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
12 #
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.
18 #
19 #==================LICENSE_END============================================
20 #
21 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
22 #
23 ##########################################################################
24
25 heat_template_version: 2013-05-23
26
27 description: Heat template to deploy vCPE virtual Broadband Network Gateway (vBNG) for ONAP
28
29 ##############
30 #            #
31 # PARAMETERS #
32 #            #
33 ##############
34
35 parameters:
36   vcpe_image_name:
37     type: string
38     label: Image name or ID
39     description: Image to be used for compute instance
40   vcpe_flavor_name:
41     type: string
42     label: Flavor
43     description: Type of instance (flavor) to be used
44   public_net_id:
45     type: string
46     label: Public network name or ID
47     description: Public network that enables remote connection to VNF
48   brgemu_bng_private_net_id:
49     type: string
50     label: vBNG IN private network name or ID
51     description: Private network that connects vBRG to vBNG
52   brgemu_bng_private_net_cidr:
53     type: string
54     label: vBNG IN private network CIDR
55     description: The CIDR of the input side of vBNG private network
56   bng_gmux_private_net_id:
57     type: string
58     label: vBNG vGMUX private network name or ID
59     description: Private network that connects vBNG to vGMUX
60   bng_gmux_private_net_cidr:
61     type: string
62     label: vGMUX private network CIDR
63     description: The CIDR of the input side of vGMUX private network
64   onap_private_net_id:
65     type: string
66     label: ONAP management network name or ID
67     description: Private network that connects ONAP components and the VNF
68   onap_private_subnet_id:
69     type: string
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:
73     type: string
74     label: ONAP private network CIDR
75     description: The CIDR of the protected private network
76   cpe_signal_net_id:
77     type: string
78     label: vCPE private network name or ID
79     description: Private network that connects vCPE elements with vCPE infrastructure elements
80   cpe_signal_private_net_cidr:
81     type: string
82     label: vAAA private network CIDR
83     description: The CIDR of the vAAA private network
84   vbng_private_ip_0:
85     type: string
86     label: vBNG IN private IP address
87     description: Private IP address that is assigned to the vBNG IN
88   vbng_private_ip_1:
89     type: string
90     label: vBNG private IP address towards the ONAP management network
91     description: Private IP address that is assigned to the vBNG to communicate with ONAP components
92   vbng_private_ip_2:
93     type: string
94     label: vBNG to CPE_SIGNAL private IP address
95     description: Private IP address that is assigned to the vBNG in the CPE_SIGNAL network
96   vbng_private_ip_3:
97     type: string
98     label: vBNG to vGMUX private IP address
99     description: Private IP address that is assigned to the vBNG to vGMUX port
100   vbng_name_0:
101     type: string
102     label: vBNG name
103     description: Name of the vBNG
104   vnf_id:
105     type: string
106     label: VNF ID
107     description: The VNF ID is provided by ONAP
108   vf_module_id:
109     type: string
110     label: vCPE module ID
111     description: The vCPE Module ID is provided by ONAP
112   dcae_collector_ip:
113     type: string
114     label: DCAE collector IP address
115     description: IP address of the DCAE collector
116   dcae_collector_port:
117     type: string
118     label: DCAE collector port
119     description: Port of the DCAE collector
120   key_name:
121     type: string
122     label: Key pair name
123     description: Public/Private key pair name
124   pub_key:
125     type: string
126     label: Public key
127     description: Public key to be installed on the compute instance
128   repo_url_blob:
129     type: string
130     label: Repository URL
131     description: URL of the repository that hosts the demo packages
132   repo_url_artifacts:
133     type: string
134     label: Repository URL
135     description: URL of the repository that hosts the demo packages
136   install_script_version:
137     type: string
138     label: Installation script version number
139     description: Version number of the scripts that install the vFW demo app
140   demo_artifacts_version:
141     type: string
142     label: Artifacts version used in demo vnfs
143     description: Artifacts (jar, tar.gz) version used in demo vnfs
144   cloud_env:
145     type: string
146     label: Cloud environment
147     description: Cloud environment (e.g., openstack, rackspace)
148
149 #############
150 #           #
151 # RESOURCES #
152 #           #
153 #############
154
155 resources:
156
157   random-str:
158     type: OS::Heat::RandomString
159     properties:
160       length: 4
161
162   my_keypair:
163     type: OS::Nova::KeyPair
164     properties:
165       name:
166         str_replace:
167           template: base_rand
168           params:
169             base: { get_param: key_name }
170             rand: { get_resource: random-str }
171       public_key: { get_param: pub_key }
172       save_private_key: false
173
174   brgemu_bng_private_network:
175     type: OS::Neutron::Net
176     properties:
177       name: { get_param: brgemu_bng_private_net_id }
178
179   brgemu_bng_private_subnet:
180     type: OS::Neutron::Subnet
181     properties:
182       name: { get_param: brgemu_bng_private_net_id }
183       network_id: { get_resource: brgemu_bng_private_network }
184       cidr: { get_param: brgemu_bng_private_net_cidr }
185
186   # Virtual BNG Instantiation
187   vbng_private_0_port:
188     type: OS::Neutron::Port
189     properties:
190       network: { get_resource: brgemu_bng_private_network }
191       fixed_ips: [{"subnet": { get_resource: brgemu_bng_private_subnet }, "ip_address": { get_param: vbng_private_ip_0 }}]
192
193   vbng_private_1_port:
194     type: OS::Neutron::Port
195     properties:
196       network: { get_param: onap_private_net_id }
197       fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vbng_private_ip_1 }}]
198
199   vbng_private_2_port:
200     type: OS::Neutron::Port
201     properties:
202       network: { get_param: cpe_signal_net_id }
203       fixed_ips: [{"subnet": { get_param: cpe_signal_net_id }, "ip_address": { get_param: vbng_private_ip_2 }}]
204
205   vbng_private_3_port:
206     type: OS::Neutron::Port
207     properties:
208       network: { get_param: bng_gmux_private_net_id }
209       fixed_ips: [{"subnet": { get_param: bng_gmux_private_net_id }, "ip_address": { get_param: vbng_private_ip_3 }}]
210
211   vbng_0:
212     type: OS::Nova::Server
213     properties:
214       image: { get_param: vcpe_image_name }
215       flavor: { get_param: vcpe_flavor_name }
216       name: { get_param: vbng_name_0 }
217       key_name: { get_resource: my_keypair }
218       networks:
219         - network: { get_param: public_net_id }
220         - port: { get_resource: vbng_private_0_port }
221         - port: { get_resource: vbng_private_1_port }
222         - port: { get_resource: vbng_private_2_port }
223       metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
224       user_data_format: RAW
225       user_data:
226         str_replace:
227           params:
228             __oam_ipaddr__: { get_param: vbng_private_ip_1 }
229             __brgemu_bng_net_ipaddr__: { get_param: vbng_private_ip_0 }
230             __cpe_signal_net_ipaddr__: { get_param: vbng_private_ip_2 }
231             __bng_gmux_net_ipaddr__: { get_param: vbng_private_ip_3 }
232             __oam_cidr__: { get_param: onap_private_net_cidr }
233             __brgemu_bng_cidr__: { get_param: brgemu_bng_private_net_cidr }
234             __cpe_signal_cidr__: { get_param: cpe_signal_private_net_cidr }
235             __bng_gmux_cidr__: { get_param: bng_gmux_private_net_cidr }
236             __dcae_collector_ip__: { get_param: dcae_collector_ip }
237             __dcae_collector_port__: { get_param: dcae_collector_port }
238             __repo_url_blob__ : { get_param: repo_url_blob }
239             __repo_url_artifacts__ : { get_param: repo_url_artifacts }
240             __demo_artifacts_version__ : { get_param: demo_artifacts_version }
241             __install_script_version__ : { get_param: install_script_version }
242             __cloud_env__ : { get_param: cloud_env }
243           template: |
244             #!/bin/bash
245
246             # Create configuration files
247             mkdir /opt/config
248             echo "__brgemu_bng_net_ipaddr__" > /opt/config/brgemu_bng_net_ipaddr.txt
249             echo "__cpe_signal_net_ipaddr__" > /opt/config/cpe_signal_net_ipaddr.txt
250             echo "__bng_gmux_net_ipaddr__" > /opt/config/bng_gmux_net_ipaddr.txt
251             echo "__oam_ipaddr__" > /opt/config/oam_ipaddr.txt
252             echo "__oam_cidr__" > /opt/config/oam_cidr.txt
253             echo "__bng_gmux_cidr__" > /opt/config/bng_gmux_net_cidr.txt
254             echo "__cpe_signal_cidr__" > /opt/config/cpe_signal_net_cidr.txt
255             echo "__brgemu_bng_cidr__" > /opt/config/brgemu_bng_net_cidr.txt
256             echo "__dcae_collector_ip__" > /opt/config/dcae_collector_ip.txt
257             echo "__dcae_collector_port__" > /opt/config/dcae_collector_port.txt
258             echo "__repo_url_blob__" > /opt/config/repo_url_blob.txt
259             echo "__repo_url_artifacts__" > /opt/config/repo_url_artifacts.txt
260             echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
261             echo "__install_script_version__" > /opt/config/install_script_version.txt
262             echo "__cloud_env__" > /opt/config/cloud_env.txt
263
264             # Download and run install script
265             curl -k __repo_url_blob__/org.onap.demo/vnfs/vcpe/__install_script_version__/v_bng_install.sh -o /opt/v_bng_install.sh
266             cd /opt
267             chmod +x v_bng_install.sh
268             ./v_bng_install.sh