fix tosca template bugs
[modeling/etsicatalog.git] / catalog / pub / utils / toscaparser / testdata / vnf / vcpesriov / infra / MainServiceTemplate.yaml
1 tosca_definitions_version: tosca_simple_yaml_1_0
2 metadata:
3   template_name: vCPE_infra
4   template_version: "1.0"
5   template_author: onap
6 description: vCPE_infra
7
8 imports:
9   - onap_dm.yaml
10
11 node_types:
12   onap.vcpe_infra:
13     derived_from: tosca.nodes.nfv.VNF
14     properties:
15       descriptor_id:
16         type: string
17       provider:
18         type: string
19       product_name:
20         type: string
21       software_version:
22         type: string
23       descriptor_version:
24         type: string
25       flavour_id:
26         type: string
27       flavour_description:
28         type: string
29       vnfm_info:
30         type: list
31         entry_schema:
32           type: string
33
34 topology_template:
35   substitution_mappings:
36     node_type: onap.vcpe_infra
37     properties:
38       descriptor_id: b1bb0ce7-1111-4fa7-95ed-4840d70a1177
39       provider: onap
40       product_name: vcpe_infra
41       software_version: '1.0'
42       descriptor_version: '1.0'
43       flavour_id: simple
44       flavour_description: simple
45       vnfm_info: gvnfm
46     requirements:
47       virtual_link: [ Cp_vaaa_public, virtual_link ] # expose as external CP
48       virtual_link: [ Cp_vaaa_onap_private, virtual_link ] # expose as external CP
49       virtual_link: [ Cp_vdns_public, virtual_link ]
50       virtual_link: [ Cp_vdns_onap_private, virtual_link ]
51       virtual_link: [ Cp_vdhcp_public, virtual_link ]
52       virtual_link: [ Cp_vdhcp_onap_private, virtual_link ]
53       virtual_link: [ Cp_vweb_public, virtual_link ]
54       virtual_link: [ Cp_vweb_onap_private, virtual_link ]
55
56   inputs:
57     vcpe_image_name:
58       type: string
59       description: image name for vcpe in openstack glance
60       default: ubuntu_16.04
61     public_net_id:
62       type: string
63       description: public network id used during onap installation
64       default: external
65     onap_private_net_id:
66       type: string
67       description: onap OAM network id
68       default: oam_onap
69     onap_private_net_cidr:
70       type: string
71       description: oanp OAM network cidr
72       default: 10.0.0.0/16
73     mr_ip_addr:
74       type: string
75       description: message router ip that for vDHCP configuration 
76       default: 10.0.11.1
77     mr_ip_port:
78       type: string
79       label: Message Router Port 
80       description: IP port of the Message Router that for vDHCP configuration 
81     dcae_collector_ip:
82       type: string
83       description: dcae collector ip
84       default: 10.0.4.102
85     dcae_collector_port:
86       type: integer
87       description: dcae collector port
88       default: 8080
89     nexus_artifact_repo:
90       type: string
91       description: Root URL for the Nexus repository for Maven artifacts
92       default: https://nexus.onap.org
93     demo_artifacts_version:
94       type: string
95       description: artifacts version used in demo vnfs
96       default: 1.2.0
97     install_script_version:
98       type: string
99       description: install script version number
100       default: 1.2.0-SNAPSHOT
101     cloud_env:
102       type: string
103       description: cloud environment(openstack or rackspace)
104       default: openstack
105     pub_key:
106       type: string
107       description: ssh public key
108       default: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGx6SKrAuCz1V8KGevZueksLdWoPWJP6z3r29Z7TmPVEOjM+7PIPeSs2BVRx3rnHZBAlasMrZ+fJBS25ts9vfC+ItezQah/hr9vrkmwxCR54Lb84poW+sToPeF6i5eZY7W+jWJfLaFSFx9d2vp4zes/fOlT3NvYCXbn/3QdryQoGl7VFI8oemZypVcikZXElJeeKgAVdSwnrzuqtO/tmbXcAeSbYvVjki8ywYcsWMVMYWUWhh+1BAB6kXnTsIWqzrq0Pfvy+81WDwtiqsqmd93HY8hE0scBrXFBZzQS/AYfIFBlEuFNdLczchntjbZ0n7dmDXk8zHtCZYNk7kwb8k/
109     cpe_signal_net_id:
110       type: string
111       description: cpe signal net name
112       default: zdfw1cpe01_private
113     cpe_signal_net_cidr:
114       type: string
115       description: cpe signal net cidr
116       default: 10.4.0.0/24
117     cpe_public_net_id:
118       type: string
119       description: cpe public net name
120       default: zdfw1cpe01_public
121     cpe_public_net_cidr:
122       type: string
123       description: cpe public net cidr
124       default: 10.2.0.0/24
125     vdhcp_name_0:
126       type: string
127       description: vdu vdhcp_0 name
128       default: zdcpe1cpe01dhcp01
129     vdhcp_private_ip_0:
130       type: string
131       description: ip of vdhcp port to cpe signal net
132       default: 10.4.0.1
133     vdhcp_private_ip_1:
134       type: string
135       description: ip of vdhcp port to onap oam net
136       default: 10.0.101.1
137     vaaa_name_0:
138       type: string
139       description: vdu vaaa_0 name
140       default: zdcpe1cpe01aaa01
141     vaaa_private_ip_0:
142       type: string
143       description: ip of vaaa port to cpe signal net
144       default: 10.4.0.4
145     vaaa_private_ip_1:
146       type: string
147       description: ip of vaaa port to onap oam net
148       default: 10.0.101.2
149     vdns_name_0:
150       type: string
151       description: vdu vdns_0 name
152       default: zdcpe1cpe01dns01
153     vdns_private_ip_0:
154       type: string
155       description: ip of vdns port to cpe public net
156       default: 10.2.0.1
157     vdns_private_ip_1:
158       type: string
159       description: ip of vdns port to onap oam net
160       default: 10.0.101.3
161     vweb_name_0:
162       type: string
163       description: vdu vweb_0 name
164       default: zdcpe1cpe01web01
165     vweb_private_ip_0:
166       type: string
167       description: ip of vweb port to cpe public net
168       default: 10.2.0.10
169     vweb_private_ip_1:
170       type: string
171       description: ip of vweb port to onap oam net
172       default: 10.0.101.40
173     vnf_id:
174       type: string
175       description: The VNF ID is provided by ONAP
176       default: vCPE_Infrastructure_demo_app
177     vf_module_id:
178       type: string
179       description: The vCPE Module ID is provided by ONAP
180       default: vCPE_Intrastructure
181
182   node_templates:
183     #onap public net
184 #    VL_public:
185 #      type: tosca.nodes.nfv.VnfVirtualLink
186 #      properties:
187 #        connectivity_type:
188 #          layer_protocol: ipv4
189 #        vl_profile:
190 #          max_bit_rate_requirements:
191 #            root: 10000000
192 #            leaf: 10000000
193 #          min_bit_rate_requirements:
194 #            root: 10000000
195 #            leaf: 10000000
196 #          networkName: { get_input: public_net_id }
197 #
198 #    #onap oam net
199 #    VL_onap_private:
200 #      type: tosca.nodes.nfv.VnfVirtualLink
201 #      properties:
202 #        connectivity_type:
203 #          layer_protocol: ipv4
204 #        vl_profile:
205 #          max_bit_rate_requirements:
206 #            root: 10000000
207 #            leaf: 10000000
208 #          min_bit_rate_requirements:
209 #            root: 10000000
210 #            leaf: 10000000
211 #          networkName: { get_input: onap_private_net_id }
212 #          cidr: { get_input: onap_private_net_cidr }
213
214     #cpe signal network
215     VL_cpe_signal:
216       type: tosca.nodes.nfv.VnfVirtualLink
217       properties:
218         connectivity_type:
219           layer_protocol: ipv4
220         vl_profile:
221           max_bit_rate_requirements:
222             root: 10000000
223             leaf: 10000000
224           min_bit_rate_requirements:
225             root: 10000000
226             leaf: 10000000
227           networkName: { get_input: cpe_signal_net_id}
228           cidr: { get_input: cpe_signal_net_cidr }
229           dhcpEnabled: false
230
231     #cpe public network
232     VL_cpe_public:
233       type: tosca.nodes.nfv.VnfVirtualLink
234       properties:
235         connectivity_type:
236           layer_protocol: ipv4
237         vl_profile:
238           max_bit_rate_requirements:
239             root: 10000000
240             leaf: 10000000
241           min_bit_rate_requirements:
242             root: 10000000
243             leaf: 10000000
244           networkName: { get_input: cpe_public_net_id}
245           cidr: { get_input: cpe_public_net_cidr }
246           dhcpEnabled: false
247
248     # vaaa related
249     Cp_vaaa_public:
250       type: tosca.nodes.nfv.VduCp
251       properties:
252         layer_protocol: [ipv4]
253         trunk_mode: false
254         protocol_data:
255           - asscociated_layer_protocol: ipv4
256             address_data:
257               address_type: ip_address
258               l3_address_data:
259                 ip_address_assignment: false
260                 floating_ip_activated: false
261       requirements:
262         - virtual_binding: VDU_vaaa_0
263 #        - virtual_link: VL_public
264
265     Cp_vaaa_onap_private:
266       type: tosca.nodes.nfv.VduCp
267       properties:
268         layer_protocol: [ipv4]
269         trunk_mode: false
270         protocol_data:
271           - asscociated_layer_protocol: ipv4
272             address_data:
273               address_type: ip_address
274               l3_address_data:
275                 ip_address_assignment: false
276                 floating_ip_activated: false
277                 fixed_ip_address:
278                   - { get_input: vaaa_private_ip_1 }
279       requirements:
280         - virtual_binding: VDU_vaaa_0
281 #        - virtual_link: VL_onap_private
282
283     Cp_vaaa_cpe_signal:
284       type: tosca.nodes.nfv.VduCp
285       properties:
286         layer_protocol: [ipv4]
287         trunk_mode: false
288         protocol_data:
289           - asscociated_layer_protocol: ipv4
290             address_data:
291               address_type: ip_address
292               l3_address_data:
293                 ip_address_assignment: false
294                 floating_ip_activated: false
295                 fixed_ip_address:
296                   - { get_input: vaaa_private_ip_0 }
297       requirements:
298         - virtual_binding: VDU_vaaa_0
299         - virtual_link: VL_cpe_signal
300
301     VirtualStorage_root_all:
302       # this indicate the VDU root storage size
303       type: tosca.nodes.nfv.Vdu.VirtualStorage
304       properties:
305         type_of_storage: root
306         size_of_storage: 40 GB
307
308     VDU_vaaa_0:
309       type: tosca.nodes.nfv.Vdu.Compute
310       properties:
311         name: { get_input: vaaa_name_0 }
312         description: vaaa
313         configurable_properties:
314           additional_vnfc_configurable_properties: {}
315         vdu_profile:
316           min_number_of_instances: 1
317           max_number_of_instances: 1
318           watchdog: none
319         inject_files: #TODO SDC Bug
320           source_path: ../Artifacts/keys/authorized_keys #SSH authorized_keys
321           dest_path: /home/ubuntu/.ssh/authorized_keys
322         meta_data:
323           vnf_id: { get_input: vnf_id }
324           vf_module_id: { get_input: vf_module_id }
325           dcae_collector_ip: { get_input: dcae_collector_ip }
326           dcae_collector_port: { get_input: dcae_collector_port }
327           cpe_signal_net_ipaddr: { get_input: vaaa_private_ip_0 }
328           oam_ipaddr: { get_input: vaaa_private_ip_1 }
329           oam_cidr: { get_input: onap_private_net_cidr }
330           cpe_signal_net_cidr: { get_input: cpe_signal_net_cidr }
331           demo_artifacts_version: { get_input: demo_artifacts_version }
332           install_script_version: { get_input: install_script_version }
333           cloud_env: { get_input: cloud_env }
334           nexus_artifact_repo: { get_input: nexus_artifact_repo }
335         user_data: |
336           #!/bin/bash
337           METADATA=`curl -s http://169.254.169.254/openstack/2012-08-10/meta_data.json`
338           apt-get -y install jq
339
340           get_metadata () {
341             echo $METADATA | jq -r ".meta.$1"
342           }
343
344           # Create configuration files
345           mkdir /opt/config
346           echo "$(get_metadata dcae_collector_ip)" > /opt/config/dcae_collector_ip.txt
347           echo "$(get_metadata dcae_collector_port)" > /opt/config/dcae_collector_port.txt
348           echo "$(get_metadata cpe_signal_net_ipaddr)" > /opt/config/cpe_signal_net_ipaddr.txt
349           echo "$(get_metadata oam_ipaddr)" > /opt/config/oam_ipaddr.txt
350           echo "$(get_metadata oam_cidr)" > /opt/config/oam_cidr.txt
351           echo "$(get_metadata cpe_signal_net_cidr)" > /opt/config/cpe_signal_net_cidr.txt
352           echo "$(get_metadata demo_artifacts_version)" > /opt/config/demo_artifacts_version.txt
353           echo "$(get_metadata install_script_version)" > /opt/config/install_script_version.txt
354           echo "$(get_metadata cloud_env)" > /opt/config/cloud_env.txt
355           echo "$(get_metadata nexus_artifact_repo)" > /opt/config/nexus_artifact_repo.txt
356
357           # Download and run install script
358           apt-get -y install unzip
359           INSTALL_SCRIPT_VERSION=$(get_metadata install_script_version)
360           NEXUS_ARTIFACT_REPO=$(get_metadata nexus_artifact_repo)
361           if [[ "${INSTALL_SCRIPT_VERSION}" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
362           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
363           unzip -j /opt/vcpe-scripts-${INSTALL_SCRIPT_VERSION}.zip -d /opt v_aaa_install.sh
364           cd /opt
365           chmod +x v_aaa_install.sh
366           ./v_aaa_install.sh
367       capabilities:
368         virtual_compute:
369           properties:
370             #TODO add local disk size
371             virtual_memory:
372               virtual_mem_size: 4096 MB
373             virtual_cpu:
374               num_virtual_cpu: 2
375       requirements:
376         - virtual_storage: VirtualStorage_root_all
377       artifacts:
378         sw_image: #TODO need to put glance image name here
379           #file: { get_input: vcpe_image_name }
380           file: ../Artifacts/images/ubuntu_16.04
381           type: tosca.artifacts.nfv.SwImage
382
383     # vdns related
384     Cp_vdns_public:
385       type: tosca.nodes.nfv.VduCp
386       properties:
387         layer_protocol: [ipv4]
388         trunk_mode: false
389         protocol_data:
390           - asscociated_layer_protocol: ipv4
391             address_data:
392               address_type: ip_address
393               l3_address_data:
394                 ip_address_assignment: false
395                 floating_ip_activated: false
396       requirements:
397         - virtual_binding: VDU_vdns_0
398 #        - virtual_link: VL_public
399
400     Cp_vdns_onap_private:
401       type: tosca.nodes.nfv.VduCp
402       properties:
403         layer_protocol: [ipv4]
404         trunk_mode: false
405         protocol_data:
406           - asscociated_layer_protocol: ipv4
407             address_data:
408               address_type: ip_address
409               l3_address_data:
410                 ip_address_assignment: false
411                 floating_ip_activated: false
412                 fixed_ip_address:
413                   - { get_input: vdns_private_ip_1 }
414       requirements:
415         - virtual_binding: VDU_vdns_0
416         #- virtual_link: VL_onap_private
417
418     Cp_vdns_cpe_public:
419       type: tosca.nodes.nfv.VduCp
420       properties:
421         layer_protocol: [ipv4]
422         trunk_mode: false
423         protocol_data:
424           - asscociated_layer_protocol: ipv4
425             address_data:
426               address_type: ip_address
427               l3_address_data:
428                 ip_address_assignment: false
429                 floating_ip_activated: false
430                 fixed_ip_address:
431                   - { get_input: vdns_private_ip_0 }
432       requirements:
433         - virtual_binding: VDU_vdns_0
434         - virtual_link: VL_cpe_public
435
436     VDU_vdns_0:
437       type: tosca.nodes.nfv.Vdu.Compute
438       properties:
439         name: { get_input: vdns_name_0 }
440         description: vdns
441         configurable_properties:
442           additional_vnfc_configurable_properties: {}
443         vdu_profile:
444           min_number_of_instances: 1
445           max_number_of_instances: 1
446           watchdog: none
447         inject_files: # TODO SDC Bug
448           source_path: ../Artifacts/keys/authorized_keys #SSH authorized_keys
449           dest_path: /home/ubuntu/.ssh/authorized_keys
450         meta_data:
451           vnf_id: { get_input: vnf_id }
452           vf_module_id: { get_input: vf_module_id }
453           oam_ipaddr: { get_input: vdns_private_ip_1 }
454           cpe_public_net_ipaddr: { get_input: vdns_private_ip_0 }
455           oam_cidr: { get_input: onap_private_net_cidr }
456           cpe_public_net_cidr: { get_input: cpe_public_net_cidr }
457           demo_artifacts_version: { get_input: demo_artifacts_version }
458           install_script_version: { get_input: install_script_version }
459           cloud_env: { get_input: cloud_env }
460           nexus_artifact_repo: { get_input: nexus_artifact_repo }
461         user_data: |
462           #!/bin/bash
463           METADATA=`curl -s http://169.254.169.254/openstack/2012-08-10/meta_data.json`
464           apt-get -y install jq
465
466           get_metadata () {
467             echo $METADATA | jq -r ".meta.$1"
468           }
469
470           # Create configuration files
471           mkdir /opt/config
472           echo "$(get_metadata oam_ipaddr)" > /opt/config/oam_ipaddr.txt
473           echo "$(get_metadata cpe_public_net_ipaddr)" > /opt/config/cpe_public_net_ipaddr.txt
474           echo "$(get_metadata onap_cidr)" > /opt/config/oam_cidr.txt
475           echo "$(get_metadata cpe_public_net_cidr)" > /opt/config/cpe_public_net_cidr.txt
476           echo "$(get_metadata demo_artifacts_version)" > /opt/config/demo_artifacts_version.txt
477           echo "$(get_metadata install_script_version)" > /opt/config/install_script_version.txt
478           echo "$(get_metadata cloud_env)" > /opt/config/cloud_env.txt
479           echo "$(get_metadata nexus_artifact_repo)" > /opt/config/nexus_artifact_repo.txt
480
481           # Download and run install script
482           apt-get -y install unzip
483           INSTALL_SCRIPT_VERSION=$(get_metadata install_script_version)
484           NEXUS_ARTIFACT_REPO=$(get_metadata nexus_artifact_repo)
485           if [[ "${INSTALL_SCRIPT_VERSION}" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
486           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
487           unzip -j /opt/vcpe-scripts-${INSTALL_SCRIPT_VERSION}.zip -d /opt v_dns_install.sh
488           cd /opt
489           chmod +x v_dns_install.sh
490           ./v_dns_install.sh
491       capabilities:
492         virtual_compute:
493           properties:
494             #TODO add local disk size
495             virtual_memory:
496               virtual_mem_size: 4096 MB
497             virtual_cpu:
498               num_virtual_cpu: 2
499       requirements:
500         - virtual_storage: VirtualStorage_root_all
501       artifacts:
502         sw_image: #TODO need to put glance image name here
503           #file: { get_input: vcpe_image_name }
504           file: ../Artifacts/images/ubuntu_16.04
505           type: tosca.artifacts.nfv.SwImage
506
507     # vdhcp related
508     Cp_vdhcp_public:
509       type: tosca.nodes.nfv.VduCp
510       properties:
511         layer_protocol: [ipv4]
512         trunk_mode: false
513         protocol_data:
514           - asscociated_layer_protocol: ipv4
515             address_data:
516               address_type: ip_address
517               l3_address_data:
518                 ip_address_assignment: false
519                 floating_ip_activated: false
520       requirements:
521         - virtual_binding: VDU_vdhcp_0
522 #        - virtual_link: VL_public
523
524     Cp_vdhcp_onap_private:
525       type: tosca.nodes.nfv.VduCp
526       properties:
527         layer_protocol: [ipv4]
528         trunk_mode: false
529         protocol_data:
530           - asscociated_layer_protocol: ipv4
531             address_data:
532               address_type: ip_address
533               l3_address_data:
534                 ip_address_assignment: false
535                 floating_ip_activated: false
536                 fixed_ip_address:
537                   - { get_input: vdhcp_private_ip_1 }
538       requirements:
539         - virtual_binding: VDU_vdhcp_0
540 #        - virtual_link: VL_onap_private
541
542     Cp_vdhcp_cpe_signal:
543       type: tosca.nodes.nfv.VduCp
544       properties:
545         layer_protocol: [ipv4]
546         trunk_mode: false
547         protocol_data:
548           - asscociated_layer_protocol: ipv4
549             address_data:
550               address_type: ip_address
551               l3_address_data:
552                 ip_address_assignment: false
553                 floating_ip_activated: false
554                 fixed_ip_address:
555                   - { get_input: vdhcp_private_ip_0 }
556       requirements:
557         - virtual_binding: VDU_vdhcp_0
558         - virtual_link: VL_cpe_signal
559
560     VDU_vdhcp_0:
561       type: tosca.nodes.nfv.Vdu.Compute
562       properties:
563         name: { get_input: vdhcp_name_0 }
564         description: vdhcp
565         configurable_properties:
566           additional_vnfc_configurable_properties: {}
567         vdu_profile:
568           min_number_of_instances: 1
569           max_number_of_instances: 1
570           watchdog: none
571         inject_files: #SDC Bug
572           source_path: ../Artifacts/keys/authorized_keys #SSH authorized_keys
573           dest_path: /home/ubuntu/.ssh/authorized_keys
574         meta_data:
575           vnf_id: { get_input: vnf_id }
576           vf_module_id: { get_input: vf_module_id }
577           oam_ipaddr: { get_input: vdhcp_private_ip_1 }
578           cpe_signal_ipaddr: { get_input: vdhcp_private_ip_0 }
579           oam_cidr: { get_input: onap_private_net_cidr }
580           cpe_signal_net_cidr: { get_input: cpe_signal_net_cidr }
581           mr_ip_addr: { get_input: mr_ip_addr }
582           mr_ip_port: { get_input: mr_ip_port }
583           demo_artifacts_version: { get_input: demo_artifacts_version }
584           install_script_version: { get_input: install_script_version }
585           cloud_env: { get_input: cloud_env }
586           nexus_artifact_repo: { get_input: nexus_artifact_repo }
587         user_data: |
588           #!/bin/bash
589           METADATA=`curl -s http://169.254.169.254/openstack/2012-08-10/meta_data.json`
590           apt-get -y install jq
591
592           get_metadata () {
593             echo $METADATA | jq -r ".meta.$1"
594           }
595
596           # Create configuration files
597           mkdir /opt/config
598           echo "$(get_metadata oam_ipaddr)" > /opt/config/oam_ipaddr.txt
599           echo "$(get_metadata cpe_signal_ipaddr)" > /opt/config/cpe_signal_ipaddr.txt
600           echo "$(get_metadata onap_cidr)" > /opt/config/oam_cidr.txt
601           echo "$(get_metadata cpe_signal_net_cidr)" > /opt/config/cpe_signal_net_cidr.txt
602           echo "$(get_metadata mr_ip_addr)" > /opt/config/mr_ip_addr.txt
603           echo "$(get_metadata mr_ip_port)" > /opt/config/mr_ip_port.txt
604           echo "$(get_metadata demo_artifacts_version)" > /opt/config/demo_artifacts_version.txt
605           echo "$(get_metadata install_script_version)" > /opt/config/install_script_version.txt
606           echo "$(get_metadata cloud_env)" > /opt/config/cloud_env.txt
607           echo "$(get_metadata nexus_artifact_repo)" > /opt/config/nexus_artifact_repo.txt
608
609           # Download and run install script
610           apt-get -y install unzip
611           INSTALL_SCRIPT_VERSION=$(get_metadata install_script_version)
612           NEXUS_ARTIFACT_REPO=$(get_metadata nexus_artifact_repo)
613           if [[ "${INSTALL_SCRIPT_VERSION}" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
614           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
615           unzip -j /opt/vcpe-scripts-${INSTALL_SCRIPT_VERSION}.zip -d /opt v_dhcp_install.sh
616           cd /opt
617           chmod +x v_dhcp_install.sh
618           ./v_dhcp_install.sh
619       capabilities:
620         virtual_compute:
621           properties:
622             #TODO add local disk size
623             virtual_memory:
624               virtual_mem_size: 4096 MB
625             virtual_cpu:
626               num_virtual_cpu: 2
627       requirements:
628         - virtual_storage: VirtualStorage_root_all
629       artifacts:
630         sw_image: #TODO need to put glance image name here
631           #file: { get_input: vcpe_image_name }
632           file: ../Artifacts/images/ubuntu_16.04
633           type: tosca.artifacts.nfv.SwImage
634
635     # vweb related
636     Cp_vweb_public:
637       type: tosca.nodes.nfv.VduCp
638       properties:
639         layer_protocol: [ipv4]
640         trunk_mode: false
641         protocol_data:
642           - asscociated_layer_protocol: ipv4
643             address_data:
644               address_type: ip_address
645               l3_address_data:
646                 ip_address_assignment: false
647                 floating_ip_activated: false
648       requirements:
649         - virtual_binding: VDU_vweb_0
650 #        - virtual_link: VL_public
651
652     Cp_vweb_onap_private:
653       type: tosca.nodes.nfv.VduCp
654       properties:
655         layer_protocol: [ipv4]
656         trunk_mode: false
657         protocol_data:
658           - asscociated_layer_protocol: ipv4
659             address_data:
660               address_type: ip_address
661               l3_address_data:
662                 ip_address_assignment: false
663                 floating_ip_activated: false
664                 fixed_ip_address:
665                   - { get_input: vweb_private_ip_1 }
666       requirements:
667         - virtual_binding: VDU_vweb_0
668 #        - virtual_link: VL_onap_private
669
670     Cp_vweb_cpe_public:
671       type: tosca.nodes.nfv.VduCp
672       properties:
673         layer_protocol: [ipv4]
674         trunk_mode: false
675         protocol_data:
676           - asscociated_layer_protocol: ipv4
677             address_data:
678               address_type: ip_address
679               l3_address_data:
680                 ip_address_assignment: false
681                 floating_ip_activated: false
682                 fixed_ip_address:
683                   - { get_input: vweb_private_ip_0 }
684       requirements:
685         - virtual_binding: VDU_vweb_0
686         - virtual_link: VL_cpe_public
687
688     VDU_vweb_0:
689       type: tosca.nodes.nfv.Vdu.Compute
690       properties:
691         name: { get_input: vweb_name_0 }
692         description: vweb
693         configurable_properties:
694           additional_vnfc_configurable_properties: {}
695         vdu_profile:
696           min_number_of_instances: 1
697           max_number_of_instances: 1
698           watchdog: none
699         inject_files: # TODO SDC bug
700           source_path: ../Artifacts/keys/authorized_keys #SSH authorized_keys
701           dest_path: /home/ubuntu/.ssh/authorized_keys
702         meta_data:
703           vnf_id: { get_input: vnf_id }
704           vf_module_id: { get_input: vf_module_id }
705           oam_ipaddr: { get_input: vweb_private_ip_1 }
706           cpe_public_ipaddr: { get_input: vweb_private_ip_0 }
707           oam_cidr: { get_input: onap_private_net_cidr }
708           cpe_public_net_cidr: { get_input: cpe_public_net_cidr }
709           demo_artifacts_version: { get_input: demo_artifacts_version }
710           install_script_version: { get_input: install_script_version }
711           cloud_env: { get_input: cloud_env }
712           nexus_artifact_repo: { get_input: nexus_artifact_repo }
713         user_data: |
714           #!/bin/bash
715           METADATA=`curl -s http://169.254.169.254/openstack/2012-08-10/meta_data.json`
716           apt-get -y install jq
717
718           get_metadata () {
719             echo $METADATA | jq -r ".meta.$1"
720           }
721
722           # Create configuration files
723           mkdir /opt/config
724           echo "$(get_metadata oam_ipaddr)" > /opt/config/oam_ipaddr.txt
725           echo "$(get_metadata cpe_public_ipaddr)" > /opt/config/cpe_public_ipaddr.txt
726           echo "$(get_metadata onap_cidr)" > /opt/config/oam_cidr.txt
727           echo "$(get_metadata cpe_public_net_cidr)" > /opt/config/cpe_public_net_cidr.txt
728           echo "$(get_metadata demo_artifacts_version)" > /opt/config/demo_artifacts_version.txt
729           echo "$(get_metadata install_script_version)" > /opt/config/install_script_version.txt
730           echo "$(get_metadata cloud_env)" > /opt/config/cloud_env.txt
731           echo "$(get_metadata nexus_artifact_repo)" > /opt/config/nexus_artifact_repo.txt
732
733           # Download and run install script
734           apt-get -y install unzip
735           INSTALL_SCRIPT_VERSION=$(get_metadata install_script_version)
736           NEXUS_ARTIFACT_REPO=$(get_metadata nexus_artifact_repo)
737           if [[ "${INSTALL_SCRIPT_VERSION}" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
738           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
739           unzip -j /opt/vcpe-scripts-${INSTALL_SCRIPT_VERSION}.zip -d /opt v_web_install.sh
740           cd /opt
741           chmod +x v_web_install.sh
742           ./v_web_install.sh
743       capabilities:
744         virtual_compute:
745           properties:
746             #TODO add local disk size
747             virtual_memory:
748               virtual_mem_size: 4096 MB
749             virtual_cpu:
750               num_virtual_cpu: 2
751       requirements:
752         - virtual_storage: VirtualStorage_root_all
753       artifacts:
754         sw_image: #TODO need to put glance image name here
755           #file: { get_input: vcpe_image_name }
756           file: ../Artifacts/images/ubuntu_16.04
757           type: tosca.artifacts.nfv.SwImage
758