1 tosca_definitions_version: tosca_simple_yaml_1_0
3 template_name: vCPE_vgw
4 template_version: "1.0"
12 #substitution_mappings:
13 # node_type: onap.vcpe_vgw
15 # virtual_link: [ Cp_vgw_public, virtual_link ] # expose as external CP
16 # virtual_link: [ Cp_vgw_onap_private, virtual_link ] # expose as external CP
21 description: image name for vcpe in openstack glance
25 description: public network id used during onap installation
29 description: onap OAM network id
31 onap_private_net_cidr:
33 description: oanp OAM network cidr
35 mux_gw_private_net_id:
37 description: Private network that connects vGMUX to vGWs
38 default: zdfw1muxgw01_private
39 mux_gw_private_net_cidr:
41 description: he CIDR of the vGMUX private network
45 description: cpe public net name
46 default: zdfw1cpe01_public
49 description: cpe public net cidr
53 description: Private IP address that is assigned to the vGW to communicate with vGMUX
57 description: Private IP address that is assigned to the vGW to communicate with ONAP components
61 description: Private IP address that is assigned to the vGW to communicate with vCPE public network
65 description: Name of the vGW
66 default: zdcpe1cpe01gw01
69 description: dcae collector ip
73 description: dcae collector port
77 description: ssh public key
78 default: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGx6SKrAuCz1V8KGevZueksLdWoPWJP6z3r29Z7TmPVEOjM+7PIPeSs2BVRx3rnHZBAlasMrZ+fJBS25ts9vfC+ItezQah/hr9vrkmwxCR54Lb84poW+sToPeF6i5eZY7W+jWJfLaFSFx9d2vp4zes/fOlT3NvYCXbn/3QdryQoGl7VFI8oemZypVcikZXElJeeKgAVdSwnrzuqtO/tmbXcAeSbYvVjki8ywYcsWMVMYWUWhh+1BAB6kXnTsIWqzrq0Pfvy+81WDwtiqsqmd93HY8hE0scBrXFBZzQS/AYfIFBlEuFNdLczchntjbZ0n7dmDXk8zHtCZYNk7kwb8k/
81 description: Root URL for the Nexus repository for Maven artifacts
82 default: https://nexus.onap.org
83 demo_artifacts_version:
85 description: artifacts version used in demo vnfs
87 install_script_version:
89 description: install script version number
90 default: 1.2.0-SNAPSHOT
93 description: cloud environment(openstack or rackspace)
97 description: IP address of vGMUX
101 description: vni value of vG-vGMUX vxlan tunnel
105 description: The VNF ID is provided by ONAP
106 default: vCPE_Infrastructure_GW_demo_app
109 description: The vCPE Module ID is provided by ONAP
110 default: vCPE_Customer_GW
114 type: tosca.nodes.nfv.VNF
116 descriptor_id: b1bb0ce7-2222-4fa7-95ed-4840d70a1177
118 product_name: vcpe_vgw
119 software_version: '1.0'
120 descriptor_version: '1.0'
122 flavour_description: simple
128 # type: tosca.nodes.nfv.VnfVirtualLink
131 # layer_protocol: ipv4
133 # max_bit_rate_requirements:
136 # min_bit_rate_requirements:
139 # networkName: { get_input: public_net_id }
143 # type: tosca.nodes.nfv.VnfVirtualLink
146 # layer_protocol: ipv4
148 # max_bit_rate_requirements:
151 # min_bit_rate_requirements:
154 # networkName: { get_input: onap_private_net_id }
155 # cidr: { get_input: onap_private_net_cidr }
157 #Private network that connects vGMUX to vGWs
158 VL_mux_gw_private_net:
159 type: tosca.nodes.nfv.VnfVirtualLink
164 max_bit_rate_requirements:
167 min_bit_rate_requirements:
170 networkName: { get_input: mux_gw_private_net_id}
171 cidr: { get_input: mux_gw_private_net_cidr }
176 type: tosca.nodes.nfv.VnfVirtualLink
181 max_bit_rate_requirements:
184 min_bit_rate_requirements:
187 networkName: { get_input: cpe_public_net_id}
188 cidr: { get_input: cpe_public_net_cidr }
193 type: tosca.nodes.nfv.VduCp
195 layer_protocol: [ipv4]
198 - asscociated_layer_protocol: ipv4
200 address_type: ip_address
202 ip_address_assignment: false
203 floating_ip_activated: false
205 - virtual_binding: VDU_vgw_0
206 #- virtual_link: VL_public
209 type: tosca.nodes.nfv.VduCp
211 layer_protocol: [ipv4]
214 - asscociated_layer_protocol: ipv4
216 address_type: ip_address
218 ip_address_assignment: false
219 floating_ip_activated: false
221 - { get_input: vgw_private_ip_1 }
223 - virtual_binding: VDU_vgw_0
224 #- virtual_link: VL_onap_private
226 Cp_vgw_mux_gw_private_net:
227 type: tosca.nodes.nfv.VduCp
229 layer_protocol: [ipv4]
232 - asscociated_layer_protocol: ipv4
234 address_type: ip_address
236 ip_address_assignment: false
237 floating_ip_activated: false
239 - { get_input: vgw_private_ip_0 }
240 virtual_network_interface_requirements:
242 support_mandatory: true
244 network_interface_requirements:
245 dataProcessingAccelerationLibrary: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "DPDK"}'
247 - virtual_binding: VDU_vgw_0
248 - virtual_link: VL_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_2 }
265 - virtual_binding: VDU_vgw_0
266 - virtual_link: VL_cpe_public
268 VirtualStorage_root_all:
269 # this indicate the VDU root storage size
270 type: tosca.nodes.nfv.Vdu.VirtualStorage
272 type_of_storage: root
273 size_of_storage: 40 GB
276 type: tosca.nodes.nfv.Vdu.Compute
278 name: { get_input: vgw_name_0 }
280 configurable_properties:
281 additional_vnfc_configurable_properties: {}
283 min_number_of_instances: 1
284 max_number_of_instances: 1
286 inject_files: # TODO SDC BUG
287 source_path: ../Artifacts/Deployment/Other/authorized_keys #SSH authorized_keys
288 dest_path: /home/ubuntu/.ssh/authorized_keys
290 vnf_id: { get_input: vnf_id }
291 vf_module_id: { get_input: vf_module_id }
292 mux_gw_private_net_ipaddr: { get_input: vgw_private_ip_0 }
293 oam_ipaddr: { get_input: vgw_private_ip_1 }
294 oam_cidr: { get_input: onap_private_net_cidr }
295 cpe_public_net_cidr: { get_input: cpe_public_net_cidr }
296 mux_gw_private_net_cidr: { get_input: mux_gw_private_net_cidr }
297 mux_ip_addr: { get_input: mux_ip_addr }
298 vg_vgmux_tunnel_vni: { get_input: vg_vgmux_tunnel_vni }
299 install_script_version: { get_input: install_script_version }
300 cloud_env: { get_input: cloud_env }
301 nexus_artifact_repo: { get_input: nexus_artifact_repo }
304 METADATA=`curl -s http://169.254.169.254/openstack/2012-08-10/meta_data.json`
305 apt-get -y install jq
308 echo $METADATA | jq -r ".meta.$1"
311 # Create configuration files
313 echo "$(get_metadata oam_ipaddr)" > /opt/config/oam_ipaddr.txt
314 echo "$(get_metadata oam_cidr)" > /opt/config/oam_cidr.txt
315 echo "$(get_metadata cpe_public_net_cidr)" > /opt/config/cpe_public_net_cidr.txt
316 echo "$(get_metadata mux_gw_private_net_ipaddr)" > /opt/config/mux_gw_private_net_ipaddr.txt
317 echo "$(get_metadata mux_gw_private_net_cidr)" > /opt/config/mux_gw_private_net_cidr.txt
318 echo "$(get_metadata install_script_version)" > /opt/config/install_script_version.txt
319 echo "$(get_metadata cloud_env)" > /opt/config/cloud_env.txt
320 echo "$(get_metadata mux_ip_addr)" > /opt/config/mux_ip_addr.txt
321 echo "$(get_metadata vg_vgmux_tunnel_vni)" > /opt/config/vg_vgmux_tunnel_vni.txt
322 echo "$(get_metadata nexus_artifact_repo)" > /opt/config/nexus_artifact_repo.txt
324 # Download and run install script
325 apt-get -y install unzip
326 INSTALL_SCRIPT_VERSION=$(get_metadata install_script_version)
327 NEXUS_ARTIFACT_REPO=$(get_metadata nexus_artifact_repo)
328 if [[ "${INSTALL_SCRIPT_VERSION}" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
329 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
330 unzip -j /opt/vcpe-scripts-${INSTALL_SCRIPT_VERSION}.zip -d /opt v_gw_install.sh
332 chmod +x v_gw_install.sh
337 #TODO add local disk size
339 virtual_mem_size: 4096 MB
341 vdu_memory_requirements:
342 memoryPageSize: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "2 MB"}'
343 numberOfPages: '{"schemaVersion": "0","schemaSelector": "","hardwarePlatform": "generic","mandatory": "true", "configurationValue": "1024"}'
346 cpu_architecture: generic
348 - virtual_storage: VirtualStorage_root_all
350 sw_image: #TODO need to put glance image name here
351 #file: { get_input: vcpe_image_name }
352 file: ../Artifacts/Deployment/Other/image
353 type: tosca.artifacts.nfv.SwImage