Fix spacing issues in YAML files in tosca/
[demo.git] / tosca / vCPE / vgmux / MainServiceTemplate_sriov.yaml
1 tosca_definitions_version: tosca_simple_yaml_1_0
2 metadata:
3   template_name: vCPE_vgmux
4   template_version: "1.0"
5   template_author: onap
6   VNFD_SCHEMA_VERSION: "2.5.1+1"
7 description: vCPE_vgmux
8
9 imports:
10   - onap_dm.yaml
11
12 topology_template:
13 #  substitution_mappings:
14 #    node_type: onap.vcpe_vgmux
15 #    requirements:
16 #      virtual_link: [ Cp_vgmux_public, virtual_link ] # expose as external CP
17 #      virtual_link: [ Cp_vgmux_onap_private, virtual_link ] # expose as external CP
18
19   inputs:
20     vcpe_image_name:
21       type: string
22       description: image name for vcpe in openstack glance
23       default: ubuntu_16.04
24     public_net_id:
25       type: string
26       description: public network id used during onap installation
27     onap_private_net_id:
28       type: string
29       description: onap OAM network id
30     onap_private_net_cidr:
31       type: string
32       description: oanp OAM network cidr
33       default: 10.0.0.0/16
34     bng_gmux_private_net_id:
35       type: string
36       description: Private network that connects vBNG to vGMUX
37       default: zdfw1bngmux01_private
38     bng_gmux_private_net_cidr:
39       type: string
40       description: The CIDR of the vBNG-vGMUX private network
41       default: 10.1.0.0/24
42     mux_gw_private_net_id:
43       type: string
44       description: Private network that connects vGMUX to vGWs
45       default: zdfw1muxgw01_private
46     mux_gw_private_net_cidr:
47       type: string
48       description: The CIDR of the vGMUX private network
49       default: 10.5.0.0/24
50     brgemu_bng_private_net_cidr:
51       type: string
52       description: The CIDR of the vBRG-vBNG private network
53       default: 10.3.0.0/24
54     vgmux_private_ip_0:
55       type: string
56       description: Private IP address that is assigned to the vGMUX to communicate with the vBNG
57       default: 10.1.0.20
58     vgmux_private_ip_1:
59       type: string
60       description: Private IP address that is assigned to the vGMUX to communicate with ONAP components
61       default: 10.0.101.20
62     vgmux_private_ip_2:
63       type: string
64       description: Private IP address that is assigned to the vGMUX to communicate with vGWs
65       default: 10.5.0.20
66     vgmux_name_0:
67       type: string
68       description: Name of the vGMUX
69       default: zdcpe1cpe01mux01
70     vnf_id:
71       type: string
72       description: The VNF ID is provided by ONAP
73       default: vCPE_Infrastructure_vGMUX_demo_app
74     vf_module_id:
75       type: string
76       description: The vCPE Module ID is provided by ONAP
77       default: vCPE_Intrastructure_Metro_vGMUX
78     bng_gmux_private_ip:
79       type: string
80       description: Private IP address that is assigned to the vBNG to communicate with the vGMUX
81       default: 10.1.0.10
82     dcae_collector_ip:
83       type: string
84       description: dcae collector ip
85       default: 10.0.4.102
86     dcae_collector_port:
87       type: string
88       description: dcae collector port
89       default: "8080"
90     pub_key:
91       type: string
92       description: ssh public key
93       default: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGx6SKrAuCz1V8KGevZueksLdWoPWJP6z3r29Z7TmPVEOjM+7PIPeSs2BVRx3rnHZBAlasMrZ+fJBS25ts9vfC+ItezQah/hr9vrkmwxCR54Lb84poW+sToPeF6i5eZY7W+jWJfLaFSFx9d2vp4zes/fOlT3NvYCXbn/3QdryQoGl7VFI8oemZypVcikZXElJeeKgAVdSwnrzuqtO/tmbXcAeSbYvVjki8ywYcsWMVMYWUWhh+1BAB6kXnTsIWqzrq0Pfvy+81WDwtiqsqmd93HY8hE0scBrXFBZzQS/AYfIFBlEuFNdLczchntjbZ0n7dmDXk8zHtCZYNk7kwb8k/
94     install_script_version:
95       type: string
96       description: install script version number
97       default: 1.2.0-SNAPSHOT
98     nexus_artifact_repo:
99       type: string
100       description: Root URL for the Nexus repository for Maven artifacts
101       default: https://nexus.onap.org
102     cloud_env:
103       type: string
104       description: cloud environment(openstack or rackspace)
105       default: openstack
106
107   node_templates:
108     LLU_VNF:
109       type: tosca.nodes.nfv.VNF
110       properties:
111         descriptor_id: b1bb0ce7-2222-4fa7-95ed-4840d70a1177
112         provider: onap
113         product_name: vcpe_vgmux
114         software_version: '1.0'
115         descriptor_version: '1.0'
116         flavour_id: simple
117         flavour_description: simple
118         vnfm_info: ['gvnfm']
119
120
121     #onap public net
122 #    VL_public:
123 #      type: tosca.nodes.nfv.VnfVirtualLink
124 #      properties:
125 #        connectivity_type:
126 #          layer_protocols: [ipv4]
127 #        vl_profile:
128 #          max_bitrate_requirements:
129 #            root: 10000000
130 #            leaf: 10000000
131 #          min_bitrate_requirements:
132 #            root: 10000000
133 #            leaf: 10000000
134 #          virtual_link_protocol_data:
135 #            - associated_layer_protocol: ipv4
136 #              l3_protocol_data:
137 #                ip_version: ipv4
138 #                name: { get_input: public_net_id }
139 #
140 #    #onap oam net
141 #    VL_onap_private:
142 #      type: tosca.nodes.nfv.VnfVirtualLink
143 #      properties:
144 #        connectivity_type:
145 #          layer_protocols: [ipv4]
146 #        vl_profile:
147 #          max_bitrate_requirements:
148 #            root: 10000000
149 #            leaf: 10000000
150 #          min_bitrate_requirements:
151 #            root: 10000000
152 #            leaf: 10000000
153 #          virtual_link_protocol_data:
154 #            - associated_layer_protocol: ipv4
155 #              l3_protocol_data:
156 #                ip_version: ipv4
157 #                name: { get_input: onap_private_net_id }
158 #                cidr: { get_input: onap_private_net_cidr }
159
160     #Private network that connects vBNG to vGMUX
161     VL_bng_gmux_private_net:
162       type: tosca.nodes.nfv.VnfVirtualLink
163       properties:
164         connectivity_type:
165           layer_protocols: [ipv4]
166         vl_profile:
167           max_bitrate_requirements:
168             root: 10000000
169             leaf: 10000000
170           min_bitrate_requirements:
171             root: 10000000
172             leaf: 10000000
173           virtual_link_protocol_data:
174             - associated_layer_protocol: ipv4
175               l3_protocol_data:
176                 ip_version: ipv4
177                 name: { get_input: bng_gmux_private_net_id}
178                 cidr: { get_input: bng_gmux_private_net_cidr }
179                 dhcp_enabled: false
180               l2_protocol_data:
181                 physical_network: "physnet1"
182
183     #Private network that connects vGMUX to vGWs
184     VL_mux_gw_private_net:
185       type: tosca.nodes.nfv.VnfVirtualLink
186       properties:
187         connectivity_type:
188           layer_protocols: [ipv4]
189         vl_profile:
190           max_bitrate_requirements:
191             root: 10000000
192             leaf: 10000000
193           min_bitrate_requirements:
194             root: 10000000
195             leaf: 10000000
196           virtual_link_protocol_data:
197             - associated_layer_protocol: ipv4
198               l3_protocol_data:
199                 ip_version: ipv4
200                 name: { get_input: mux_gw_private_net_id}
201                 cidr: { get_input: mux_gw_private_net_cidr }
202                 dhcp_enabled: false
203               l2_protocol_data:
204                 physical_network: "physnet1"
205
206     # vgmux related
207     Cp_vgmux_public:
208       type: tosca.nodes.nfv.VduCp
209       properties:
210         layer_protocols: [ipv4]
211         trunk_mode: false
212         protocol:
213           - associated_layer_protocol: ipv4
214             address_data:
215               - address_type: ip_address
216                 l3_address_data:
217                   ip_address_assignment: false
218                   floating_ip_activated: false
219       requirements:
220         - virtual_binding: VDU_vgmux_0
221         #- virtual_link: VL_public
222
223     Cp_vgmux_onap_private:
224       type: tosca.nodes.nfv.VduCp
225       properties:
226         layer_protocols: [ipv4]
227         trunk_mode: false
228         protocol:
229           - associated_layer_protocol: ipv4
230             address_data:
231               - address_type: ip_address
232                 l3_address_data:
233                   ip_address_assignment: false
234                   floating_ip_activated: false
235                   fixed_ip_address:
236                     - { get_input: vgmux_private_ip_1 }
237       requirements:
238         - virtual_binding: VDU_vgmux_0
239         #- virtual_link: VL_onap_private
240
241     Cp_vgmux_bng_gmux_private_net:
242       type: tosca.nodes.nfv.VduCp
243       properties:
244         layer_protocols: [ipv4]
245         trunk_mode: false
246         protocol:
247           - associated_layer_protocol: ipv4
248             address_data:
249               - address_type: ip_address
250                 l3_address_data:
251                   ip_address_assignment: false
252                   floating_ip_activated: false
253                   fixed_ip_address:
254                     - { get_input: vgmux_private_ip_0 }
255         vnic_type: "direct"
256         virtual_network_interface_requirements:
257           - name: "sriov-support"
258             support_mandatory: true
259             network_interface_requirements:
260               interfaceType: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "SR-IOV"}'
261             nic_io_requirements:
262               logical_node_requirements:
263                 pciVendorId: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "1234"}'
264                 pciDeviceId: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "5678"}'
265                 pciNumDevices: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "1"}'
266       requirements:
267         - virtual_binding: VDU_vgmux_0
268         - virtual_link: VL_bng_gmux_private_net
269
270     Cp_vgmux_mux_gw_private_net:
271       type: tosca.nodes.nfv.VduCp
272       properties:
273         layer_protocols: [ipv4]
274         trunk_mode: false
275         protocol:
276           - associated_layer_protocol: ipv4
277             address_data:
278               - address_type: ip_address
279                 l3_address_data:
280                   ip_address_assignment: false
281                   floating_ip_activated: false
282                   fixed_ip_address:
283                     - { get_input: vgmux_private_ip_2 }
284         vnic_type: "direct"
285         virtual_network_interface_requirements:
286           - name: "sriov-support"
287             support_mandatory: true
288             network_interface_requirements:
289               interfaceType: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "SR-IOV"}'
290             nic_io_requirements:
291               logical_node_requirements:
292                 pciVendorId: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "1234"}'
293                 pciDeviceId: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "5678"}'
294                 pciNumDevices: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "1"}'
295       requirements:
296         - virtual_binding: VDU_vgmux_0
297         - virtual_link: VL_mux_gw_private_net
298
299     VDU_vgmux_0:
300       type: tosca.nodes.nfv.Vdu.Compute
301       properties:
302         name: { get_input: vgmux_name_0 }
303         description: vgmux
304         vdu_profile:
305           min_number_of_instances: 1
306           max_number_of_instances: 1
307           watchdog: none
308         inject_files: #TODO SDC bug
309           source_path: ../Artifacts/Deployment/OTHER/authorized_keys #SSH authorized_keys
310           dest_path: /home/ubuntu/.ssh/authorized_keys
311         meta_data:
312           vnf_id: { get_input: vnf_id }
313           vf_module_id: { get_input: vf_module_id }
314           mux_to_bng_net_ipaddr: { get_input: vgmux_private_ip_0 }
315           oam_ipaddr: { get_input: vgmux_private_ip_1 }
316           mux_gw_net_ipaddr: { get_input: vgmux_private_ip_2 }
317           bng_to_mux_net_ipaddr: { get_input: bng_gmux_private_ip }
318           bng_mux_net_cidr: { get_input: bng_gmux_private_net_cidr }
319           oam_cidr: { get_input: onap_private_net_cidr }
320           mux_gw_net_cidr: { get_input: mux_gw_private_net_cidr }
321           brg_bng_net_cidr: { get_input: brgemu_bng_private_net_cidr }
322           install_script_version: { get_input: install_script_version }
323           cloud_env: { get_input: cloud_env }
324           nexus_artifact_repo: { get_input: nexus_artifact_repo }
325         boot_data: |
326           #!/bin/bash
327           METADATA=`curl -s http://169.254.169.254/openstack/2012-08-10/meta_data.json`
328           apt-get -y install jq
329
330           get_metadata () {
331             echo $METADATA | jq -r ".meta.$1"
332           }
333
334           # Create configuration files
335           mkdir /opt/config
336           echo "$(get_metadata mux_to_bng_net_ipaddr)" > /opt/config/mux_to_bng_net_ipaddr.txt
337           echo "$(get_metadata oam_ipaddr)" > /opt/config/oam_ipaddr.txt
338           echo "$(get_metadata mux_gw_net_ipaddr)" > /opt/config/mux_gw_net_ipaddr.txt
339           echo "$(get_metadata bng_to_mux_net_ipaddr)" > /opt/config/bng_to_mux_net_ipaddr.txt
340           echo "$(get_metadata bng_mux_net_cidr)" > /opt/config/bng_mux_net_cidr.txt
341           echo "$(get_metadata oam_cidr)" > /opt/config/oam_cidr.txt
342           echo "$(get_metadata mux_gw_net_cidr)" > /opt/config/mux_gw_net_cidr.txt
343           echo "$(get_metadata brg_bng_net_cidr)" > /opt/config/brg_bng_net_cidr.txt
344           echo "$(get_metadata install_script_version)" > /opt/config/install_script_version.txt
345           echo "$(get_metadata cloud_env)" > /opt/config/cloud_env.txt
346           echo "$(get_metadata nexus_artifact_repo)" > /opt/config/nexus_artifact_repo.txt
347
348           # Download and run install script
349           apt-get -y install unzip
350           INSTALL_SCRIPT_VERSION=$(get_metadata install_script_version)
351           NEXUS_ARTIFACT_REPO=$(get_metadata nexus_artifact_repo)
352           if [[ "${INSTALL_SCRIPT_VERSION}" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
353           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
354           unzip -j /opt/vcpe-scripts-${INSTALL_SCRIPT_VERSION}.zip -d /opt v_gmux_install.sh
355           cd /opt
356           chmod +x v_gmux_install.sh
357           ./v_gmux_install.sh
358       capabilities:
359         virtual_compute:
360           properties:
361             virtual_memory:
362               virtual_mem_size: 4096 MB
363               vdu_mem_requirements:
364                 memoryPageSize: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "2 MB"}'
365                 numberOfPages: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "1024"}'
366             virtual_cpu:
367               num_virtual_cpu: 2
368               cpu_architecture: generic
369             virtual_local_storage:
370               - size_of_storage: 40 GB
371       artifacts:
372         sw_image: #TODO need to put glance image name here
373           #file: { get_input: vcpe_image_name }
374           file: ../Artifacts/Deployment/OTHER/image
375           type: tosca.artifacts.nfv.SwImage