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