Adapt to latest tosca onboarding DM change
[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: string
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_protocols: [ipv4]
140 #        vl_profile:
141 #          max_bitrate_requirements:
142 #            root: 10000000
143 #            leaf: 10000000
144 #          min_bitrate_requirements:
145 #            root: 10000000
146 #            leaf: 10000000
147 #          virtual_link_protocol_data:
148 #            - associated_layer_protocol: ipv4
149 #              l3_protocol_data:
150 #                ip_version: ipv4
151 #                name: { get_input: public_net_id }
152 #
153 #    #onap oam net
154 #    VL_onap_private:
155 #      type: tosca.nodes.nfv.VnfVirtualLink
156 #      properties:
157 #        connectivity_type:
158 #          layer_protocols: [ipv4]
159 #        vl_profile:
160 #          max_bitrate_requirements:
161 #            root: 10000000
162 #            leaf: 10000000
163 #          min_bitrate_requirements:
164 #            root: 10000000
165 #            leaf: 10000000
166 #          virtual_link_protocol_data:
167 #            - associated_layer_protocol: ipv4
168 #              l3_protocol_data:
169 #                ip_version: ipv4
170 #                name: { get_input: onap_private_net_id }
171 #                cidr: { get_input: onap_private_net_cidr }
172
173     #Private network that connects vBRG to vBNG
174     VL_brgemu_bng_private_net:
175       type: tosca.nodes.nfv.VnfVirtualLink
176       properties:
177         connectivity_type:
178           layer_protocols: [ipv4]
179         vl_profile:
180           max_bitrate_requirements:
181             root: 10000000
182             leaf: 10000000
183           min_bitrate_requirements:
184             root: 10000000
185             leaf: 10000000
186           virtual_link_protocol_data:
187             - associated_layer_protocol: ipv4
188               l3_protocol_data:
189                 ip_version: ipv4
190                 name: { get_input: brgemu_bng_private_net_id}
191                 cidr: { get_input: brgemu_bng_private_net_cidr }
192                 dhcp_enabled: false
193
194     #cpe signal network
195     VL_cpe_signal:
196       type: tosca.nodes.nfv.VnfVirtualLink
197       properties:
198         connectivity_type:
199           layer_protocols: [ipv4]
200         vl_profile:
201           max_bitrate_requirements:
202             root: 10000000
203             leaf: 10000000
204           min_bitrate_requirements:
205             root: 10000000
206             leaf: 10000000
207           virtual_link_protocol_data:
208             - associated_layer_protocol: ipv4
209               l3_protocol_data:
210                 ip_version: ipv4
211                 name: { get_input: cpe_signal_net_id}
212                 cidr: { get_input: cpe_signal_private_net_cidr }
213                 dhcp_enabled: false
214
215     #Private network that connects vBNG to vGMUX
216     VL_bng_gmux_private_net:
217       type: tosca.nodes.nfv.VnfVirtualLink
218       properties:
219         connectivity_type:
220           layer_protocols: [ipv4]
221         vl_profile:
222           max_bitrate_requirements:
223             root: 10000000
224             leaf: 10000000
225           min_bitrate_requirements:
226             root: 10000000
227             leaf: 10000000
228           virtual_link_protocol_data:
229             - associated_layer_protocol: ipv4
230               l3_protocol_data:
231                 ip_version: ipv4
232                 name: { get_input: bng_gmux_private_net_id}
233                 cidr: { get_input: bng_gmux_private_net_cidr }
234                 dhcp_enabled: false
235
236     # vbng related
237     Cp_vbng_public:
238       type: tosca.nodes.nfv.VduCp
239       properties:
240         layer_protocols: [ipv4]
241         trunk_mode: false
242         protocol:
243           - associated_layer_protocol: ipv4
244             address_data:
245               - address_type: ip_address
246                 l3_address_data:
247                   ip_address_assignment: false
248                   floating_ip_activated: false
249       requirements:
250         - virtual_binding: VDU_vbng_0
251         #- virtual_link: VL_public
252
253     Cp_vbng_onap_private:
254       type: tosca.nodes.nfv.VduCp
255       properties:
256         layer_protocols: [ipv4]
257         trunk_mode: false
258         protocol:
259           - associated_layer_protocol: ipv4
260             address_data:
261               - address_type: ip_address
262                 l3_address_data:
263                   ip_address_assignment: false
264                   floating_ip_activated: false
265                   fixed_ip_address:
266                     - { get_input: vbng_private_ip_1 }
267       requirements:
268         - virtual_binding: VDU_vbng_0
269         #- virtual_link: VL_onap_private
270
271     Cp_vbng_brgemu_bng_private_net:
272       type: tosca.nodes.nfv.VduCp
273       properties:
274         layer_protocols: [ipv4]
275         trunk_mode: false
276         protocol:
277           - associated_layer_protocol: ipv4
278             address_data:
279               - address_type: ip_address
280                 l3_address_data:
281                   ip_address_assignment: false
282                   floating_ip_activated: false
283                   fixed_ip_address:
284                     - { get_input: vbng_private_ip_0 }
285         virtual_network_interface_requirements:
286           - name: dpdk support
287             support_mandatory: true
288             network_interface_requirements:
289               dataProcessingAccelerationLibrary: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "DPDK"}'
290       requirements:
291         - virtual_binding: VDU_vbng_0
292         - virtual_link: VL_brgemu_bng_private_net
293
294     Cp_vbng_cpe_signal:
295       type: tosca.nodes.nfv.VduCp
296       properties:
297         layer_protocols: [ipv4]
298         trunk_mode: false
299         protocol:
300           - associated_layer_protocol: ipv4
301             address_data:
302               - address_type: ip_address
303                 l3_address_data:
304                   ip_address_assignment: false
305                   floating_ip_activated: false
306                   fixed_ip_address:
307                     - { get_input: vbng_private_ip_2 }
308       requirements:
309         - virtual_binding: VDU_vbng_0
310         - virtual_link: VL_cpe_signal
311
312     Cp_vbng_bng_gmux_private_net:
313       type: tosca.nodes.nfv.VduCp
314       properties:
315         layer_protocols: [ipv4]
316         trunk_mode: false
317         protocol:
318           - associated_layer_protocol: ipv4
319             address_data:
320               - address_type: ip_address
321                 l3_address_data:
322                   ip_address_assignment: false
323                   floating_ip_activated: false
324                   fixed_ip_address:
325                     - { get_input: vbng_private_ip_3 }
326         virtual_network_interface_requirements:
327           - name: dpdk support
328             support_mandatory: true
329             network_interface_requirements:
330               dataProcessingAccelerationLibrary: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "DPDK"}'
331       requirements:
332         - virtual_binding: VDU_vbng_0
333         - virtual_link: VL_bng_gmux_private_net
334
335     VDU_vbng_0:
336       type: tosca.nodes.nfv.Vdu.Compute
337       properties:
338         name: { get_input: vbng_name_0 }
339         description: vbng
340         vdu_profile:
341           min_number_of_instances: 1
342           max_number_of_instances: 1
343           watchdog: none
344         inject_files: #TODO SDC bug
345           source_path: ../Artifacts/Deployment/OTHER/authorized_keys #SSH authorized_keys
346           dest_path: /home/ubuntu/.ssh/authorized_keys
347         meta_data:
348           vnf_id: { get_input: vnf_id }
349           vf_module_id: { get_input: vf_module_id }
350
351           brgemu_bng_net_ipaddr: { get_input: vbng_private_ip_0 }
352           cpe_signal_net_ipaddr: { get_input: vbng_private_ip_2 }
353           bng_gmux_net_ipaddr: { get_input: vbng_private_ip_3 }
354           oam_ipaddr: { get_input: vbng_private_ip_1 }
355           oam_cidr: { get_input: onap_private_net_cidr }
356           bng_gmux_cidr: { get_input: bng_gmux_private_net_cidr }
357           cpe_signal_cidr: { get_input: cpe_signal_private_net_cidr }
358           brgemu_bng_cidr: { get_input: brgemu_bng_private_net_cidr }
359           dcae_collector_ip: { get_input: dcae_collector_ip }
360           dcae_collector_port: { get_input: dcae_collector_port }
361           demo_artifacts_version: { get_input: demo_artifacts_version }
362           install_script_version: { get_input: install_script_version }
363           sdnc_ip: { get_input: sdnc_ip_addr }
364           cloud_env: { get_input: cloud_env }
365           nexus_artifact_repo: { get_input: nexus_artifact_repo }
366         boot_data: |
367           #!/bin/bash
368           METADATA=`curl -s http://169.254.169.254/openstack/2012-08-10/meta_data.json`
369           apt-get -y install jq
370
371           get_metadata () {
372             echo $METADATA | jq -r ".meta.$1"
373           }
374
375           # Create configuration files
376           mkdir /opt/config
377           echo "$(get_metadata brgemu_bng_net_ipaddr)" > /opt/config/brgemu_bng_net_ipaddr.txt
378           echo "$(get_metadata cpe_signal_net_ipaddr)" > /opt/config/cpe_signal_net_ipaddr.txt
379           echo "$(get_metadata bng_gmux_net_ipaddr)" > /opt/config/bng_gmux_net_ipaddr.txt
380           echo "$(get_metadata oam_ipaddr)" > /opt/config/oam_ipaddr.txt
381           echo "$(get_metadata oam_cidr)" > /opt/config/oam_cidr.txt
382           echo "$(get_metadata bng_gmux_cidr)" > /opt/config/bng_gmux_net_cidr.txt
383           echo "$(get_metadata cpe_signal_cidr)" > /opt/config/cpe_signal_net_cidr.txt
384           echo "$(get_metadata brgemu_bng_cidr)" > /opt/config/brgemu_bng_net_cidr.txt
385           echo "$(get_metadata dcae_collector_ip)" > /opt/config/dcae_collector_ip.txt
386           echo "$(get_metadata dcae_collector_port)" > /opt/config/dcae_collector_port.txt
387           echo "$(get_metadata demo_artifacts_version)" > /opt/config/demo_artifacts_version.txt
388           echo "$(get_metadata install_script_version)" > /opt/config/install_script_version.txt
389           echo "$(get_metadata cloud_env)" > /opt/config/cloud_env.txt
390           echo "$(get_metadata sdnc_ip)" > /opt/config/sdnc_ip.txt
391           echo "$(get_metadata nexus_artifact_repo)" > /opt/config/nexus_artifact_repo.txt
392
393           # Download and run install script
394           apt-get -y install unzip
395           INSTALL_SCRIPT_VERSION=$(get_metadata install_script_version)
396           NEXUS_ARTIFACT_REPO=$(get_metadata nexus_artifact_repo)
397           if [[ "${INSTALL_SCRIPT_VERSION}" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
398           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
399           unzip -j /opt/vcpe-scripts-${INSTALL_SCRIPT_VERSION}.zip -d /opt v_bng_install.sh
400           cd /opt
401           chmod +x v_bng_install.sh
402           ./v_bng_install.sh
403       capabilities:
404         virtual_compute:
405           properties:
406             virtual_memory:
407               virtual_mem_size: 4096 MB
408               vdu_mem_requirements:
409                 memoryPageSize: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "2 MB"}'
410                 numberOfPages: '{"schemaVersion": "0","schemaSelector": "","hardwarePlatform": "generic","mandatory": "true", "configurationValue": "1024"}'
411             virtual_cpu:
412               num_virtual_cpu: 2
413               cpu_architecture: generic
414             virtual_local_storage:
415               - size_of_storage: 40 GB
416       artifacts:
417         sw_image: #TODO need to put glance image name here
418           #file: { get_input: vcpe_image_name }
419           file: ../Artifacts/Deployment/OTHER/image
420           type: tosca.artifacts.nfv.SwImage