1 tosca_definitions_version: tosca_simple_yaml_1_0
3 template_name: vCPE_infra
4 template_version: "1.0"
6 description: vCPE_infra
13 derived_from: tosca.nodes.nfv.VNF
17 constraints: [ valid_values: [ b1bb0ce7-1111-4fa7-95ed-4840d70a1177 ] ]
18 default: b1bb0ce7-1111-4fa7-95ed-4840d70a1177
21 constraints: [ valid_values: [ onap ] ]
25 constraints: [ valid_values: [ vcpe_infra ] ]
29 constraints: [ valid_values: [ '1.0' ] ]
33 constraints: [ valid_values: [ '1.0' ] ]
37 constraints: [ valid_values: [ simple ] ] #only one and only allowed one DF in this example
49 # substitution_mappings:
50 # node_type: onap.vcpe_infra
52 # virtual_link: [ Cp_vaaa_public, virtual_link ] # expose as external CP
53 # virtual_link: [ Cp_vaaa_onap_private, virtual_link ] # expose as external CP
54 # virtual_link: [ Cp_vdns_public, virtual_link ]
55 # virtual_link: [ Cp_vdns_onap_private, virtual_link ]
56 # virtual_link: [ Cp_vdhcp_public, virtual_link ]
57 # virtual_link: [ Cp_vdhcp_onap_private, virtual_link ]
58 # virtual_link: [ Cp_vweb_public, virtual_link ]
59 # virtual_link: [ Cp_vweb_onap_private, virtual_link ]
64 description: image name for vcpe in openstack glance
68 description: public network id used during onap installation
72 description: onap OAM network id
74 onap_private_net_cidr:
76 description: oanp OAM network cidr
80 description: message router ip that for vDHCP configuration
84 # label: Message Router Port
85 description: IP port of the Message Router that for vDHCP configuration
89 description: dcae collector ip
93 description: dcae collector port
97 description: Root URL for the Nexus repository for Maven artifacts
98 default: https://nexus.onap.org
99 demo_artifacts_version:
101 description: artifacts version used in demo vnfs
103 install_script_version:
105 description: install script version number
106 default: 1.2.0-SNAPSHOT
109 description: cloud environment(openstack or rackspace)
113 description: ssh public key
114 default: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGx6SKrAuCz1V8KGevZueksLdWoPWJP6z3r29Z7TmPVEOjM+7PIPeSs2BVRx3rnHZBAlasMrZ+fJBS25ts9vfC+ItezQah/hr9vrkmwxCR54Lb84poW+sToPeF6i5eZY7W+jWJfLaFSFx9d2vp4zes/fOlT3NvYCXbn/3QdryQoGl7VFI8oemZypVcikZXElJeeKgAVdSwnrzuqtO/tmbXcAeSbYvVjki8ywYcsWMVMYWUWhh+1BAB6kXnTsIWqzrq0Pfvy+81WDwtiqsqmd93HY8hE0scBrXFBZzQS/AYfIFBlEuFNdLczchntjbZ0n7dmDXk8zHtCZYNk7kwb8k/
117 description: cpe signal net name
118 default: zdfw1cpe01_private
121 description: cpe signal net cidr
125 description: cpe public net name
126 default: zdfw1cpe01_public
129 description: cpe public net cidr
133 description: vdu vdhcp_0 name
134 default: zdcpe1cpe01dhcp01
137 description: ip of vdhcp port to cpe signal net
141 description: ip of vdhcp port to onap oam net
145 description: vdu vaaa_0 name
146 default: zdcpe1cpe01aaa01
149 description: ip of vaaa port to cpe signal net
153 description: ip of vaaa port to onap oam net
157 description: vdu vdns_0 name
158 default: zdcpe1cpe01dns01
161 description: ip of vdns port to cpe public net
165 description: ip of vdns port to onap oam net
169 description: vdu vweb_0 name
170 default: zdcpe1cpe01web01
173 description: ip of vweb port to cpe public net
177 description: ip of vweb port to onap oam net
181 description: The VNF ID is provided by ONAP
182 default: vCPE_Infrastructure_demo_app
185 description: The vCPE Module ID is provided by ONAP
186 default: vCPE_Intrastructure
191 # type: tosca.nodes.nfv.VnfVirtualLink
194 # layer_protocol: ipv4
196 # max_bit_rate_requirements:
199 # min_bit_rate_requirements:
202 # networkName: { get_input: public_net_id }
206 # type: tosca.nodes.nfv.VnfVirtualLink
209 # layer_protocol: ipv4
211 # max_bit_rate_requirements:
214 # min_bit_rate_requirements:
217 # networkName: { get_input: onap_private_net_id }
218 # cidr: { get_input: onap_private_net_cidr }
222 type: tosca.nodes.nfv.VnfVirtualLink
227 max_bit_rate_requirements:
230 min_bit_rate_requirements:
233 networkName: { get_input: cpe_signal_net_id}
234 cidr: { get_input: cpe_signal_net_cidr }
239 type: tosca.nodes.nfv.VnfVirtualLink
244 max_bit_rate_requirements:
247 min_bit_rate_requirements:
250 networkName: { get_input: cpe_public_net_id}
251 cidr: { get_input: cpe_public_net_cidr }
256 type: tosca.nodes.nfv.VduCp
258 layer_protocol: [ipv4]
261 - asscociated_layer_protocol: ipv4
263 address_type: ip_address
265 ip_address_assignment: false
266 floating_ip_activated: false
268 - virtual_binding: VDU_vaaa_0
269 # - virtual_link: VL_public
271 Cp_vaaa_onap_private:
272 type: tosca.nodes.nfv.VduCp
274 layer_protocol: [ipv4]
277 - asscociated_layer_protocol: ipv4
279 address_type: ip_address
281 ip_address_assignment: false
282 floating_ip_activated: false
284 - { get_input: vaaa_private_ip_1 }
286 - virtual_binding: VDU_vaaa_0
287 # - virtual_link: VL_onap_private
290 type: tosca.nodes.nfv.VduCp
292 layer_protocol: [ipv4]
295 - asscociated_layer_protocol: ipv4
297 address_type: ip_address
299 ip_address_assignment: false
300 floating_ip_activated: false
302 - { get_input: vaaa_private_ip_0 }
304 - virtual_binding: VDU_vaaa_0
305 - virtual_link: VL_cpe_signal
307 VirtualStorage_root_all:
308 # this indicate the VDU root storage size
309 type: tosca.nodes.nfv.Vdu.VirtualStorage
311 type_of_storage: root
312 size_of_storage: 40 GB
315 type: tosca.nodes.nfv.Vdu.Compute
317 name: { get_input: vaaa_name_0 }
319 configurable_properties:
320 additional_vnfc_configurable_properties: {}
322 min_number_of_instances: 1
323 max_number_of_instances: 1
325 inject_files: #TODO SDC Bug
326 source_path: ../Artifacts/keys/authorized_keys #SSH authorized_keys
327 dest_path: /home/ubuntu/.ssh/authorized_keys
329 vnf_id: { get_input: vnf_id }
330 vf_module_id: { get_input: vf_module_id }
331 dcae_collector_ip: { get_input: dcae_collector_ip }
332 dcae_collector_port: { get_input: dcae_collector_port }
333 cpe_signal_net_ipaddr: { get_input: vaaa_private_ip_0 }
334 oam_ipaddr: { get_input: vaaa_private_ip_1 }
335 oam_cidr: { get_input: onap_private_net_cidr }
336 cpe_signal_net_cidr: { get_input: cpe_signal_net_cidr }
337 demo_artifacts_version: { get_input: demo_artifacts_version }
338 install_script_version: { get_input: install_script_version }
339 cloud_env: { get_input: cloud_env }
340 nexus_artifact_repo: { get_input: nexus_artifact_repo }
343 METADATA=`curl -s http://169.254.169.254/openstack/2012-08-10/meta_data.json`
344 apt-get -y install jq
347 echo $METADATA | jq -r ".meta.$1"
350 # Create configuration files
352 echo "$(get_metadata dcae_collector_ip)" > /opt/config/dcae_collector_ip.txt
353 echo "$(get_metadata dcae_collector_port)" > /opt/config/dcae_collector_port.txt
354 echo "$(get_metadata cpe_signal_net_ipaddr)" > /opt/config/cpe_signal_net_ipaddr.txt
355 echo "$(get_metadata oam_ipaddr)" > /opt/config/oam_ipaddr.txt
356 echo "$(get_metadata oam_cidr)" > /opt/config/oam_cidr.txt
357 echo "$(get_metadata cpe_signal_net_cidr)" > /opt/config/cpe_signal_net_cidr.txt
358 echo "$(get_metadata demo_artifacts_version)" > /opt/config/demo_artifacts_version.txt
359 echo "$(get_metadata install_script_version)" > /opt/config/install_script_version.txt
360 echo "$(get_metadata cloud_env)" > /opt/config/cloud_env.txt
361 echo "$(get_metadata nexus_artifact_repo)" > /opt/config/nexus_artifact_repo.txt
363 # Download and run install script
364 apt-get -y install unzip
365 INSTALL_SCRIPT_VERSION=$(get_metadata install_script_version)
366 NEXUS_ARTIFACT_REPO=$(get_metadata nexus_artifact_repo)
367 if [[ "${INSTALL_SCRIPT_VERSION}" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
368 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
369 unzip -j /opt/vcpe-scripts-${INSTALL_SCRIPT_VERSION}.zip -d /opt v_aaa_install.sh
371 chmod +x v_aaa_install.sh
376 #TODO add local disk size
378 virtual_mem_size: 4096 MB
382 - virtual_storage: VirtualStorage_root_all
384 sw_image: #TODO need to put glance image name here
385 #file: { get_input: vcpe_image_name }
386 file: ../Artifacts/images/ubuntu_16.04
387 type: tosca.artifacts.nfv.SwImage
391 type: tosca.nodes.nfv.VduCp
393 layer_protocol: [ipv4]
396 - asscociated_layer_protocol: ipv4
398 address_type: ip_address
400 ip_address_assignment: false
401 floating_ip_activated: false
403 - virtual_binding: VDU_vdns_0
404 # - virtual_link: VL_public
406 Cp_vdns_onap_private:
407 type: tosca.nodes.nfv.VduCp
409 layer_protocol: [ipv4]
412 - asscociated_layer_protocol: ipv4
414 address_type: ip_address
416 ip_address_assignment: false
417 floating_ip_activated: false
419 - { get_input: vdns_private_ip_1 }
421 - virtual_binding: VDU_vdns_0
422 #- virtual_link: VL_onap_private
425 type: tosca.nodes.nfv.VduCp
427 layer_protocol: [ipv4]
430 - asscociated_layer_protocol: ipv4
432 address_type: ip_address
434 ip_address_assignment: false
435 floating_ip_activated: false
437 - { get_input: vdns_private_ip_0 }
439 - virtual_binding: VDU_vdns_0
440 - virtual_link: VL_cpe_public
443 type: tosca.nodes.nfv.Vdu.Compute
445 name: { get_input: vdns_name_0 }
447 configurable_properties:
448 additional_vnfc_configurable_properties: {}
450 min_number_of_instances: 1
451 max_number_of_instances: 1
453 inject_files: # TODO SDC Bug
454 source_path: ../Artifacts/keys/authorized_keys #SSH authorized_keys
455 dest_path: /home/ubuntu/.ssh/authorized_keys
457 vnf_id: { get_input: vnf_id }
458 vf_module_id: { get_input: vf_module_id }
459 oam_ipaddr: { get_input: vdns_private_ip_1 }
460 cpe_public_net_ipaddr: { get_input: vdns_private_ip_0 }
461 oam_cidr: { get_input: onap_private_net_cidr }
462 cpe_public_net_cidr: { get_input: cpe_public_net_cidr }
463 demo_artifacts_version: { get_input: demo_artifacts_version }
464 install_script_version: { get_input: install_script_version }
465 cloud_env: { get_input: cloud_env }
466 nexus_artifact_repo: { get_input: nexus_artifact_repo }
469 METADATA=`curl -s http://169.254.169.254/openstack/2012-08-10/meta_data.json`
470 apt-get -y install jq
473 echo $METADATA | jq -r ".meta.$1"
476 # Create configuration files
478 echo "$(get_metadata oam_ipaddr)" > /opt/config/oam_ipaddr.txt
479 echo "$(get_metadata cpe_public_net_ipaddr)" > /opt/config/cpe_public_net_ipaddr.txt
480 echo "$(get_metadata onap_cidr)" > /opt/config/oam_cidr.txt
481 echo "$(get_metadata cpe_public_net_cidr)" > /opt/config/cpe_public_net_cidr.txt
482 echo "$(get_metadata demo_artifacts_version)" > /opt/config/demo_artifacts_version.txt
483 echo "$(get_metadata install_script_version)" > /opt/config/install_script_version.txt
484 echo "$(get_metadata cloud_env)" > /opt/config/cloud_env.txt
485 echo "$(get_metadata nexus_artifact_repo)" > /opt/config/nexus_artifact_repo.txt
487 # Download and run install script
488 apt-get -y install unzip
489 INSTALL_SCRIPT_VERSION=$(get_metadata install_script_version)
490 NEXUS_ARTIFACT_REPO=$(get_metadata nexus_artifact_repo)
491 if [[ "${INSTALL_SCRIPT_VERSION}" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
492 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
493 unzip -j /opt/vcpe-scripts-${INSTALL_SCRIPT_VERSION}.zip -d /opt v_dns_install.sh
495 chmod +x v_dns_install.sh
500 #TODO add local disk size
502 virtual_mem_size: 4096 MB
506 - virtual_storage: VirtualStorage_root_all
508 sw_image: #TODO need to put glance image name here
509 #file: { get_input: vcpe_image_name }
510 file: ../Artifacts/images/ubuntu_16.04
511 type: tosca.artifacts.nfv.SwImage
515 type: tosca.nodes.nfv.VduCp
517 layer_protocol: [ipv4]
520 - asscociated_layer_protocol: ipv4
522 address_type: ip_address
524 ip_address_assignment: false
525 floating_ip_activated: false
527 - virtual_binding: VDU_vdhcp_0
528 # - virtual_link: VL_public
530 Cp_vdhcp_onap_private:
531 type: tosca.nodes.nfv.VduCp
533 layer_protocol: [ipv4]
536 - asscociated_layer_protocol: ipv4
538 address_type: ip_address
540 ip_address_assignment: false
541 floating_ip_activated: false
543 - { get_input: vdhcp_private_ip_1 }
545 - virtual_binding: VDU_vdhcp_0
546 # - virtual_link: VL_onap_private
549 type: tosca.nodes.nfv.VduCp
551 layer_protocol: [ipv4]
554 - asscociated_layer_protocol: ipv4
556 address_type: ip_address
558 ip_address_assignment: false
559 floating_ip_activated: false
561 - { get_input: vdhcp_private_ip_0 }
563 - virtual_binding: VDU_vdhcp_0
564 - virtual_link: VL_cpe_signal
567 type: tosca.nodes.nfv.Vdu.Compute
569 name: { get_input: vdhcp_name_0 }
571 configurable_properties:
572 additional_vnfc_configurable_properties: {}
574 min_number_of_instances: 1
575 max_number_of_instances: 1
577 inject_files: #SDC Bug
578 source_path: ../Artifacts/keys/authorized_keys #SSH authorized_keys
579 dest_path: /home/ubuntu/.ssh/authorized_keys
581 vnf_id: { get_input: vnf_id }
582 vf_module_id: { get_input: vf_module_id }
583 oam_ipaddr: { get_input: vdhcp_private_ip_1 }
584 cpe_signal_ipaddr: { get_input: vdhcp_private_ip_0 }
585 oam_cidr: { get_input: onap_private_net_cidr }
586 cpe_signal_net_cidr: { get_input: cpe_signal_net_cidr }
587 mr_ip_addr: { get_input: mr_ip_addr }
588 mr_ip_port: { get_input: mr_ip_port }
589 demo_artifacts_version: { get_input: demo_artifacts_version }
590 install_script_version: { get_input: install_script_version }
591 cloud_env: { get_input: cloud_env }
592 nexus_artifact_repo: { get_input: nexus_artifact_repo }
595 METADATA=`curl -s http://169.254.169.254/openstack/2012-08-10/meta_data.json`
596 apt-get -y install jq
599 echo $METADATA | jq -r ".meta.$1"
602 # Create configuration files
604 echo "$(get_metadata oam_ipaddr)" > /opt/config/oam_ipaddr.txt
605 echo "$(get_metadata cpe_signal_ipaddr)" > /opt/config/cpe_signal_ipaddr.txt
606 echo "$(get_metadata onap_cidr)" > /opt/config/oam_cidr.txt
607 echo "$(get_metadata cpe_signal_net_cidr)" > /opt/config/cpe_signal_net_cidr.txt
608 echo "$(get_metadata mr_ip_addr)" > /opt/config/mr_ip_addr.txt
609 echo "$(get_metadata mr_ip_port)" > /opt/config/mr_ip_port.txt
610 echo "$(get_metadata demo_artifacts_version)" > /opt/config/demo_artifacts_version.txt
611 echo "$(get_metadata install_script_version)" > /opt/config/install_script_version.txt
612 echo "$(get_metadata cloud_env)" > /opt/config/cloud_env.txt
613 echo "$(get_metadata nexus_artifact_repo)" > /opt/config/nexus_artifact_repo.txt
615 # Download and run install script
616 apt-get -y install unzip
617 INSTALL_SCRIPT_VERSION=$(get_metadata install_script_version)
618 NEXUS_ARTIFACT_REPO=$(get_metadata nexus_artifact_repo)
619 if [[ "${INSTALL_SCRIPT_VERSION}" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
620 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
621 unzip -j /opt/vcpe-scripts-${INSTALL_SCRIPT_VERSION}.zip -d /opt v_dhcp_install.sh
623 chmod +x v_dhcp_install.sh
628 #TODO add local disk size
630 virtual_mem_size: 4096 MB
634 - virtual_storage: VirtualStorage_root_all
636 sw_image: #TODO need to put glance image name here
637 #file: { get_input: vcpe_image_name }
638 file: ../Artifacts/images/ubuntu_16.04
639 type: tosca.artifacts.nfv.SwImage
643 type: tosca.nodes.nfv.VduCp
645 layer_protocol: [ipv4]
648 - asscociated_layer_protocol: ipv4
650 address_type: ip_address
652 ip_address_assignment: false
653 floating_ip_activated: false
655 - virtual_binding: VDU_vweb_0
656 # - virtual_link: VL_public
658 Cp_vweb_onap_private:
659 type: tosca.nodes.nfv.VduCp
661 layer_protocol: [ipv4]
664 - asscociated_layer_protocol: ipv4
666 address_type: ip_address
668 ip_address_assignment: false
669 floating_ip_activated: false
671 - { get_input: vweb_private_ip_1 }
673 - virtual_binding: VDU_vweb_0
674 # - virtual_link: VL_onap_private
677 type: tosca.nodes.nfv.VduCp
679 layer_protocol: [ipv4]
682 - asscociated_layer_protocol: ipv4
684 address_type: ip_address
686 ip_address_assignment: false
687 floating_ip_activated: false
689 - { get_input: vweb_private_ip_0 }
691 - virtual_binding: VDU_vweb_0
692 - virtual_link: VL_cpe_public
695 type: tosca.nodes.nfv.Vdu.Compute
697 name: { get_input: vweb_name_0 }
699 configurable_properties:
700 additional_vnfc_configurable_properties: {}
702 min_number_of_instances: 1
703 max_number_of_instances: 1
705 inject_files: # TODO SDC bug
706 source_path: ../Artifacts/keys/authorized_keys #SSH authorized_keys
707 dest_path: /home/ubuntu/.ssh/authorized_keys
709 vnf_id: { get_input: vnf_id }
710 vf_module_id: { get_input: vf_module_id }
711 oam_ipaddr: { get_input: vweb_private_ip_1 }
712 cpe_public_ipaddr: { get_input: vweb_private_ip_0 }
713 oam_cidr: { get_input: onap_private_net_cidr }
714 cpe_public_net_cidr: { get_input: cpe_public_net_cidr }
715 demo_artifacts_version: { get_input: demo_artifacts_version }
716 install_script_version: { get_input: install_script_version }
717 cloud_env: { get_input: cloud_env }
718 nexus_artifact_repo: { get_input: nexus_artifact_repo }
721 METADATA=`curl -s http://169.254.169.254/openstack/2012-08-10/meta_data.json`
722 apt-get -y install jq
725 echo $METADATA | jq -r ".meta.$1"
728 # Create configuration files
730 echo "$(get_metadata oam_ipaddr)" > /opt/config/oam_ipaddr.txt
731 echo "$(get_metadata cpe_public_ipaddr)" > /opt/config/cpe_public_ipaddr.txt
732 echo "$(get_metadata onap_cidr)" > /opt/config/oam_cidr.txt
733 echo "$(get_metadata cpe_public_net_cidr)" > /opt/config/cpe_public_net_cidr.txt
734 echo "$(get_metadata demo_artifacts_version)" > /opt/config/demo_artifacts_version.txt
735 echo "$(get_metadata install_script_version)" > /opt/config/install_script_version.txt
736 echo "$(get_metadata cloud_env)" > /opt/config/cloud_env.txt
737 echo "$(get_metadata nexus_artifact_repo)" > /opt/config/nexus_artifact_repo.txt
739 # Download and run install script
740 apt-get -y install unzip
741 INSTALL_SCRIPT_VERSION=$(get_metadata install_script_version)
742 NEXUS_ARTIFACT_REPO=$(get_metadata nexus_artifact_repo)
743 if [[ "${INSTALL_SCRIPT_VERSION}" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
744 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
745 unzip -j /opt/vcpe-scripts-${INSTALL_SCRIPT_VERSION}.zip -d /opt v_web_install.sh
747 chmod +x v_web_install.sh
752 #TODO add local disk size
754 virtual_mem_size: 4096 MB
758 - virtual_storage: VirtualStorage_root_all
760 sw_image: #TODO need to put glance image name here
761 #file: { get_input: vcpe_image_name }
762 file: ../Artifacts/images/ubuntu_16.04
763 type: tosca.artifacts.nfv.SwImage