1 tosca_definitions_version: tosca_simple_yaml_1_0
3 template_name: vCPE_vgw
4 template_version: "1.0"
6 VNFD_SCHEMA_VERSION: "2.5.1+1"
13 #substitution_mappings:
14 # node_type: onap.vcpe_vgw
16 # virtual_link: [ Cp_vgw_public, virtual_link ] # expose as external CP
17 # virtual_link: [ Cp_vgw_onap_private, virtual_link ] # expose as external CP
22 description: image name for vcpe in openstack glance
26 description: public network id used during onap installation
29 description: onap OAM network id
30 onap_private_net_cidr:
32 description: oanp OAM network cidr
34 mux_gw_private_net_id:
36 description: Private network that connects vGMUX to vGWs
37 default: zdfw1muxgw01_private
38 mux_gw_private_net_cidr:
40 description: he CIDR of the vGMUX private network
44 description: cpe public net name
45 default: zdfw1cpe01_public
48 description: cpe public net cidr
52 description: Private IP address that is assigned to the vGW to communicate with vGMUX
56 description: Private IP address that is assigned to the vGW to communicate with ONAP components
60 description: Private IP address that is assigned to the vGW to communicate with vCPE public network
64 description: Name of the vGW
65 default: zdcpe1cpe01gw01
68 description: dcae collector ip
72 description: dcae collector port
76 description: ssh public key
77 default: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGx6SKrAuCz1V8KGevZueksLdWoPWJP6z3r29Z7TmPVEOjM+7PIPeSs2BVRx3rnHZBAlasMrZ+fJBS25ts9vfC+ItezQah/hr9vrkmwxCR54Lb84poW+sToPeF6i5eZY7W+jWJfLaFSFx9d2vp4zes/fOlT3NvYCXbn/3QdryQoGl7VFI8oemZypVcikZXElJeeKgAVdSwnrzuqtO/tmbXcAeSbYvVjki8ywYcsWMVMYWUWhh+1BAB6kXnTsIWqzrq0Pfvy+81WDwtiqsqmd93HY8hE0scBrXFBZzQS/AYfIFBlEuFNdLczchntjbZ0n7dmDXk8zHtCZYNk7kwb8k/
80 description: Root URL for the Nexus repository for Maven artifacts
81 default: https://nexus.onap.org
82 demo_artifacts_version:
84 description: artifacts version used in demo vnfs
86 install_script_version:
88 description: install script version number
89 default: 1.2.0-SNAPSHOT
92 description: cloud environment(openstack or rackspace)
96 description: IP address of vGMUX
100 description: vni value of vG-vGMUX vxlan tunnel
104 description: The VNF ID is provided by ONAP
105 default: vCPE_Infrastructure_GW_demo_app
108 description: The vCPE Module ID is provided by ONAP
109 default: vCPE_Customer_GW
113 type: tosca.nodes.nfv.VNF
115 descriptor_id: b1bb0ce7-2222-4fa7-95ed-4840d70a1177
117 product_name: vcpe_vgw
118 software_version: '1.0'
119 descriptor_version: '1.0'
121 flavour_description: simple
125 # type: tosca.nodes.nfv.VnfVirtualLink
128 # layer_protocols: [ipv4]
130 # max_bitrate_requirements:
133 # min_bitrate_requirements:
136 # virtual_link_protocol_data:
137 # - associated_layer_protocol: ipv4
140 # name: { get_input: public_net_id }
144 # type: tosca.nodes.nfv.VnfVirtualLink
147 # layer_protocols: [ipv4]
149 # max_bitrate_requirements:
152 # min_bitrate_requirements:
155 # virtual_link_protocol_data:
156 # - associated_layer_protocol: ipv4
159 # name: { get_input: onap_private_net_id }
160 # cidr: { get_input: onap_private_net_cidr }
162 #Private network that connects vGMUX to vGWs
163 VL_mux_gw_private_net:
164 type: tosca.nodes.nfv.VnfVirtualLink
167 layer_protocols: [ipv4]
169 max_bitrate_requirements:
172 min_bitrate_requirements:
175 virtual_link_protocol_data:
176 - associated_layer_protocol: ipv4
178 name: { get_input: mux_gw_private_net_id }
180 cidr: { get_input: mux_gw_private_net_cidr }
183 physical_network: "physnet1"
187 type: tosca.nodes.nfv.VnfVirtualLink
190 layer_protocols: [ipv4]
192 max_bitrate_requirements:
195 min_bitrate_requirements:
198 virtual_link_protocol_data:
199 - associated_layer_protocol: ipv4
201 name: { get_input: cpe_public_net_id }
203 cidr: { get_input: cpe_public_net_cidr }
208 type: tosca.nodes.nfv.VduCp
210 layer_protocols: [ipv4]
213 - associated_layer_protocol: ipv4
215 - address_type: ip_address
217 ip_address_assignment: false
218 floating_ip_activated: false
220 - virtual_binding: VDU_vgw_0
221 #- virtual_link: VL_public
224 type: tosca.nodes.nfv.VduCp
226 layer_protocols: [ipv4]
229 - associated_layer_protocol: ipv4
231 - address_type: ip_address
233 ip_address_assignment: false
234 floating_ip_activated: false
236 - { get_input: vgw_private_ip_1 }
238 - virtual_binding: VDU_vgw_0
239 #- virtual_link: VL_onap_private
241 Cp_vgw_mux_gw_private_net:
242 type: tosca.nodes.nfv.VduCp
244 layer_protocols: [ipv4]
247 - associated_layer_protocol: ipv4
249 - address_type: ip_address
251 ip_address_assignment: false
252 floating_ip_activated: false
254 - { get_input: vgw_private_ip_0 }
256 virtual_network_interface_requirements:
257 - name: "sriov-support"
258 support_mandatory: true
259 network_interface_requirements:
260 interfaceType: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "SR-IOV"}'
262 logical_node_requirements:
263 pciVendorId: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "1234"}'
264 pciDeviceId: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "5678"}'
265 pciNumDevices: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "1"}'
267 - virtual_binding: VDU_vgw_0
268 - virtual_link: VL_mux_gw_private_net
271 type: tosca.nodes.nfv.VduCp
273 layer_protocols: [ipv4]
276 - associated_layer_protocol: ipv4
278 - address_type: ip_address
280 ip_address_assignment: false
281 floating_ip_activated: false
283 - { get_input: vgw_private_ip_2 }
285 - virtual_binding: VDU_vgw_0
286 - virtual_link: VL_cpe_public
289 type: tosca.nodes.nfv.Vdu.Compute
291 name: { get_input: vgw_name_0 }
294 min_number_of_instances: 1
295 max_number_of_instances: 1
297 inject_files: # TODO SDC BUG
298 source_path: ../Artifacts/Deployment/OTHER/authorized_keys #SSH authorized_keys
299 dest_path: /home/ubuntu/.ssh/authorized_keys
301 vnf_id: { get_input: vnf_id }
302 vf_module_id: { get_input: vf_module_id }
303 mux_gw_private_net_ipaddr: { get_input: vgw_private_ip_0 }
304 oam_ipaddr: { get_input: vgw_private_ip_1 }
305 oam_cidr: { get_input: onap_private_net_cidr }
306 cpe_public_net_cidr: { get_input: cpe_public_net_cidr }
307 mux_gw_private_net_cidr: { get_input: mux_gw_private_net_cidr }
308 mux_ip_addr: { get_input: mux_ip_addr }
309 vg_vgmux_tunnel_vni: { get_input: vg_vgmux_tunnel_vni }
310 install_script_version: { get_input: install_script_version }
311 cloud_env: { get_input: cloud_env }
312 nexus_artifact_repo: { get_input: nexus_artifact_repo }
315 METADATA=`curl -s http://169.254.169.254/openstack/2012-08-10/meta_data.json`
316 apt-get -y install jq
319 echo $METADATA | jq -r ".meta.$1"
322 # Create configuration files
324 echo "$(get_metadata oam_ipaddr)" > /opt/config/oam_ipaddr.txt
325 echo "$(get_metadata oam_cidr)" > /opt/config/oam_cidr.txt
326 echo "$(get_metadata cpe_public_net_cidr)" > /opt/config/cpe_public_net_cidr.txt
327 echo "$(get_metadata mux_gw_private_net_ipaddr)" > /opt/config/mux_gw_private_net_ipaddr.txt
328 echo "$(get_metadata mux_gw_private_net_cidr)" > /opt/config/mux_gw_private_net_cidr.txt
329 echo "$(get_metadata install_script_version)" > /opt/config/install_script_version.txt
330 echo "$(get_metadata cloud_env)" > /opt/config/cloud_env.txt
331 echo "$(get_metadata mux_ip_addr)" > /opt/config/mux_ip_addr.txt
332 echo "$(get_metadata vg_vgmux_tunnel_vni)" > /opt/config/vg_vgmux_tunnel_vni.txt
333 echo "$(get_metadata nexus_artifact_repo)" > /opt/config/nexus_artifact_repo.txt
335 # Download and run install script
336 apt-get -y install unzip
337 INSTALL_SCRIPT_VERSION=$(get_metadata install_script_version)
338 NEXUS_ARTIFACT_REPO=$(get_metadata nexus_artifact_repo)
339 if [[ "${INSTALL_SCRIPT_VERSION}" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
340 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
341 unzip -j /opt/vcpe-scripts-${INSTALL_SCRIPT_VERSION}.zip -d /opt v_gw_install.sh
343 chmod +x v_gw_install.sh
349 virtual_mem_size: 4096 MB
350 vdu_mem_requirements:
351 memoryPageSize: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "2 MB"}'
352 numberOfPages: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "1024"}'
355 cpu_architecture: generic
356 virtual_local_storage:
357 - size_of_storage: 40 GB
359 sw_image: #TODO need to put glance image name here
360 #file: { get_input: vcpe_image_name }
361 file: ../Artifacts/Deployment/OTHER/image
362 type: tosca.artifacts.nfv.SwImage