1 tosca_definitions_version: tosca_simple_yaml_1_0
3 template_name: vCPE_vgw
4 template_version: "1.0"
13 derived_from: tosca.nodes.nfv.VNF
17 constraints: [ valid_values: [ b1bb0ce7-2222-4fa7-95ed-4840d70a1177 ] ]
18 default: b1bb0ce7-2222-4fa7-95ed-4840d70a1177
21 constraints: [ valid_values: [ onap ] ]
25 constraints: [ valid_values: [ vcpe_vgw ] ]
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_vgw
52 # virtual_link: [ Cp_vgw_public, virtual_link ] # expose as external CP
53 # virtual_link: [ Cp_vgw_onap_private, virtual_link ] # expose as external CP
58 description: image name for vcpe in openstack glance
62 description: public network id used during onap installation
66 description: onap OAM network id
68 onap_private_net_cidr:
70 description: oanp OAM network cidr
72 mux_gw_private_net_id:
74 description: Private network that connects vGMUX to vGWs
75 default: zdfw1muxgw01_private
76 mux_gw_private_net_cidr:
78 description: he CIDR of the vGMUX private network
82 description: cpe public net name
83 default: zdfw1cpe01_public
86 description: cpe public net cidr
90 description: Private IP address that is assigned to the vGW to communicate with vGMUX
94 description: Private IP address that is assigned to the vGW to communicate with ONAP components
98 description: Private IP address that is assigned to the vGW to communicate with vCPE public network
102 description: Name of the vGW
103 default: zdcpe1cpe01gw01
106 description: dcae collector ip
110 description: dcae collector port
114 description: ssh public key
115 default: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGx6SKrAuCz1V8KGevZueksLdWoPWJP6z3r29Z7TmPVEOjM+7PIPeSs2BVRx3rnHZBAlasMrZ+fJBS25ts9vfC+ItezQah/hr9vrkmwxCR54Lb84poW+sToPeF6i5eZY7W+jWJfLaFSFx9d2vp4zes/fOlT3NvYCXbn/3QdryQoGl7VFI8oemZypVcikZXElJeeKgAVdSwnrzuqtO/tmbXcAeSbYvVjki8ywYcsWMVMYWUWhh+1BAB6kXnTsIWqzrq0Pfvy+81WDwtiqsqmd93HY8hE0scBrXFBZzQS/AYfIFBlEuFNdLczchntjbZ0n7dmDXk8zHtCZYNk7kwb8k/
118 description: Root URL for the Nexus repository for Maven artifacts
119 default: https://nexus.onap.org
120 demo_artifacts_version:
122 description: artifacts version used in demo vnfs
124 install_script_version:
126 description: install script version number
127 default: 1.2.0-SNAPSHOT
130 description: cloud environment(openstack or rackspace)
134 description: IP address of vGMUX
138 description: vni value of vG-vGMUX vxlan tunnel
142 description: The VNF ID is provided by ONAP
143 default: vCPE_Infrastructure_GW_demo_app
146 description: The vCPE Module ID is provided by ONAP
147 default: vCPE_Customer_GW
152 # type: tosca.nodes.nfv.VnfVirtualLink
155 # layer_protocol: ipv4
157 # max_bit_rate_requirements:
160 # min_bit_rate_requirements:
163 # networkName: { get_input: public_net_id }
167 # type: tosca.nodes.nfv.VnfVirtualLink
170 # layer_protocol: ipv4
172 # max_bit_rate_requirements:
175 # min_bit_rate_requirements:
178 # networkName: { get_input: onap_private_net_id }
179 # cidr: { get_input: onap_private_net_cidr }
181 #Private network that connects vGMUX to vGWs
182 VL_mux_gw_private_net:
183 type: tosca.nodes.nfv.VnfVirtualLink
188 max_bit_rate_requirements:
191 min_bit_rate_requirements:
194 networkName: { get_input: mux_gw_private_net_id}
195 cidr: { get_input: mux_gw_private_net_cidr }
200 type: tosca.nodes.nfv.VnfVirtualLink
205 max_bit_rate_requirements:
208 min_bit_rate_requirements:
211 networkName: { get_input: cpe_public_net_id}
212 cidr: { get_input: cpe_public_net_cidr }
217 type: tosca.nodes.nfv.VduCp
219 layer_protocol: [ipv4]
222 - asscociated_layer_protocol: ipv4
224 address_type: ip_address
226 ip_address_assignment: false
227 floating_ip_activated: false
229 - virtual_binding: VDU_vgw_0
230 #- virtual_link: VL_public
233 type: tosca.nodes.nfv.VduCp
235 layer_protocol: [ipv4]
238 - asscociated_layer_protocol: ipv4
240 address_type: ip_address
242 ip_address_assignment: false
243 floating_ip_activated: false
245 - { get_input: vgw_private_ip_1 }
247 - virtual_binding: VDU_vgw_0
248 #- virtual_link: VL_onap_private
250 Cp_vgw_mux_gw_private_net:
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 - { get_input: vgw_private_ip_0 }
264 virtual_network_interface_requirements:
266 support_mandatory: true
268 network_interface_requirements:
269 dataProcessingAccelerationLibrary: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "DPDK"}'
271 - virtual_binding: VDU_vgw_0
272 - virtual_link: VL_mux_gw_private_net
275 type: tosca.nodes.nfv.VduCp
277 layer_protocol: [ipv4]
280 - asscociated_layer_protocol: ipv4
282 address_type: ip_address
284 ip_address_assignment: false
285 floating_ip_activated: false
287 - { get_input: vgw_private_ip_2 }
289 - virtual_binding: VDU_vgw_0
290 - virtual_link: VL_cpe_public
292 VirtualStorage_root_all:
293 # this indicate the VDU root storage size
294 type: tosca.nodes.nfv.Vdu.VirtualStorage
296 type_of_storage: root
297 size_of_storage: 40 GB
300 type: tosca.nodes.nfv.Vdu.Compute
302 name: { get_input: vgw_name_0 }
304 configurable_properties:
305 additional_vnfc_configurable_properties: {}
307 min_number_of_instances: 1
308 max_number_of_instances: 1
310 inject_files: # TODO SDC BUG
311 source_path: ../Artifacts/keys/authorized_keys #SSH authorized_keys
312 dest_path: /home/ubuntu/.ssh/authorized_keys
314 vnf_id: { get_input: vnf_id }
315 vf_module_id: { get_input: vf_module_id }
316 mux_gw_private_net_ipaddr: { get_input: vgw_private_ip_0 }
317 oam_ipaddr: { get_input: vgw_private_ip_1 }
318 oam_cidr: { get_input: oam_private_net_cidr }
319 cpe_public_net_cidr: { get_input: cpe_public_net_cidr }
320 mux_gw_private_net_cidr: { get_input: mux_gw_private_net_cidr }
321 mux_ip_addr: { get_input: mux_ip_addr }
322 vg_vgmux_tunnel_vni: { get_input: vg_vgmux_tunnel_vni }
323 install_script_version: { get_input: install_script_version }
324 cloud_env: { get_input: cloud_env }
325 nexus_artifact_repo: { get_input: nexus_artifact_repo }
328 METADATA=`curl -s http://169.254.169.254/openstack/2012-08-10/meta_data.json`
329 apt-get -y install jq
332 echo $METADATA | jq -r ".meta.$1"
335 # Create configuration files
337 echo "$(get_metadata oam_ipaddr)" > /opt/config/oam_ipaddr.txt
338 echo "$(get_metadata oam_cidr)" > /opt/config/oam_cidr.txt
339 echo "$(get_metadata cpe_public_net_cidr)" > /opt/config/cpe_public_net_cidr.txt
340 echo "$(get_metadata mux_gw_private_net_ipaddr)" > /opt/config/mux_gw_private_net_ipaddr.txt
341 echo "$(get_metadata mux_gw_private_net_cidr)" > /opt/config/mux_gw_private_net_cidr.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 mux_ip_addr)" > /opt/config/mux_ip_addr.txt
345 echo "$(get_metadata vg_vgmux_tunnel_vni)" > /opt/config/vg_vgmux_tunnel_vni.txt
346 echo "$(get_metadata nexus_artifact_repo)" > /opt/config/nexus_artifact_repo.txt
348 # Download and run install script
349 apt-get -y install unzip
350 INSTALL_SCRIPT_VERSION=$(get_metadata install_script_version)
351 NEXUS_ARTIFACT_REPO=$(get_metadata nexus_artifact_repo)
352 if [[ "${INSTALL_SCRIPT_VERSION}" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
353 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
354 unzip -j /opt/vcpe-scripts-${INSTALL_SCRIPT_VERSION}.zip -d /opt v_gw_install.sh
356 chmod +x v_gw_install.sh
361 #TODO add local disk size
363 virtual_mem_size: 4096 MB
365 vdu_memory_requirements:
366 memoryPageSize: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "2 MB"}'
367 numberOfPages: '{"schemaVersion": "0","schemaSelector": "","hardwarePlatform": "generic","mandatory": "true", "configurationValue": "1024"}'
370 cpu_architecture: generic
372 - virtual_storage: VirtualStorage_root_all
374 sw_image: #TODO need to put glance image name here
375 #file: { get_input: vcpe_image_name }
376 file: ../Artifacts/images/ubuntu_16.04
377 type: tosca.artifacts.nfv.SwImage