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 description: IP port of the Message Router that for vDHCP configuration
88 description: dcae collector ip
92 description: dcae collector port
96 description: Root URL for the Nexus repository for Maven artifacts
97 default: https://nexus.onap.org
98 demo_artifacts_version:
100 description: artifacts version used in demo vnfs
102 install_script_version:
104 description: install script version number
105 default: 1.2.0-SNAPSHOT
108 description: cloud environment(openstack or rackspace)
112 description: ssh public key
113 default: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGx6SKrAuCz1V8KGevZueksLdWoPWJP6z3r29Z7TmPVEOjM+7PIPeSs2BVRx3rnHZBAlasMrZ+fJBS25ts9vfC+ItezQah/hr9vrkmwxCR54Lb84poW+sToPeF6i5eZY7W+jWJfLaFSFx9d2vp4zes/fOlT3NvYCXbn/3QdryQoGl7VFI8oemZypVcikZXElJeeKgAVdSwnrzuqtO/tmbXcAeSbYvVjki8ywYcsWMVMYWUWhh+1BAB6kXnTsIWqzrq0Pfvy+81WDwtiqsqmd93HY8hE0scBrXFBZzQS/AYfIFBlEuFNdLczchntjbZ0n7dmDXk8zHtCZYNk7kwb8k/
116 description: cpe signal net name
117 default: zdfw1cpe01_private
120 description: cpe signal net cidr
124 description: cpe public net name
125 default: zdfw1cpe01_public
128 description: cpe public net cidr
132 description: vdu vdhcp_0 name
133 default: zdcpe1cpe01dhcp01
136 description: ip of vdhcp port to cpe signal net
140 description: ip of vdhcp port to onap oam net
144 description: vdu vaaa_0 name
145 default: zdcpe1cpe01aaa01
148 description: ip of vaaa port to cpe signal net
152 description: ip of vaaa port to onap oam net
156 description: vdu vdns_0 name
157 default: zdcpe1cpe01dns01
160 description: ip of vdns port to cpe public net
164 description: ip of vdns port to onap oam net
168 description: vdu vweb_0 name
169 default: zdcpe1cpe01web01
172 description: ip of vweb port to cpe public net
176 description: ip of vweb port to onap oam net
180 description: The VNF ID is provided by ONAP
181 default: vCPE_Infrastructure_demo_app
184 description: The vCPE Module ID is provided by ONAP
185 default: vCPE_Intrastructure
190 # type: tosca.nodes.nfv.VnfVirtualLink
193 # layer_protocol: ipv4
195 # max_bit_rate_requirements:
198 # min_bit_rate_requirements:
201 # networkName: { get_input: public_net_id }
205 # type: tosca.nodes.nfv.VnfVirtualLink
208 # layer_protocol: ipv4
210 # max_bit_rate_requirements:
213 # min_bit_rate_requirements:
216 # networkName: { get_input: onap_private_net_id }
217 # cidr: { get_input: onap_private_net_cidr }
221 type: tosca.nodes.nfv.VnfVirtualLink
226 max_bit_rate_requirements:
229 min_bit_rate_requirements:
232 networkName: { get_input: cpe_signal_net_id}
233 cidr: { get_input: cpe_signal_net_cidr }
238 type: tosca.nodes.nfv.VnfVirtualLink
243 max_bit_rate_requirements:
246 min_bit_rate_requirements:
249 networkName: { get_input: cpe_public_net_id}
250 cidr: { get_input: cpe_public_net_cidr }
255 type: tosca.nodes.nfv.VduCp
257 layer_protocol: [ipv4]
260 - asscociated_layer_protocol: ipv4
262 address_type: ip_address
264 ip_address_assignment: false
265 floating_ip_activated: false
267 - virtual_binding: VDU_vaaa_0
268 # - virtual_link: VL_public
270 Cp_vaaa_onap_private:
271 type: tosca.nodes.nfv.VduCp
273 layer_protocol: [ipv4]
276 - asscociated_layer_protocol: ipv4
278 address_type: ip_address
280 ip_address_assignment: false
281 floating_ip_activated: false
283 - { get_input: vaaa_private_ip_1 }
285 - virtual_binding: VDU_vaaa_0
286 # - virtual_link: VL_onap_private
289 type: tosca.nodes.nfv.VduCp
291 layer_protocol: [ipv4]
294 - asscociated_layer_protocol: ipv4
296 address_type: ip_address
298 ip_address_assignment: false
299 floating_ip_activated: false
301 - { get_input: vaaa_private_ip_0 }
303 - virtual_binding: VDU_vaaa_0
304 - virtual_link: VL_cpe_signal
306 VirtualStorage_root_all:
307 # this indicate the VDU root storage size
308 type: tosca.nodes.nfv.Vdu.VirtualStorage
310 type_of_storage: root
311 size_of_storage: 40 GB
314 type: tosca.nodes.nfv.Vdu.Compute
316 name: { get_input: vaaa_name_0 }
318 configurable_properties:
319 additional_vnfc_configurable_properties: {}
321 min_number_of_instances: 1
322 max_number_of_instances: 1
324 inject_files: #TODO SDC Bug
325 source_path: ../Artifacts/keys/authorized_keys #SSH authorized_keys
326 dest_path: /home/ubuntu/.ssh/authorized_keys
328 vnf_id: { get_input: vnf_id }
329 vf_module_id: { get_input: vf_module_id }
330 dcae_collector_ip: { get_input: dcae_collector_ip }
331 dcae_collector_port: { get_input: dcae_collector_port }
332 cpe_signal_net_ipaddr: { get_input: vaaa_private_ip_0 }
333 oam_ipaddr: { get_input: vaaa_private_ip_1 }
334 oam_cidr: { get_input: onap_private_net_cidr }
335 cpe_signal_net_cidr: { get_input: cpe_signal_net_cidr }
336 demo_artifacts_version: { get_input: demo_artifacts_version }
337 install_script_version: { get_input: install_script_version }
338 cloud_env: { get_input: cloud_env }
339 nexus_artifact_repo: { get_input: nexus_artifact_repo }
342 METADATA=`curl -s http://169.254.169.254/openstack/2012-08-10/meta_data.json`
343 apt-get -y install jq
346 echo $METADATA | jq -r ".meta.$1"
349 # Create configuration files
351 echo "$(get_metadata dcae_collector_ip)" > /opt/config/dcae_collector_ip.txt
352 echo "$(get_metadata dcae_collector_port)" > /opt/config/dcae_collector_port.txt
353 echo "$(get_metadata cpe_signal_net_ipaddr)" > /opt/config/cpe_signal_net_ipaddr.txt
354 echo "$(get_metadata oam_ipaddr)" > /opt/config/oam_ipaddr.txt
355 echo "$(get_metadata oam_cidr)" > /opt/config/oam_cidr.txt
356 echo "$(get_metadata cpe_signal_net_cidr)" > /opt/config/cpe_signal_net_cidr.txt
357 echo "$(get_metadata demo_artifacts_version)" > /opt/config/demo_artifacts_version.txt
358 echo "$(get_metadata install_script_version)" > /opt/config/install_script_version.txt
359 echo "$(get_metadata cloud_env)" > /opt/config/cloud_env.txt
360 echo "$(get_metadata nexus_artifact_repo)" > /opt/config/nexus_artifact_repo.txt
362 # Download and run install script
363 apt-get -y install unzip
364 INSTALL_SCRIPT_VERSION=$(get_metadata install_script_version)
365 NEXUS_ARTIFACT_REPO=$(get_metadata nexus_artifact_repo)
366 if [[ "${INSTALL_SCRIPT_VERSION}" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
367 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
368 unzip -j /opt/vcpe-scripts-${INSTALL_SCRIPT_VERSION}.zip -d /opt v_aaa_install.sh
370 chmod +x v_aaa_install.sh
375 #TODO add local disk size
377 virtual_mem_size: 4096 MB
381 - virtual_storage: VirtualStorage_root_all
383 sw_image: #TODO need to put glance image name here
384 #file: { get_input: vcpe_image_name }
385 file: ../Artifacts/images/ubuntu_16.04
386 type: tosca.artifacts.nfv.SwImage
390 type: tosca.nodes.nfv.VduCp
392 layer_protocol: [ipv4]
395 - asscociated_layer_protocol: ipv4
397 address_type: ip_address
399 ip_address_assignment: false
400 floating_ip_activated: false
402 - virtual_binding: VDU_vdns_0
403 # - virtual_link: VL_public
405 Cp_vdns_onap_private:
406 type: tosca.nodes.nfv.VduCp
408 layer_protocol: [ipv4]
411 - asscociated_layer_protocol: ipv4
413 address_type: ip_address
415 ip_address_assignment: false
416 floating_ip_activated: false
418 - { get_input: vdns_private_ip_1 }
420 - virtual_binding: VDU_vdns_0
421 #- virtual_link: VL_onap_private
424 type: tosca.nodes.nfv.VduCp
426 layer_protocol: [ipv4]
429 - asscociated_layer_protocol: ipv4
431 address_type: ip_address
433 ip_address_assignment: false
434 floating_ip_activated: false
436 - { get_input: vdns_private_ip_0 }
438 - virtual_binding: VDU_vdns_0
439 - virtual_link: VL_cpe_public
442 type: tosca.nodes.nfv.Vdu.Compute
444 name: { get_input: vdns_name_0 }
446 configurable_properties:
447 additional_vnfc_configurable_properties: {}
449 min_number_of_instances: 1
450 max_number_of_instances: 1
452 inject_files: # TODO SDC Bug
453 source_path: ../Artifacts/keys/authorized_keys #SSH authorized_keys
454 dest_path: /home/ubuntu/.ssh/authorized_keys
456 vnf_id: { get_input: vnf_id }
457 vf_module_id: { get_input: vf_module_id }
458 oam_ipaddr: { get_input: vdns_private_ip_1 }
459 cpe_public_net_ipaddr: { get_input: vdns_private_ip_0 }
460 oam_cidr: { get_input: onap_private_net_cidr }
461 cpe_public_net_cidr: { get_input: cpe_public_net_cidr }
462 demo_artifacts_version: { get_input: demo_artifacts_version }
463 install_script_version: { get_input: install_script_version }
464 cloud_env: { get_input: cloud_env }
465 nexus_artifact_repo: { get_input: nexus_artifact_repo }
468 METADATA=`curl -s http://169.254.169.254/openstack/2012-08-10/meta_data.json`
469 apt-get -y install jq
472 echo $METADATA | jq -r ".meta.$1"
475 # Create configuration files
477 echo "$(get_metadata oam_ipaddr)" > /opt/config/oam_ipaddr.txt
478 echo "$(get_metadata cpe_public_net_ipaddr)" > /opt/config/cpe_public_net_ipaddr.txt
479 echo "$(get_metadata onap_cidr)" > /opt/config/oam_cidr.txt
480 echo "$(get_metadata cpe_public_net_cidr)" > /opt/config/cpe_public_net_cidr.txt
481 echo "$(get_metadata demo_artifacts_version)" > /opt/config/demo_artifacts_version.txt
482 echo "$(get_metadata install_script_version)" > /opt/config/install_script_version.txt
483 echo "$(get_metadata cloud_env)" > /opt/config/cloud_env.txt
484 echo "$(get_metadata nexus_artifact_repo)" > /opt/config/nexus_artifact_repo.txt
486 # Download and run install script
487 apt-get -y install unzip
488 INSTALL_SCRIPT_VERSION=$(get_metadata install_script_version)
489 NEXUS_ARTIFACT_REPO=$(get_metadata nexus_artifact_repo)
490 if [[ "${INSTALL_SCRIPT_VERSION}" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
491 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
492 unzip -j /opt/vcpe-scripts-${INSTALL_SCRIPT_VERSION}.zip -d /opt v_dns_install.sh
494 chmod +x v_dns_install.sh
499 #TODO add local disk size
501 virtual_mem_size: 4096 MB
505 - virtual_storage: VirtualStorage_root_all
507 sw_image: #TODO need to put glance image name here
508 #file: { get_input: vcpe_image_name }
509 file: ../Artifacts/images/ubuntu_16.04
510 type: tosca.artifacts.nfv.SwImage
514 type: tosca.nodes.nfv.VduCp
516 layer_protocol: [ipv4]
519 - asscociated_layer_protocol: ipv4
521 address_type: ip_address
523 ip_address_assignment: false
524 floating_ip_activated: false
526 - virtual_binding: VDU_vdhcp_0
527 # - virtual_link: VL_public
529 Cp_vdhcp_onap_private:
530 type: tosca.nodes.nfv.VduCp
532 layer_protocol: [ipv4]
535 - asscociated_layer_protocol: ipv4
537 address_type: ip_address
539 ip_address_assignment: false
540 floating_ip_activated: false
542 - { get_input: vdhcp_private_ip_1 }
544 - virtual_binding: VDU_vdhcp_0
545 # - virtual_link: VL_onap_private
548 type: tosca.nodes.nfv.VduCp
550 layer_protocol: [ipv4]
553 - asscociated_layer_protocol: ipv4
555 address_type: ip_address
557 ip_address_assignment: false
558 floating_ip_activated: false
560 - { get_input: vdhcp_private_ip_0 }
562 - virtual_binding: VDU_vdhcp_0
563 - virtual_link: VL_cpe_signal
566 type: tosca.nodes.nfv.Vdu.Compute
568 name: { get_input: vdhcp_name_0 }
570 configurable_properties:
571 additional_vnfc_configurable_properties: {}
573 min_number_of_instances: 1
574 max_number_of_instances: 1
576 inject_files: #SDC Bug
577 source_path: ../Artifacts/keys/authorized_keys #SSH authorized_keys
578 dest_path: /home/ubuntu/.ssh/authorized_keys
580 vnf_id: { get_input: vnf_id }
581 vf_module_id: { get_input: vf_module_id }
582 oam_ipaddr: { get_input: vdhcp_private_ip_1 }
583 cpe_signal_ipaddr: { get_input: vdhcp_private_ip_0 }
584 oam_cidr: { get_input: onap_private_net_cidr }
585 cpe_signal_net_cidr: { get_input: cpe_signal_net_cidr }
586 mr_ip_addr: { get_input: mr_ip_addr }
587 mr_ip_port: { get_input: mr_ip_port }
588 demo_artifacts_version: { get_input: demo_artifacts_version }
589 install_script_version: { get_input: install_script_version }
590 cloud_env: { get_input: cloud_env }
591 nexus_artifact_repo: { get_input: nexus_artifact_repo }
594 METADATA=`curl -s http://169.254.169.254/openstack/2012-08-10/meta_data.json`
595 apt-get -y install jq
598 echo $METADATA | jq -r ".meta.$1"
601 # Create configuration files
603 echo "$(get_metadata oam_ipaddr)" > /opt/config/oam_ipaddr.txt
604 echo "$(get_metadata cpe_signal_ipaddr)" > /opt/config/cpe_signal_ipaddr.txt
605 echo "$(get_metadata onap_cidr)" > /opt/config/oam_cidr.txt
606 echo "$(get_metadata cpe_signal_net_cidr)" > /opt/config/cpe_signal_net_cidr.txt
607 echo "$(get_metadata mr_ip_addr)" > /opt/config/mr_ip_addr.txt
608 echo "$(get_metadata mr_ip_port)" > /opt/config/mr_ip_port.txt
609 echo "$(get_metadata demo_artifacts_version)" > /opt/config/demo_artifacts_version.txt
610 echo "$(get_metadata install_script_version)" > /opt/config/install_script_version.txt
611 echo "$(get_metadata cloud_env)" > /opt/config/cloud_env.txt
612 echo "$(get_metadata nexus_artifact_repo)" > /opt/config/nexus_artifact_repo.txt
614 # Download and run install script
615 apt-get -y install unzip
616 INSTALL_SCRIPT_VERSION=$(get_metadata install_script_version)
617 NEXUS_ARTIFACT_REPO=$(get_metadata nexus_artifact_repo)
618 if [[ "${INSTALL_SCRIPT_VERSION}" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
619 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
620 unzip -j /opt/vcpe-scripts-${INSTALL_SCRIPT_VERSION}.zip -d /opt v_dhcp_install.sh
622 chmod +x v_dhcp_install.sh
627 #TODO add local disk size
629 virtual_mem_size: 4096 MB
633 - virtual_storage: VirtualStorage_root_all
635 sw_image: #TODO need to put glance image name here
636 #file: { get_input: vcpe_image_name }
637 file: ../Artifacts/images/ubuntu_16.04
638 type: tosca.artifacts.nfv.SwImage
642 type: tosca.nodes.nfv.VduCp
644 layer_protocol: [ipv4]
647 - asscociated_layer_protocol: ipv4
649 address_type: ip_address
651 ip_address_assignment: false
652 floating_ip_activated: false
654 - virtual_binding: VDU_vweb_0
655 # - virtual_link: VL_public
657 Cp_vweb_onap_private:
658 type: tosca.nodes.nfv.VduCp
660 layer_protocol: [ipv4]
663 - asscociated_layer_protocol: ipv4
665 address_type: ip_address
667 ip_address_assignment: false
668 floating_ip_activated: false
670 - { get_input: vweb_private_ip_1 }
672 - virtual_binding: VDU_vweb_0
673 # - virtual_link: VL_onap_private
676 type: tosca.nodes.nfv.VduCp
678 layer_protocol: [ipv4]
681 - asscociated_layer_protocol: ipv4
683 address_type: ip_address
685 ip_address_assignment: false
686 floating_ip_activated: false
688 - { get_input: vweb_private_ip_0 }
690 - virtual_binding: VDU_vweb_0
691 - virtual_link: VL_cpe_public
694 type: tosca.nodes.nfv.Vdu.Compute
696 name: { get_input: vweb_name_0 }
698 configurable_properties:
699 additional_vnfc_configurable_properties: {}
701 min_number_of_instances: 1
702 max_number_of_instances: 1
704 inject_files: # TODO SDC bug
705 source_path: ../Artifacts/keys/authorized_keys #SSH authorized_keys
706 dest_path: /home/ubuntu/.ssh/authorized_keys
708 vnf_id: { get_input: vnf_id }
709 vf_module_id: { get_input: vf_module_id }
710 oam_ipaddr: { get_input: vweb_private_ip_1 }
711 cpe_public_ipaddr: { get_input: vweb_private_ip_0 }
712 oam_cidr: { get_input: onap_private_net_cidr }
713 cpe_public_net_cidr: { get_input: cpe_public_net_cidr }
714 demo_artifacts_version: { get_input: demo_artifacts_version }
715 install_script_version: { get_input: install_script_version }
716 cloud_env: { get_input: cloud_env }
717 nexus_artifact_repo: { get_input: nexus_artifact_repo }
720 METADATA=`curl -s http://169.254.169.254/openstack/2012-08-10/meta_data.json`
721 apt-get -y install jq
724 echo $METADATA | jq -r ".meta.$1"
727 # Create configuration files
729 echo "$(get_metadata oam_ipaddr)" > /opt/config/oam_ipaddr.txt
730 echo "$(get_metadata cpe_public_ipaddr)" > /opt/config/cpe_public_ipaddr.txt
731 echo "$(get_metadata onap_cidr)" > /opt/config/oam_cidr.txt
732 echo "$(get_metadata cpe_public_net_cidr)" > /opt/config/cpe_public_net_cidr.txt
733 echo "$(get_metadata demo_artifacts_version)" > /opt/config/demo_artifacts_version.txt
734 echo "$(get_metadata install_script_version)" > /opt/config/install_script_version.txt
735 echo "$(get_metadata cloud_env)" > /opt/config/cloud_env.txt
736 echo "$(get_metadata nexus_artifact_repo)" > /opt/config/nexus_artifact_repo.txt
738 # Download and run install script
739 apt-get -y install unzip
740 INSTALL_SCRIPT_VERSION=$(get_metadata install_script_version)
741 NEXUS_ARTIFACT_REPO=$(get_metadata nexus_artifact_repo)
742 if [[ "${INSTALL_SCRIPT_VERSION}" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
743 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
744 unzip -j /opt/vcpe-scripts-${INSTALL_SCRIPT_VERSION}.zip -d /opt v_web_install.sh
746 chmod +x v_web_install.sh
751 #TODO add local disk size
753 virtual_mem_size: 4096 MB
757 - virtual_storage: VirtualStorage_root_all
759 sw_image: #TODO need to put glance image name here
760 #file: { get_input: vcpe_image_name }
761 file: ../Artifacts/images/ubuntu_16.04
762 type: tosca.artifacts.nfv.SwImage