4dfd3d0bce0b5fcf41a1290de3ed8a0d2b92449c
[demo.git] / tosca / vCPE / vbng / MainServiceTemplate_sriov.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     onap_private_net_id:
27       type: string
28       description: onap OAM network id
29     onap_private_net_cidr:
30       type: string
31       description: oanp OAM network cidr
32       default: 10.0.0.0/16
33     brgemu_bng_private_net_id:
34       type: string
35       description: Private network that connects vBRG to vBNG
36       default: zdfw1bngin01_private
37     brgemu_bng_private_net_cidr:
38       type: string
39       description: The CIDR of the input side of vBNG private network
40       default: 10.3.0.0/24
41     bng_gmux_private_net_id:
42       type: string
43       description: Private network that connects vBNG to vGMUX
44       default: zdfw1bngmux01_private
45     bng_gmux_private_net_cidr:
46       type: string
47       description: The CIDR of the input side of vGMUX private network
48       default: 10.1.0.0/24
49     cpe_signal_net_id:
50       type: string
51       description: Private network that connects vCPE elements with vCPE infrastructure elements
52       default: zdfw1cpe01_private
53     cpe_signal_private_net_cidr:
54       type: string
55       description: The CIDR of the vAAA private network
56       default: 10.4.0.0/24
57     vbng_private_ip_0:
58       type: string
59       description: Private IP address that is assigned to the vBNG IN
60       default: 10.3.0.1
61     vbng_private_ip_1:
62       type: string
63       description: Private IP address that is assigned to the vBNG to communicate with ONAP components
64       default: 10.0.101.10
65     vbng_private_ip_2:
66       type: string
67       description: Private IP address that is assigned to the vBNG in the CPE_SIGNAL network
68       default: 10.4.0.3
69     vbng_private_ip_3:
70       type: string
71       description: Private IP address that is assigned to the vBNG to vGMUX port
72       default: 10.1.0.10
73     vbng_name_0:
74       type: string
75       description: Name of the vBNG
76       default: zdcpe1cpe01bng01
77     vnf_id:
78       type: string
79       description: The VNF ID is provided by ONAP
80       default: vCPE_Infrastructure_Metro_vBNG_demo_app
81     vf_module_id:
82       type: string
83       description: The vCPE Module ID is provided by ONAP
84       default: vCPE_Intrastructure_Metro_vBNG
85     dcae_collector_ip:
86       type: string
87       description: dcae collector ip
88       default: 10.0.4.102
89     dcae_collector_port:
90       type: string
91       description: dcae collector port
92       default: "8080"
93     pub_key:
94       type: string
95       description: ssh public key
96       default: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGx6SKrAuCz1V8KGevZueksLdWoPWJP6z3r29Z7TmPVEOjM+7PIPeSs2BVRx3rnHZBAlasMrZ+fJBS25ts9vfC+ItezQah/hr9vrkmwxCR54Lb84poW+sToPeF6i5eZY7W+jWJfLaFSFx9d2vp4zes/fOlT3NvYCXbn/3QdryQoGl7VFI8oemZypVcikZXElJeeKgAVdSwnrzuqtO/tmbXcAeSbYvVjki8ywYcsWMVMYWUWhh+1BAB6kXnTsIWqzrq0Pfvy+81WDwtiqsqmd93HY8hE0scBrXFBZzQS/AYfIFBlEuFNdLczchntjbZ0n7dmDXk8zHtCZYNk7kwb8k/
97     nexus_artifact_repo:
98       type: string
99       description: Root URL for the Nexus repository for Maven artifacts
100       default: https://nexus.onap.org
101     demo_artifacts_version:
102       type: string
103       description: artifacts version used in demo vnfs
104       default: 1.2.0
105     install_script_version:
106       type: string
107       description: install script version number
108       default: 1.2.0-SNAPSHOT
109     cloud_env:
110       type: string
111       description: cloud environment(openstack or rackspace)
112       default: openstack
113     sdnc_ip_addr:
114       type: string
115       description: IP address of the SDNC
116       default: 10.0.7.1
117
118   node_templates:
119     LLU_VNF:
120       type: tosca.nodes.nfv.VNF
121       properties:
122         descriptor_id: b1bb0ce7-2222-4fa7-95ed-4840d70a1177
123         provider: onap
124         product_name: vcpe_vbng
125         software_version: '1.0'
126         descriptor_version: '1.0'
127         flavour_id: simple
128         flavour_description: simple
129         vnfm_info: ['gvnfm']
130
131
132     #onap public net
133 #    VL_public:
134 #      type: tosca.nodes.nfv.VnfVirtualLink
135 #      properties:
136 #        connectivity_type:
137 #          layer_protocols: [ipv4]
138 #        vl_profile:
139 #          max_bitrate_requirements:
140 #            root: 10000000
141 #            leaf: 10000000
142 #          min_bitrate_requirements:
143 #            root: 10000000
144 #            leaf: 10000000
145 #          virtual_link_protocol_data:
146 #            - associated_layer_protocol: ipv4
147 #              l3_protocol_data:
148 #                ip_version: ipv4
149 #                name: { get_input: public_net_id }
150 #
151 #    #onap oam net
152 #    VL_onap_private:
153 #      type: tosca.nodes.nfv.VnfVirtualLink
154 #      properties:
155 #        connectivity_type:
156 #          layer_protocols: [ipv4]
157 #        vl_profile:
158 #          max_bitrate_requirements:
159 #            root: 10000000
160 #            leaf: 10000000
161 #          min_bitrate_requirements:
162 #            root: 10000000
163 #            leaf: 10000000
164 #          virtual_link_protocol_data:
165 #            - associated_layer_protocol: ipv4
166 #              l3_protocol_data:
167 #                ip_version: ipv4
168 #                name: { get_input: onap_private_net_id }
169 #                cidr: { get_input: onap_private_net_cidr }
170
171     #Private network that connects vBRG to vBNG
172     VL_brgemu_bng_private_net:
173       type: tosca.nodes.nfv.VnfVirtualLink
174       properties:
175         connectivity_type:
176           layer_protocols: [ipv4]
177         vl_profile:
178           max_bitrate_requirements:
179             root: 10000000
180             leaf: 10000000
181           min_bitrate_requirements:
182             root: 10000000
183             leaf: 10000000
184           virtual_link_protocol_data:
185             - associated_layer_protocol: ipv4
186               l3_protocol_data:
187                 ip_version: ipv4
188                 name: { get_input: brgemu_bng_private_net_id}
189                 cidr: { get_input: brgemu_bng_private_net_cidr }
190                 dhcp_enabled: false
191               l2_protocol_data:
192                 physical_network: "physnet1"
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               l2_protocol_data:
236                 physical_network: "physnet1"
237
238     # vbng related
239     Cp_vbng_public:
240       type: tosca.nodes.nfv.VduCp
241       properties:
242         layer_protocols: [ipv4]
243         trunk_mode: false
244         protocol:
245           - associated_layer_protocol: ipv4
246             address_data:
247               - address_type: ip_address
248                 l3_address_data:
249                   ip_address_assignment: false
250                   floating_ip_activated: false
251       requirements:
252         - virtual_binding: VDU_vbng_0
253         #- virtual_link: VL_public
254
255     Cp_vbng_onap_private:
256       type: tosca.nodes.nfv.VduCp
257       properties:
258         layer_protocols: [ipv4]
259         trunk_mode: false
260         protocol:
261           - associated_layer_protocol: ipv4
262             address_data:
263               - address_type: ip_address
264                 l3_address_data:
265                   ip_address_assignment: false
266                   floating_ip_activated: false
267                   fixed_ip_address:
268                     - { get_input: vbng_private_ip_1 }
269       requirements:
270         - virtual_binding: VDU_vbng_0
271         #- virtual_link: VL_onap_private
272
273     Cp_vbng_brgemu_bng_private_net:
274       type: tosca.nodes.nfv.VduCp
275       properties:
276         layer_protocols: [ipv4]
277         trunk_mode: false
278         protocol:
279           - associated_layer_protocol: ipv4
280             address_data:
281               - address_type: ip_address
282                 l3_address_data:
283                   ip_address_assignment: false
284                   floating_ip_activated: false
285                   fixed_ip_address:
286                     - { get_input: vbng_private_ip_0 }
287         vnic_type: "direct-physical"
288         virtual_network_interface_requirements:
289           - name: "sriov-support"
290             support_mandatory: true
291             network_interface_requirements:
292               interfaceType: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "SR-IOV"}'
293             nic_io_requirements:
294               logical_node_requirements:
295                 pciVendorId: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "1234"}'
296                 pciDeviceId: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "5678"}'
297                 pciNumDevices: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "1"}'
298       requirements:
299         - virtual_binding: VDU_vbng_0
300         - virtual_link: VL_brgemu_bng_private_net
301
302     Cp_vbng_cpe_signal:
303       type: tosca.nodes.nfv.VduCp
304       properties:
305         layer_protocols: [ipv4]
306         trunk_mode: false
307         protocol:
308           - associated_layer_protocol: ipv4
309             address_data:
310               - address_type: ip_address
311                 l3_address_data:
312                   ip_address_assignment: false
313                   floating_ip_activated: false
314                   fixed_ip_address:
315                     - { get_input: vbng_private_ip_2 }
316       requirements:
317         - virtual_binding: VDU_vbng_0
318         - virtual_link: VL_cpe_signal
319
320     Cp_vbng_bng_gmux_private_net:
321       type: tosca.nodes.nfv.VduCp
322       properties:
323         layer_protocols: [ipv4]
324         trunk_mode: false
325         protocol:
326           - associated_layer_protocol: ipv4
327             address_data:
328               - address_type: ip_address
329                 l3_address_data:
330                   ip_address_assignment: false
331                   floating_ip_activated: false
332                   fixed_ip_address:
333                     - { get_input: vbng_private_ip_3 }
334         vnic_type: "direct-physical"
335         virtual_network_interface_requirements:
336           - name: "sriov-support"
337             support_mandatory: true
338             network_interface_requirements:
339               interfaceType: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "SR-IOV"}'
340             nic_io_requirements:
341               logical_node_requirements:
342                 pciVendorId: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "1234"}'
343                 pciDeviceId: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "5678"}'
344                 pciNumDevices: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "1"}'
345       requirements:
346         - virtual_binding: VDU_vbng_0
347         - virtual_link: VL_bng_gmux_private_net
348
349     VDU_vbng_0:
350       type: tosca.nodes.nfv.Vdu.Compute
351       properties:
352         name: { get_input: vbng_name_0 }
353         description: vbng
354         vdu_profile:
355           min_number_of_instances: 1
356           max_number_of_instances: 1
357           watchdog: none
358         inject_files: #TODO SDC bug
359           source_path: ../Artifacts/Deployment/OTHER/authorized_keys #SSH authorized_keys
360           dest_path: /home/ubuntu/.ssh/authorized_keys
361         meta_data:
362           vnf_id: { get_input: vnf_id }
363           vf_module_id: { get_input: vf_module_id }
364
365           brgemu_bng_net_ipaddr: { get_input: vbng_private_ip_0 }
366           cpe_signal_net_ipaddr: { get_input: vbng_private_ip_2 }
367           bng_gmux_net_ipaddr: { get_input: vbng_private_ip_3 }
368           oam_ipaddr: { get_input: vbng_private_ip_1 }
369           oam_cidr: { get_input: onap_private_net_cidr }
370           bng_gmux_cidr: { get_input: bng_gmux_private_net_cidr }
371           cpe_signal_cidr: { get_input: cpe_signal_private_net_cidr }
372           brgemu_bng_cidr: { get_input: brgemu_bng_private_net_cidr }
373           dcae_collector_ip: { get_input: dcae_collector_ip }
374           dcae_collector_port: { get_input: dcae_collector_port }
375           demo_artifacts_version: { get_input: demo_artifacts_version }
376           install_script_version: { get_input: install_script_version }
377           sdnc_ip: { get_input: sdnc_ip_addr }
378           cloud_env: { get_input: cloud_env }
379           nexus_artifact_repo: { get_input: nexus_artifact_repo }
380         boot_data: |
381           #!/bin/bash
382           METADATA=`curl -s http://169.254.169.254/openstack/2012-08-10/meta_data.json`
383           apt-get -y install jq
384
385           get_metadata () {
386             echo $METADATA | jq -r ".meta.$1"
387           }
388
389           # Create configuration files
390           mkdir /opt/config
391           echo "$(get_metadata brgemu_bng_net_ipaddr)" > /opt/config/brgemu_bng_net_ipaddr.txt
392           echo "$(get_metadata cpe_signal_net_ipaddr)" > /opt/config/cpe_signal_net_ipaddr.txt
393           echo "$(get_metadata bng_gmux_net_ipaddr)" > /opt/config/bng_gmux_net_ipaddr.txt
394           echo "$(get_metadata oam_ipaddr)" > /opt/config/oam_ipaddr.txt
395           echo "$(get_metadata oam_cidr)" > /opt/config/oam_cidr.txt
396           echo "$(get_metadata bng_gmux_cidr)" > /opt/config/bng_gmux_net_cidr.txt
397           echo "$(get_metadata cpe_signal_cidr)" > /opt/config/cpe_signal_net_cidr.txt
398           echo "$(get_metadata brgemu_bng_cidr)" > /opt/config/brgemu_bng_net_cidr.txt
399           echo "$(get_metadata dcae_collector_ip)" > /opt/config/dcae_collector_ip.txt
400           echo "$(get_metadata dcae_collector_port)" > /opt/config/dcae_collector_port.txt
401           echo "$(get_metadata demo_artifacts_version)" > /opt/config/demo_artifacts_version.txt
402           echo "$(get_metadata install_script_version)" > /opt/config/install_script_version.txt
403           echo "$(get_metadata cloud_env)" > /opt/config/cloud_env.txt
404           echo "$(get_metadata sdnc_ip)" > /opt/config/sdnc_ip.txt
405           echo "$(get_metadata nexus_artifact_repo)" > /opt/config/nexus_artifact_repo.txt
406
407           # Download and run install script
408           apt-get -y install unzip
409           INSTALL_SCRIPT_VERSION=$(get_metadata install_script_version)
410           NEXUS_ARTIFACT_REPO=$(get_metadata nexus_artifact_repo)
411           if [[ "${INSTALL_SCRIPT_VERSION}" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
412           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
413           unzip -j /opt/vcpe-scripts-${INSTALL_SCRIPT_VERSION}.zip -d /opt v_bng_install.sh
414           cd /opt
415           chmod +x v_bng_install.sh
416           ./v_bng_install.sh
417       capabilities:
418         virtual_compute:
419           properties:
420             virtual_memory:
421               virtual_mem_size: 4096 MB
422               vdu_mem_requirements:
423                 memoryPageSize: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "2 MB"}'
424                 numberOfPages: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "1024"}'
425             virtual_cpu:
426               num_virtual_cpu: 2
427               cpu_architecture: generic
428             virtual_local_storage:
429               - size_of_storage: 40 GB
430       artifacts:
431         sw_image: #TODO need to put glance image name here
432           #file: { get_input: vcpe_image_name }
433           file: ../Artifacts/Deployment/OTHER/image
434           type: tosca.artifacts.nfv.SwImage