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
65 description: onap OAM network id
66 onap_private_net_cidr:
68 description: oanp OAM network cidr
70 mux_gw_private_net_id:
72 description: Private network that connects vGMUX to vGWs
73 default: zdfw1muxgw01_private
74 mux_gw_private_net_cidr:
76 description: he CIDR of the vGMUX private network
80 description: cpe public net name
81 default: zdfw1cpe01_public
84 description: cpe public net cidr
88 description: Private IP address that is assigned to the vGW to communicate with vGMUX
92 description: Private IP address that is assigned to the vGW to communicate with ONAP components
96 description: Private IP address that is assigned to the vGW to communicate with vCPE public network
100 description: Name of the vGW
101 default: zdcpe1cpe01gw01
104 description: dcae collector ip
108 description: dcae collector port
112 description: ssh public key
113 default: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGx6SKrAuCz1V8KGevZueksLdWoPWJP6z3r29Z7TmPVEOjM+7PIPeSs2BVRx3rnHZBAlasMrZ+fJBS25ts9vfC+ItezQah/hr9vrkmwxCR54Lb84poW+sToPeF6i5eZY7W+jWJfLaFSFx9d2vp4zes/fOlT3NvYCXbn/3QdryQoGl7VFI8oemZypVcikZXElJeeKgAVdSwnrzuqtO/tmbXcAeSbYvVjki8ywYcsWMVMYWUWhh+1BAB6kXnTsIWqzrq0Pfvy+81WDwtiqsqmd93HY8hE0scBrXFBZzQS/AYfIFBlEuFNdLczchntjbZ0n7dmDXk8zHtCZYNk7kwb8k/
116 description: Root URL for the Nexus repository for Maven artifacts
117 default: https://nexus.onap.org
118 demo_artifacts_version:
120 description: artifacts version used in demo vnfs
122 install_script_version:
124 description: install script version number
125 default: 1.2.0-SNAPSHOT
128 description: cloud environment(openstack or rackspace)
132 description: IP address of vGMUX
136 description: vni value of vG-vGMUX vxlan tunnel
140 description: The VNF ID is provided by ONAP
141 default: vCPE_Infrastructure_GW_demo_app
144 description: The vCPE Module ID is provided by ONAP
145 default: vCPE_Customer_GW
150 # type: tosca.nodes.nfv.VnfVirtualLink
153 # layer_protocol: ipv4
155 # max_bit_rate_requirements:
158 # min_bit_rate_requirements:
161 # networkName: { get_input: public_net_id }
165 # type: tosca.nodes.nfv.VnfVirtualLink
168 # layer_protocol: ipv4
170 # max_bit_rate_requirements:
173 # min_bit_rate_requirements:
176 # networkName: { get_input: onap_private_net_id }
177 # cidr: { get_input: onap_private_net_cidr }
179 #Private network that connects vGMUX to vGWs
180 VL_mux_gw_private_net:
181 type: tosca.nodes.nfv.VnfVirtualLink
186 max_bit_rate_requirements:
189 min_bit_rate_requirements:
192 networkName: { get_input: mux_gw_private_net_id}
193 cidr: { get_input: mux_gw_private_net_cidr }
195 physicalNetwork: "physnet1"
199 type: tosca.nodes.nfv.VnfVirtualLink
204 max_bit_rate_requirements:
207 min_bit_rate_requirements:
210 networkName: { get_input: cpe_public_net_id}
211 cidr: { get_input: cpe_public_net_cidr }
216 type: tosca.nodes.nfv.VduCp
218 layer_protocol: [ipv4]
221 - asscociated_layer_protocol: ipv4
223 address_type: ip_address
225 ip_address_assignment: false
226 floating_ip_activated: false
228 - virtual_binding: VDU_vgw_0
229 #- virtual_link: VL_public
232 type: tosca.nodes.nfv.VduCp
234 layer_protocol: [ipv4]
237 - asscociated_layer_protocol: ipv4
239 address_type: ip_address
241 ip_address_assignment: false
242 floating_ip_activated: false
244 - { get_input: vgw_private_ip_1 }
246 - virtual_binding: VDU_vgw_0
247 #- virtual_link: VL_onap_private
249 Cp_vgw_mux_gw_private_net:
250 type: tosca.nodes.nfv.VduCp
252 layer_protocol: [ipv4]
255 - asscociated_layer_protocol: ipv4
257 address_type: ip_address
259 ip_address_assignment: false
260 floating_ip_activated: false
262 - { get_input: vgw_private_ip_0 }
264 virtual_network_interface_requirements:
265 - name: "sriov-support"
266 support_mandatory: true
267 network_interface_requirements:
268 interfaceType: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "SR-IOV"}'
270 pciVendorId: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "1234"}'
271 pciDeviceId: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "5678"}'
272 pciNumDevices: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "1"}'
274 - virtual_binding: VDU_vgw_0
275 - virtual_link: VL_mux_gw_private_net
278 type: tosca.nodes.nfv.VduCp
280 layer_protocol: [ipv4]
283 - asscociated_layer_protocol: ipv4
285 address_type: ip_address
287 ip_address_assignment: false
288 floating_ip_activated: false
290 - { get_input: vgw_private_ip_2 }
292 - virtual_binding: VDU_vgw_0
293 - virtual_link: VL_cpe_public
295 VirtualStorage_root_all:
296 # this indicate the VDU root storage size
297 type: tosca.nodes.nfv.Vdu.VirtualStorage
299 type_of_storage: root
300 size_of_storage: 40 GB
303 type: tosca.nodes.nfv.Vdu.Compute
305 name: { get_input: vgw_name_0 }
307 configurable_properties:
308 additional_vnfc_configurable_properties: {}
310 min_number_of_instances: 1
311 max_number_of_instances: 1
313 inject_files: # TODO SDC BUG
314 source_path: ../Artifacts/keys/authorized_keys #SSH authorized_keys
315 dest_path: /home/ubuntu/.ssh/authorized_keys
317 vnf_id: { get_input: vnf_id }
318 vf_module_id: { get_input: vf_module_id }
319 mux_gw_private_net_ipaddr: { get_input: vgw_private_ip_0 }
320 oam_ipaddr: { get_input: vgw_private_ip_1 }
321 oam_cidr: { get_input: oam_private_net_cidr }
322 cpe_public_net_cidr: { get_input: cpe_public_net_cidr }
323 mux_gw_private_net_cidr: { get_input: mux_gw_private_net_cidr }
324 mux_ip_addr: { get_input: mux_ip_addr }
325 vg_vgmux_tunnel_vni: { get_input: vg_vgmux_tunnel_vni }
326 install_script_version: { get_input: install_script_version }
327 cloud_env: { get_input: cloud_env }
328 nexus_artifact_repo: { get_input: nexus_artifact_repo }
331 METADATA=`curl -s http://169.254.169.254/openstack/2012-08-10/meta_data.json`
332 apt-get -y install jq
335 echo $METADATA | jq -r ".meta.$1"
338 # Create configuration files
340 echo "$(get_metadata oam_ipaddr)" > /opt/config/oam_ipaddr.txt
341 echo "$(get_metadata oam_cidr)" > /opt/config/oam_cidr.txt
342 echo "$(get_metadata cpe_public_net_cidr)" > /opt/config/cpe_public_net_cidr.txt
343 echo "$(get_metadata mux_gw_private_net_ipaddr)" > /opt/config/mux_gw_private_net_ipaddr.txt
344 echo "$(get_metadata mux_gw_private_net_cidr)" > /opt/config/mux_gw_private_net_cidr.txt
345 echo "$(get_metadata install_script_version)" > /opt/config/install_script_version.txt
346 echo "$(get_metadata cloud_env)" > /opt/config/cloud_env.txt
347 echo "$(get_metadata mux_ip_addr)" > /opt/config/mux_ip_addr.txt
348 echo "$(get_metadata vg_vgmux_tunnel_vni)" > /opt/config/vg_vgmux_tunnel_vni.txt
349 echo "$(get_metadata nexus_artifact_repo)" > /opt/config/nexus_artifact_repo.txt
351 # Download and run install script
352 apt-get -y install unzip
353 INSTALL_SCRIPT_VERSION=$(get_metadata install_script_version)
354 NEXUS_ARTIFACT_REPO=$(get_metadata nexus_artifact_repo)
355 if [[ "${INSTALL_SCRIPT_VERSION}" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
356 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
357 unzip -j /opt/vcpe-scripts-${INSTALL_SCRIPT_VERSION}.zip -d /opt v_gw_install.sh
359 chmod +x v_gw_install.sh
364 #TODO add local disk size
366 virtual_mem_size: 4096 MB
368 vdu_memory_requirements:
369 memoryPageSize: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "2 MB"}'
370 numberOfPages: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "1024"}'
373 cpu_architecture: generic
375 - virtual_storage: VirtualStorage_root_all
377 sw_image: #TODO need to put glance image name here
378 #file: { get_input: vcpe_image_name }
379 file: ../Artifacts/images/ubuntu_16.04
380 type: tosca.artifacts.nfv.SwImage