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