update vCPE artifact layout and Template file
[demo.git] / tosca / vCPE / vbng / MainServiceTemplate.yaml
1 tosca_definitions_version: tosca_simple_yaml_1_0
2 metadata:
3   template_name: vCPE_vbng
4   template_version: "1.0"
5   template_author: onap
6 description: vCPE_vbng
7
8 imports:
9   - onap_dm.yaml
10
11 topology_template:
12 #  substitution_mappings:
13 #    node_type: onap.vcpe_vbng
14 #    requirements:
15 #      virtual_link: [ Cp_vbng_public, virtual_link ] # expose as external CP
16 #      virtual_link: [ Cp_vbng_onap_private, virtual_link ] # expose as external CP
17
18   inputs:
19     vcpe_image_name:
20       type: string
21       description: image name for vcpe in openstack glance
22       default: ubuntu_16.04
23     public_net_id:
24       type: string
25       description: public network id used during onap installation
26       default: external
27     onap_private_net_id:
28       type: string
29       description: onap OAM network id
30       default: oam_onap
31     onap_private_net_cidr:
32       type: string
33       description: oanp OAM network cidr
34       default: 10.0.0.0/16
35     brgemu_bng_private_net_id:
36       type: string
37       description: Private network that connects vBRG to vBNG
38       default: zdfw1bngin01_private
39     brgemu_bng_private_net_cidr:
40       type: string
41       description: The CIDR of the input side of vBNG private network
42       default: 10.3.0.0/24
43     bng_gmux_private_net_id:
44       type: string
45       description: Private network that connects vBNG to vGMUX
46       default: zdfw1bngmux01_private
47     bng_gmux_private_net_cidr:
48       type: string
49       description: The CIDR of the input side of vGMUX private network
50       default: 10.1.0.0/24
51     cpe_signal_net_id:
52       type: string
53       description: Private network that connects vCPE elements with vCPE infrastructure elements
54       default: zdfw1cpe01_private
55     cpe_signal_private_net_cidr:
56       type: string
57       description: The CIDR of the vAAA private network
58       default: 10.4.0.0/24
59     vbng_private_ip_0:
60       type: string
61       description: Private IP address that is assigned to the vBNG IN
62       default: 10.3.0.1
63     vbng_private_ip_1:
64       type: string
65       description: Private IP address that is assigned to the vBNG to communicate with ONAP components
66       default: 10.0.101.10
67     vbng_private_ip_2:
68       type: string
69       description: Private IP address that is assigned to the vBNG in the CPE_SIGNAL network
70       default: 10.4.0.3
71     vbng_private_ip_3:
72       type: string
73       description: Private IP address that is assigned to the vBNG to vGMUX port
74       default: 10.1.0.10
75     vbng_name_0:
76       type: string
77       description: Name of the vBNG
78       default: zdcpe1cpe01bng01
79     vnf_id:
80       type: string
81       description: The VNF ID is provided by ONAP
82       default: vCPE_Infrastructure_Metro_vBNG_demo_app
83     vf_module_id:
84       type: string
85       description: The vCPE Module ID is provided by ONAP
86       default: vCPE_Intrastructure_Metro_vBNG
87     dcae_collector_ip:
88       type: string
89       description: dcae collector ip
90       default: 10.0.4.102
91     dcae_collector_port:
92       type: integer
93       description: dcae collector port
94       default: 8080
95     pub_key:
96       type: string
97       description: ssh public key
98       default: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGx6SKrAuCz1V8KGevZueksLdWoPWJP6z3r29Z7TmPVEOjM+7PIPeSs2BVRx3rnHZBAlasMrZ+fJBS25ts9vfC+ItezQah/hr9vrkmwxCR54Lb84poW+sToPeF6i5eZY7W+jWJfLaFSFx9d2vp4zes/fOlT3NvYCXbn/3QdryQoGl7VFI8oemZypVcikZXElJeeKgAVdSwnrzuqtO/tmbXcAeSbYvVjki8ywYcsWMVMYWUWhh+1BAB6kXnTsIWqzrq0Pfvy+81WDwtiqsqmd93HY8hE0scBrXFBZzQS/AYfIFBlEuFNdLczchntjbZ0n7dmDXk8zHtCZYNk7kwb8k/
99     nexus_artifact_repo:
100       type: string
101       description: Root URL for the Nexus repository for Maven artifacts
102       default: https://nexus.onap.org
103     demo_artifacts_version:
104       type: string
105       description: artifacts version used in demo vnfs
106       default: 1.2.0
107     install_script_version:
108       type: string
109       description: install script version number
110       default: 1.2.0-SNAPSHOT
111     cloud_env:
112       type: string
113       description: cloud environment(openstack or rackspace)
114       default: openstack
115     sdnc_ip_addr:
116       type: string
117       description: IP address of the SDNC
118       default: 10.0.7.1
119
120   node_templates:
121     LLU_VNF:
122       type: tosca.nodes.nfv.VNF
123       properties:
124         descriptor_id: b1bb0ce7-2222-4fa7-95ed-4840d70a1177
125         provider: onap
126         product_name: vcpe_vbng
127         software_version: '1.0'
128         descriptor_version: '1.0'
129         flavour_id: simple
130         flavour_description: simple
131         vnfm_info: ['gvnfm']
132
133
134     #onap public net
135 #    VL_public:
136 #      type: tosca.nodes.nfv.VnfVirtualLink
137 #      properties:
138 #        connectivity_type:
139 #          layer_protocol: ipv4
140 #        vl_profile:
141 #          max_bit_rate_requirements:
142 #            root: 10000000
143 #            leaf: 10000000
144 #          min_bit_rate_requirements:
145 #            root: 10000000
146 #            leaf: 10000000
147 #          networkName: { get_input: public_net_id }
148 #
149 #    #onap oam net
150 #    VL_onap_private:
151 #      type: tosca.nodes.nfv.VnfVirtualLink
152 #      properties:
153 #        connectivity_type:
154 #          layer_protocol: ipv4
155 #        vl_profile:
156 #          max_bit_rate_requirements:
157 #            root: 10000000
158 #            leaf: 10000000
159 #          min_bit_rate_requirements:
160 #            root: 10000000
161 #            leaf: 10000000
162 #          networkName: { get_input: onap_private_net_id }
163 #          cidr: { get_input: onap_private_net_cidr }
164
165     #Private network that connects vBRG to vBNG
166     VL_brgemu_bng_private_net:
167       type: tosca.nodes.nfv.VnfVirtualLink
168       properties:
169         connectivity_type:
170           layer_protocol: ipv4
171         vl_profile:
172           max_bit_rate_requirements:
173             root: 10000000
174             leaf: 10000000
175           min_bit_rate_requirements:
176             root: 10000000
177             leaf: 10000000
178           networkName: { get_input: brgemu_bng_private_net_id}
179           cidr: { get_input: brgemu_bng_private_net_cidr }
180           dhcpEnabled: false
181
182     #cpe signal network
183     VL_cpe_signal:
184       type: tosca.nodes.nfv.VnfVirtualLink
185       properties:
186         connectivity_type:
187           layer_protocol: ipv4
188         vl_profile:
189           max_bit_rate_requirements:
190             root: 10000000
191             leaf: 10000000
192           min_bit_rate_requirements:
193             root: 10000000
194             leaf: 10000000
195           networkName: { get_input: cpe_signal_net_id}
196           cidr: { get_input: cpe_signal_private_net_cidr }
197           dhcpEnabled: false
198
199     #Private network that connects vBNG to vGMUX
200     VL_bng_gmux_private_net:
201       type: tosca.nodes.nfv.VnfVirtualLink
202       properties:
203         connectivity_type:
204           layer_protocol: ipv4
205         vl_profile:
206           max_bit_rate_requirements:
207             root: 10000000
208             leaf: 10000000
209           min_bit_rate_requirements:
210             root: 10000000
211             leaf: 10000000
212           networkName: { get_input: bng_gmux_private_net_id}
213           cidr: { get_input: bng_gmux_private_net_cidr }
214           dhcpEnabled: false
215
216     # vbng related
217     Cp_vbng_public:
218       type: tosca.nodes.nfv.VduCp
219       properties:
220         layer_protocol: [ipv4]
221         trunk_mode: false
222         protocol_data:
223           - asscociated_layer_protocol: ipv4
224             address_data:
225               address_type: ip_address
226               l3_address_data:
227                 ip_address_assignment: false
228                 floating_ip_activated: false
229       requirements:
230         - virtual_binding: VDU_vbng_0
231         #- virtual_link: VL_public
232
233     Cp_vbng_onap_private:
234       type: tosca.nodes.nfv.VduCp
235       properties:
236         layer_protocol: [ipv4]
237         trunk_mode: false
238         protocol_data:
239           - asscociated_layer_protocol: ipv4
240             address_data:
241               address_type: ip_address
242               l3_address_data:
243                 ip_address_assignment: false
244                 floating_ip_activated: false
245                 fixed_ip_address:
246                   - { get_input: vbng_private_ip_1 }
247       requirements:
248         - virtual_binding: VDU_vbng_0
249         #- virtual_link: VL_onap_private
250
251     Cp_vbng_brgemu_bng_private_net:
252       type: tosca.nodes.nfv.VduCp
253       properties:
254         layer_protocol: [ipv4]
255         trunk_mode: false
256         protocol_data:
257           - asscociated_layer_protocol: ipv4
258             address_data:
259               address_type: ip_address
260               l3_address_data:
261                 ip_address_assignment: false
262                 floating_ip_activated: false
263                 fixed_ip_address:
264                   - { get_input: vbng_private_ip_0 }
265         virtual_network_interface_requirements:
266           - name: dpdk support
267             support_mandatory: true
268             # TODO HPA
269             network_interface_requirements:
270               dataProcessingAccelerationLibrary: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "DPDK"}'
271       requirements:
272         - virtual_binding: VDU_vbng_0
273         - virtual_link: VL_brgemu_bng_private_net
274
275     Cp_vbng_cpe_signal:
276       type: tosca.nodes.nfv.VduCp
277       properties:
278         layer_protocol: [ipv4]
279         trunk_mode: false
280         protocol_data:
281           - asscociated_layer_protocol: ipv4
282             address_data:
283               address_type: ip_address
284               l3_address_data:
285                 ip_address_assignment: false
286                 floating_ip_activated: false
287                 fixed_ip_address:
288                   - { get_input: vbng_private_ip_2 }
289       requirements:
290         - virtual_binding: VDU_vbng_0
291         - virtual_link: VL_cpe_signal
292
293     Cp_vbng_bng_gmux_private_net:
294       type: tosca.nodes.nfv.VduCp
295       properties:
296         layer_protocol: [ipv4]
297         trunk_mode: false
298         protocol_data:
299           - asscociated_layer_protocol: ipv4
300             address_data:
301               address_type: ip_address
302               l3_address_data:
303                 ip_address_assignment: false
304                 floating_ip_activated: false
305                 fixed_ip_address:
306                   - { get_input: vbng_private_ip_3 }
307         virtual_network_interface_requirements:
308           - name: dpdk support
309             support_mandatory: true
310             # TODO HPA
311             network_interface_requirements:
312               dataProcessingAccelerationLibrary: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "DPDK"}'
313       requirements:
314         - virtual_binding: VDU_vbng_0
315         - virtual_link: VL_bng_gmux_private_net
316
317     VirtualStorage_root_all:
318       # this indicate the VDU root storage size
319       type: tosca.nodes.nfv.Vdu.VirtualStorage
320       properties:
321         type_of_storage: root
322         size_of_storage: 40 GB
323
324     VDU_vbng_0:
325       type: tosca.nodes.nfv.Vdu.Compute
326       properties:
327         name: { get_input: vbng_name_0 }
328         description: vbng
329         configurable_properties:
330           additional_vnfc_configurable_properties: {}
331         vdu_profile:
332           min_number_of_instances: 1
333           max_number_of_instances: 1
334           watchdog: none
335         inject_files: #TODO SDC bug
336           source_path: ../Artifacts/Deployment/Other/authorized_keys #SSH authorized_keys
337           dest_path: /home/ubuntu/.ssh/authorized_keys
338         meta_data:
339           vnf_id: { get_input: vnf_id }
340           vf_module_id: { get_input: vf_module_id }
341
342           brgemu_bng_net_ipaddr: { get_input: vbng_private_ip_0 }
343           cpe_signal_net_ipaddr: { get_input: vbng_private_ip_2 }
344           bng_gmux_net_ipaddr: { get_input: vbng_private_ip_3 }
345           oam_ipaddr: { get_input: vbng_private_ip_1 }
346           oam_cidr: { get_input: onap_private_net_cidr }
347           bng_gmux_cidr: { get_input: bng_gmux_private_net_cidr }
348           cpe_signal_cidr: { get_input: cpe_signal_private_net_cidr }
349           brgemu_bng_cidr: { get_input: brgemu_bng_private_net_cidr }
350           dcae_collector_ip: { get_input: dcae_collector_ip }
351           dcae_collector_port: { get_input: dcae_collector_port }
352           demo_artifacts_version: { get_input: demo_artifacts_version }
353           install_script_version: { get_input: install_script_version }
354           sdnc_ip: { get_input: sdnc_ip_addr }
355           cloud_env: { get_input: cloud_env }
356           nexus_artifact_repo: { get_input: nexus_artifact_repo }
357         user_data: |
358           #!/bin/bash
359           METADATA=`curl -s http://169.254.169.254/openstack/2012-08-10/meta_data.json`
360           apt-get -y install jq
361
362           get_metadata () {
363             echo $METADATA | jq -r ".meta.$1"
364           }
365
366           # Create configuration files
367           mkdir /opt/config
368           echo "$(get_metadata brgemu_bng_net_ipaddr)" > /opt/config/brgemu_bng_net_ipaddr.txt
369           echo "$(get_metadata cpe_signal_net_ipaddr)" > /opt/config/cpe_signal_net_ipaddr.txt
370           echo "$(get_metadata bng_gmux_net_ipaddr)" > /opt/config/bng_gmux_net_ipaddr.txt
371           echo "$(get_metadata oam_ipaddr)" > /opt/config/oam_ipaddr.txt
372           echo "$(get_metadata oam_cidr)" > /opt/config/oam_cidr.txt
373           echo "$(get_metadata bng_gmux_cidr)" > /opt/config/bng_gmux_net_cidr.txt
374           echo "$(get_metadata cpe_signal_cidr)" > /opt/config/cpe_signal_net_cidr.txt
375           echo "$(get_metadata brgemu_bng_cidr)" > /opt/config/brgemu_bng_net_cidr.txt
376           echo "$(get_metadata dcae_collector_ip)" > /opt/config/dcae_collector_ip.txt
377           echo "$(get_metadata dcae_collector_port)" > /opt/config/dcae_collector_port.txt
378           echo "$(get_metadata demo_artifacts_version)" > /opt/config/demo_artifacts_version.txt
379           echo "$(get_metadata install_script_version)" > /opt/config/install_script_version.txt
380           echo "$(get_metadata cloud_env)" > /opt/config/cloud_env.txt
381           echo "$(get_metadata sdnc_ip)" > /opt/config/sdnc_ip.txt
382           echo "$(get_metadata nexus_artifact_repo)" > /opt/config/nexus_artifact_repo.txt
383
384           # Download and run install script
385           apt-get -y install unzip
386           INSTALL_SCRIPT_VERSION=$(get_metadata install_script_version)
387           NEXUS_ARTIFACT_REPO=$(get_metadata nexus_artifact_repo)
388           if [[ "${INSTALL_SCRIPT_VERSION}" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
389           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=${INSTALL_SCRIPT_VERSION}" -o /opt/vcpe-scripts-${INSTALL_SCRIPT_VERSION}.zip
390           unzip -j /opt/vcpe-scripts-${INSTALL_SCRIPT_VERSION}.zip -d /opt v_bng_install.sh
391           cd /opt
392           chmod +x v_bng_install.sh
393           ./v_bng_install.sh
394       capabilities:
395         virtual_compute:
396           properties:
397             virtual_memory:
398               virtual_mem_size: 4096 MB
399               # HPA requirements
400               vdu_memory_requirements:
401                 memoryPageSize: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "2 MB"}'
402                 numberOfPages: '{"schemaVersion": "0","schemaSelector": "","hardwarePlatform": "generic","mandatory": "true", "configurationValue": "1024"}'
403             virtual_cpu:
404               num_virtual_cpu: 2
405               cpu_architecture: generic
406       requirements:
407         - virtual_storage: VirtualStorage_root_all
408       artifacts:
409         sw_image: #TODO need to put glance image name here
410           #file: { get_input: vcpe_image_name }
411           file: ../Artifacts/Deployment/Other/image
412           type: tosca.artifacts.nfv.SwImage