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: dcae collector ip
88 description: dcae collector port
92 description: Root URL for the Nexus repository for Maven artifacts
93 default: https://nexus.onap.org
94 demo_artifacts_version:
96 description: artifacts version used in demo vnfs
98 install_script_version:
100 description: install script version number
101 default: 1.2.0-SNAPSHOT
104 description: cloud environment(openstack or rackspace)
108 description: ssh public key
109 default: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGx6SKrAuCz1V8KGevZueksLdWoPWJP6z3r29Z7TmPVEOjM+7PIPeSs2BVRx3rnHZBAlasMrZ+fJBS25ts9vfC+ItezQah/hr9vrkmwxCR54Lb84poW+sToPeF6i5eZY7W+jWJfLaFSFx9d2vp4zes/fOlT3NvYCXbn/3QdryQoGl7VFI8oemZypVcikZXElJeeKgAVdSwnrzuqtO/tmbXcAeSbYvVjki8ywYcsWMVMYWUWhh+1BAB6kXnTsIWqzrq0Pfvy+81WDwtiqsqmd93HY8hE0scBrXFBZzQS/AYfIFBlEuFNdLczchntjbZ0n7dmDXk8zHtCZYNk7kwb8k/
112 description: cpe signal net name
113 default: zdfw1cpe01_private
116 description: cpe signal net cidr
120 description: cpe public net name
121 default: zdfw1cpe01_public
124 description: cpe public net cidr
128 description: vdu vdhcp_0 name
129 default: zdcpe1cpe01dhcp01
132 description: ip of vdhcp port to cpe signal net
136 description: ip of vdhcp port to onap oam net
140 description: vdu vaaa_0 name
141 default: zdcpe1cpe01aaa01
144 description: ip of vaaa port to cpe signal net
148 description: ip of vaaa port to onap oam net
152 description: vdu vdns_0 name
153 default: zdcpe1cpe01dns01
156 description: ip of vdns port to cpe public net
160 description: ip of vdns port to onap oam net
164 description: vdu vweb_0 name
165 default: zdcpe1cpe01web01
168 description: ip of vweb port to cpe public net
172 description: ip of vweb port to onap oam net
176 description: The VNF ID is provided by ONAP
177 default: vCPE_Infrastructure_demo_app
180 description: The vCPE Module ID is provided by ONAP
181 default: vCPE_Intrastructure
186 # type: tosca.nodes.nfv.VnfVirtualLink
189 # layer_protocol: ipv4
191 # max_bit_rate_requirements:
194 # min_bit_rate_requirements:
197 # networkName: { get_input: public_net_id }
201 # type: tosca.nodes.nfv.VnfVirtualLink
204 # layer_protocol: ipv4
206 # max_bit_rate_requirements:
209 # min_bit_rate_requirements:
212 # networkName: { get_input: onap_private_net_id }
213 # cidr: { get_input: onap_private_net_cidr }
217 type: tosca.nodes.nfv.VnfVirtualLink
222 max_bit_rate_requirements:
225 min_bit_rate_requirements:
228 networkName: { get_input: cpe_signal_net_id}
229 cidr: { get_input: cpe_signal_net_cidr }
234 type: tosca.nodes.nfv.VnfVirtualLink
239 max_bit_rate_requirements:
242 min_bit_rate_requirements:
245 networkName: { get_input: cpe_public_net_id}
246 cidr: { get_input: cpe_public_net_cidr }
251 type: tosca.nodes.nfv.VduCp
253 layer_protocol: [ipv4]
256 - asscociated_layer_protocol: ipv4
258 address_type: ip_address
260 ip_address_assignment: false
261 floating_ip_activated: false
263 - virtual_binding: VDU_vaaa_0
264 # - virtual_link: VL_public
266 Cp_vaaa_onap_private:
267 type: tosca.nodes.nfv.VduCp
269 layer_protocol: [ipv4]
272 - asscociated_layer_protocol: ipv4
274 address_type: ip_address
276 ip_address_assignment: false
277 floating_ip_activated: false
279 - { get_input: vaaa_private_ip_1 }
281 - virtual_binding: VDU_vaaa_0
282 # - virtual_link: VL_onap_private
285 type: tosca.nodes.nfv.VduCp
287 layer_protocol: [ipv4]
290 - asscociated_layer_protocol: ipv4
292 address_type: ip_address
294 ip_address_assignment: false
295 floating_ip_activated: false
297 - { get_input: vaaa_private_ip_0 }
299 - virtual_binding: VDU_vaaa_0
300 - virtual_link: VL_cpe_signal
302 VirtualStorage_root_all:
303 # this indicate the VDU root storage size
304 type: tosca.nodes.nfv.Vdu.VirtualStorage
306 type_of_storage: root
307 size_of_storage: 40 GB
310 type: tosca.nodes.nfv.Vdu.Compute
312 name: { get_input: vaaa_name_0 }
314 configurable_properties:
315 additional_vnfc_configurable_properties: {}
317 min_number_of_instances: 1
318 max_number_of_instances: 1
320 inject_files: #TODO SDC Bug
321 source_path: ../Artifacts/keys/authorized_keys #SSH authorized_keys
322 dest_path: /home/ubuntu/.ssh/authorized_keys
324 vnf_id: { get_input: vnf_id }
325 vf_module_id: { get_input: vf_module_id }
326 dcae_collector_ip: { get_input: dcae_collector_ip }
327 dcae_collector_port: { get_input: dcae_collector_port }
328 cpe_signal_net_ipaddr: { get_input: vaaa_private_ip_0 }
329 oam_ipaddr: { get_input: vaaa_private_ip_1 }
330 oam_cidr: { get_input: oam_private_net_cidr }
331 cpe_signal_net_cidr: { get_input: cpe_signal_net_cidr }
332 demo_artifacts_version: { get_input: demo_artifacts_version }
333 install_script_version: { get_input: install_script_version }
334 cloud_env: { get_input: cloud_env }
335 nexus_artifact_repo: { get_input: nexus_artifact_repo }
338 METADATA=`curl -s http://169.254.169.254/openstack/2012-08-10/meta_data.json`
339 apt-get -y install jq
342 echo $METADATA | jq -r ".meta.$1"
345 # Create configuration files
347 echo "$(get_metadata dcae_collector_ip)" > /opt/config/dcae_collector_ip.txt
348 echo "$(get_metadata dcae_collector_port)" > /opt/config/dcae_collector_port.txt
349 echo "$(get_metadata cpe_signal_net_ipaddr)" > /opt/config/cpe_signal_net_ipaddr.txt
350 echo "$(get_metadata oam_ipaddr)" > /opt/config/oam_ipaddr.txt
351 echo "$(get_metadata oam_cidr)" > /opt/config/oam_cidr.txt
352 echo "$(get_metadata cpe_signal_net_cidr)" > /opt/config/cpe_signal_net_cidr.txt
353 echo "$(get_metadata demo_artifacts_version)" > /opt/config/demo_artifacts_version.txt
354 echo "$(get_metadata install_script_version)" > /opt/config/install_script_version.txt
355 echo "$(get_metadata cloud_env)" > /opt/config/cloud_env.txt
356 echo "$(get_metadata nexus_artifact_repo)" > /opt/config/nexus_artifact_repo.txt
358 # Download and run install script
359 apt-get -y install unzip
360 INSTALL_SCRIPT_VERSION=$(get_metadata install_script_version)
361 NEXUS_ARTIFACT_REPO=$(get_metadata nexus_artifact_repo)
362 if [[ "${INSTALL_SCRIPT_VERSION}" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
363 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
364 unzip -j /opt/vcpe-scripts-${INSTALL_SCRIPT_VERSION}.zip -d /opt v_aaa_install.sh
366 chmod +x v_aaa_install.sh
371 #TODO add local disk size
373 virtual_mem_size: 4096 MB
377 - virtual_storage: VirtualStorage_root_all
379 sw_image: #TODO need to put glance image name here
380 #file: { get_input: vcpe_image_name }
381 file: ../Artifacts/images/ubuntu_16.04
382 type: tosca.artifacts.nfv.SwImage
386 type: tosca.nodes.nfv.VduCp
388 layer_protocol: [ipv4]
391 - asscociated_layer_protocol: ipv4
393 address_type: ip_address
395 ip_address_assignment: false
396 floating_ip_activated: false
398 - virtual_binding: VDU_vdns_0
399 # - virtual_link: VL_public
401 Cp_vdns_onap_private:
402 type: tosca.nodes.nfv.VduCp
404 layer_protocol: [ipv4]
407 - asscociated_layer_protocol: ipv4
409 address_type: ip_address
411 ip_address_assignment: false
412 floating_ip_activated: false
414 - { get_input: vdns_private_ip_1 }
416 - virtual_binding: VDU_vdns_0
417 #- virtual_link: VL_onap_private
420 type: tosca.nodes.nfv.VduCp
422 layer_protocol: [ipv4]
425 - asscociated_layer_protocol: ipv4
427 address_type: ip_address
429 ip_address_assignment: false
430 floating_ip_activated: false
432 - { get_input: vdns_private_ip_0 }
434 - virtual_binding: VDU_vdns_0
435 - virtual_link: VL_cpe_public
438 type: tosca.nodes.nfv.Vdu.Compute
440 name: { get_input: vdns_name_0 }
442 configurable_properties:
443 additional_vnfc_configurable_properties: {}
445 min_number_of_instances: 1
446 max_number_of_instances: 1
448 inject_files: # TODO SDC Bug
449 source_path: ../Artifacts/keys/authorized_keys #SSH authorized_keys
450 dest_path: /home/ubuntu/.ssh/authorized_keys
452 vnf_id: { get_input: vnf_id }
453 vf_module_id: { get_input: vf_module_id }
454 oam_ipaddr: { get_input: vdns_private_ip_1 }
455 cpe_public_net_ipaddr: { get_input: vdns_private_ip_0 }
456 oam_cidr: { get_input: oam_private_net_cidr }
457 cpe_public_net_cidr: { get_input: cpe_public_net_cidr }
458 demo_artifacts_version: { get_input: demo_artifacts_version }
459 install_script_version: { get_input: install_script_version }
460 cloud_env: { get_input: cloud_env }
461 nexus_artifact_repo: { get_input: nexus_artifact_repo }
464 METADATA=`curl -s http://169.254.169.254/openstack/2012-08-10/meta_data.json`
465 apt-get -y install jq
468 echo $METADATA | jq -r ".meta.$1"
471 # Create configuration files
473 echo "$(get_metadata oam_ipaddr)" > /opt/config/oam_ipaddr.txt
474 echo "$(get_metadata cpe_public_net_ipaddr)" > /opt/config/cpe_public_net_ipaddr.txt
475 echo "$(get_metadata onap_cidr)" > /opt/config/oam_cidr.txt
476 echo "$(get_metadata cpe_public_net_cidr)" > /opt/config/cpe_public_net_cidr.txt
477 echo "$(get_metadata demo_artifacts_version)" > /opt/config/demo_artifacts_version.txt
478 echo "$(get_metadata install_script_version)" > /opt/config/install_script_version.txt
479 echo "$(get_metadata cloud_env)" > /opt/config/cloud_env.txt
480 echo "$(get_metadata nexus_artifact_repo)" > /opt/config/nexus_artifact_repo.txt
482 # Download and run install script
483 apt-get -y install unzip
484 INSTALL_SCRIPT_VERSION=$(get_metadata install_script_version)
485 NEXUS_ARTIFACT_REPO=$(get_metadata nexus_artifact_repo)
486 if [[ "${INSTALL_SCRIPT_VERSION}" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
487 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
488 unzip -j /opt/vcpe-scripts-${INSTALL_SCRIPT_VERSION}.zip -d /opt v_dns_install.sh
490 chmod +x v_dns_install.sh
495 #TODO add local disk size
497 virtual_mem_size: 4096 MB
501 - virtual_storage: VirtualStorage_root_all
503 sw_image: #TODO need to put glance image name here
504 #file: { get_input: vcpe_image_name }
505 file: ../Artifacts/images/ubuntu_16.04
506 type: tosca.artifacts.nfv.SwImage
510 type: tosca.nodes.nfv.VduCp
512 layer_protocol: [ipv4]
515 - asscociated_layer_protocol: ipv4
517 address_type: ip_address
519 ip_address_assignment: false
520 floating_ip_activated: false
522 - virtual_binding: VDU_vdhcp_0
523 # - virtual_link: VL_public
525 Cp_vdhcp_onap_private:
526 type: tosca.nodes.nfv.VduCp
528 layer_protocol: [ipv4]
531 - asscociated_layer_protocol: ipv4
533 address_type: ip_address
535 ip_address_assignment: false
536 floating_ip_activated: false
538 - { get_input: vdhcp_private_ip_1 }
540 - virtual_binding: VDU_vdhcp_0
541 # - virtual_link: VL_onap_private
544 type: tosca.nodes.nfv.VduCp
546 layer_protocol: [ipv4]
549 - asscociated_layer_protocol: ipv4
551 address_type: ip_address
553 ip_address_assignment: false
554 floating_ip_activated: false
556 - { get_input: vdhcp_private_ip_0 }
558 - virtual_binding: VDU_vdhcp_0
559 - virtual_link: VL_cpe_signal
562 type: tosca.nodes.nfv.Vdu.Compute
564 name: { get_input: vdhcp_name_0 }
566 configurable_properties:
567 additional_vnfc_configurable_properties: {}
569 min_number_of_instances: 1
570 max_number_of_instances: 1
572 inject_files: #SDC Bug
573 source_path: ../Artifacts/keys/authorized_keys #SSH authorized_keys
574 dest_path: /home/ubuntu/.ssh/authorized_keys
576 vnf_id: { get_input: vnf_id }
577 vf_module_id: { get_input: vf_module_id }
578 oam_ipaddr: { get_input: vdhcp_private_ip_1 }
579 cpe_signal_ipaddr: { get_input: vdhcp_private_ip_0 }
580 oam_cidr: { get_input: oam_private_net_cidr }
581 cpe_signal_net_cidr: { get_input: cpe_signal_net_cidr }
582 mr_ip_addr: { get_input: mr_ip_addr }
583 mr_ip_port: { get_input: mr_ip_port }
584 demo_artifacts_version: { get_input: demo_artifacts_version }
585 install_script_version: { get_input: install_script_version }
586 cloud_env: { get_input: cloud_env }
587 nexus_artifact_repo: { get_input: nexus_artifact_repo }
590 METADATA=`curl -s http://169.254.169.254/openstack/2012-08-10/meta_data.json`
591 apt-get -y install jq
594 echo $METADATA | jq -r ".meta.$1"
597 # Create configuration files
599 echo "$(get_metadata oam_ipaddr)" > /opt/config/oam_ipaddr.txt
600 echo "$(get_metadata cpe_signal_ipaddr)" > /opt/config/cpe_signal_ipaddr.txt
601 echo "$(get_metadata onap_cidr)" > /opt/config/oam_cidr.txt
602 echo "$(get_metadata cpe_signal_net_cidr)" > /opt/config/cpe_signal_net_cidr.txt
603 echo "$(get_metadata mr_ip_addr)" > /opt/config/mr_ip_addr.txt
604 echo "$(get_metadata mr_ip_port)" > /opt/config/mr_ip_port.txt
605 echo "$(get_metadata demo_artifacts_version)" > /opt/config/demo_artifacts_version.txt
606 echo "$(get_metadata install_script_version)" > /opt/config/install_script_version.txt
607 echo "$(get_metadata cloud_env)" > /opt/config/cloud_env.txt
608 echo "$(get_metadata nexus_artifact_repo)" > /opt/config/nexus_artifact_repo.txt
610 # Download and run install script
611 apt-get -y install unzip
612 INSTALL_SCRIPT_VERSION=$(get_metadata install_script_version)
613 NEXUS_ARTIFACT_REPO=$(get_metadata nexus_artifact_repo)
614 if [[ "${INSTALL_SCRIPT_VERSION}" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
615 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
616 unzip -j /opt/vcpe-scripts-${INSTALL_SCRIPT_VERSION}.zip -d /opt v_dhcp_install.sh
618 chmod +x v_dhcp_install.sh
623 #TODO add local disk size
625 virtual_mem_size: 4096 MB
629 - virtual_storage: VirtualStorage_root_all
631 sw_image: #TODO need to put glance image name here
632 #file: { get_input: vcpe_image_name }
633 file: ../Artifacts/images/ubuntu_16.04
634 type: tosca.artifacts.nfv.SwImage
638 type: tosca.nodes.nfv.VduCp
640 layer_protocol: [ipv4]
643 - asscociated_layer_protocol: ipv4
645 address_type: ip_address
647 ip_address_assignment: false
648 floating_ip_activated: false
650 - virtual_binding: VDU_vweb_0
651 # - virtual_link: VL_public
653 Cp_vweb_onap_private:
654 type: tosca.nodes.nfv.VduCp
656 layer_protocol: [ipv4]
659 - asscociated_layer_protocol: ipv4
661 address_type: ip_address
663 ip_address_assignment: false
664 floating_ip_activated: false
666 - { get_input: vweb_private_ip_1 }
668 - virtual_binding: VDU_vweb_0
669 # - virtual_link: VL_onap_private
672 type: tosca.nodes.nfv.VduCp
674 layer_protocol: [ipv4]
677 - asscociated_layer_protocol: ipv4
679 address_type: ip_address
681 ip_address_assignment: false
682 floating_ip_activated: false
684 - { get_input: vweb_private_ip_0 }
686 - virtual_binding: VDU_vweb_0
687 - virtual_link: VL_cpe_public
690 type: tosca.nodes.nfv.Vdu.Compute
692 name: { get_input: vweb_name_0 }
694 configurable_properties:
695 additional_vnfc_configurable_properties: {}
697 min_number_of_instances: 1
698 max_number_of_instances: 1
700 inject_files: # TODO SDC bug
701 source_path: ../Artifacts/keys/authorized_keys #SSH authorized_keys
702 dest_path: /home/ubuntu/.ssh/authorized_keys
704 vnf_id: { get_input: vnf_id }
705 vf_module_id: { get_input: vf_module_id }
706 oam_ipaddr: { get_input: vweb_private_ip_1 }
707 cpe_public_ipaddr: { get_input: vweb_private_ip_0 }
708 oam_cidr: { get_input: oam_private_net_cidr }
709 cpe_public_net_cidr: { get_input: cpe_public_net_cidr }
710 demo_artifacts_version: { get_input: demo_artifacts_version }
711 install_script_version: { get_input: install_script_version }
712 cloud_env: { get_input: cloud_env }
713 nexus_artifact_repo: { get_input: nexus_artifact_repo }
716 METADATA=`curl -s http://169.254.169.254/openstack/2012-08-10/meta_data.json`
717 apt-get -y install jq
720 echo $METADATA | jq -r ".meta.$1"
723 # Create configuration files
725 echo "$(get_metadata oam_ipaddr)" > /opt/config/oam_ipaddr.txt
726 echo "$(get_metadata cpe_public_ipaddr)" > /opt/config/cpe_public_ipaddr.txt
727 echo "$(get_metadata onap_cidr)" > /opt/config/oam_cidr.txt
728 echo "$(get_metadata cpe_public_net_cidr)" > /opt/config/cpe_public_net_cidr.txt
729 echo "$(get_metadata demo_artifacts_version)" > /opt/config/demo_artifacts_version.txt
730 echo "$(get_metadata install_script_version)" > /opt/config/install_script_version.txt
731 echo "$(get_metadata cloud_env)" > /opt/config/cloud_env.txt
732 echo "$(get_metadata nexus_artifact_repo)" > /opt/config/nexus_artifact_repo.txt
734 # Download and run install script
735 apt-get -y install unzip
736 INSTALL_SCRIPT_VERSION=$(get_metadata install_script_version)
737 NEXUS_ARTIFACT_REPO=$(get_metadata nexus_artifact_repo)
738 if [[ "${INSTALL_SCRIPT_VERSION}" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
739 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
740 unzip -j /opt/vcpe-scripts-${INSTALL_SCRIPT_VERSION}.zip -d /opt v_web_install.sh
742 chmod +x v_web_install.sh
747 #TODO add local disk size
749 virtual_mem_size: 4096 MB
753 - virtual_storage: VirtualStorage_root_all
755 sw_image: #TODO need to put glance image name here
756 #file: { get_input: vcpe_image_name }
757 file: ../Artifacts/images/ubuntu_16.04
758 type: tosca.artifacts.nfv.SwImage