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
28 description: onap OAM network id
29 onap_private_net_cidr:
31 description: oanp OAM network cidr
33 mux_gw_private_net_id:
35 description: Private network that connects vGMUX to vGWs
36 default: zdfw1muxgw01_private
37 mux_gw_private_net_cidr:
39 description: he CIDR of the vGMUX private network
43 description: cpe public net name
44 default: zdfw1cpe01_public
47 description: cpe public net cidr
51 description: Private IP address that is assigned to the vGW to communicate with vGMUX
55 description: Private IP address that is assigned to the vGW to communicate with ONAP components
59 description: Private IP address that is assigned to the vGW to communicate with vCPE public network
63 description: Name of the vGW
64 default: zdcpe1cpe01gw01
67 description: dcae collector ip
71 description: dcae collector port
75 description: ssh public key
76 default: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGx6SKrAuCz1V8KGevZueksLdWoPWJP6z3r29Z7TmPVEOjM+7PIPeSs2BVRx3rnHZBAlasMrZ+fJBS25ts9vfC+ItezQah/hr9vrkmwxCR54Lb84poW+sToPeF6i5eZY7W+jWJfLaFSFx9d2vp4zes/fOlT3NvYCXbn/3QdryQoGl7VFI8oemZypVcikZXElJeeKgAVdSwnrzuqtO/tmbXcAeSbYvVjki8ywYcsWMVMYWUWhh+1BAB6kXnTsIWqzrq0Pfvy+81WDwtiqsqmd93HY8hE0scBrXFBZzQS/AYfIFBlEuFNdLczchntjbZ0n7dmDXk8zHtCZYNk7kwb8k/
79 description: Root URL for the Nexus repository for Maven artifacts
80 default: https://nexus.onap.org
81 demo_artifacts_version:
83 description: artifacts version used in demo vnfs
85 install_script_version:
87 description: install script version number
88 default: 1.2.0-SNAPSHOT
91 description: cloud environment(openstack or rackspace)
95 description: IP address of vGMUX
99 description: vni value of vG-vGMUX vxlan tunnel
103 description: The VNF ID is provided by ONAP
104 default: vCPE_Infrastructure_GW_demo_app
107 description: The vCPE Module ID is provided by ONAP
108 default: vCPE_Customer_GW
112 type: tosca.nodes.nfv.VNF
114 descriptor_id: b1bb0ce7-2222-4fa7-95ed-4840d70a1177
116 product_name: vcpe_vgw
117 software_version: '1.0'
118 descriptor_version: '1.0'
120 flavour_description: simple
124 # type: tosca.nodes.nfv.VnfVirtualLink
127 # layer_protocol: ipv4
129 # max_bit_rate_requirements:
132 # min_bit_rate_requirements:
135 # networkName: { get_input: public_net_id }
139 # type: tosca.nodes.nfv.VnfVirtualLink
142 # layer_protocol: ipv4
144 # max_bit_rate_requirements:
147 # min_bit_rate_requirements:
150 # networkName: { get_input: onap_private_net_id }
151 # cidr: { get_input: onap_private_net_cidr }
153 #Private network that connects vGMUX to vGWs
154 VL_mux_gw_private_net:
155 type: tosca.nodes.nfv.VnfVirtualLink
160 max_bit_rate_requirements:
163 min_bit_rate_requirements:
166 networkName: { get_input: mux_gw_private_net_id}
167 cidr: { get_input: mux_gw_private_net_cidr }
169 physicalNetwork: "physnet1"
173 type: tosca.nodes.nfv.VnfVirtualLink
178 max_bit_rate_requirements:
181 min_bit_rate_requirements:
184 networkName: { get_input: cpe_public_net_id}
185 cidr: { get_input: cpe_public_net_cidr }
190 type: tosca.nodes.nfv.VduCp
192 layer_protocol: [ipv4]
195 - asscociated_layer_protocol: ipv4
197 address_type: ip_address
199 ip_address_assignment: false
200 floating_ip_activated: false
202 - virtual_binding: VDU_vgw_0
203 #- virtual_link: VL_public
206 type: tosca.nodes.nfv.VduCp
208 layer_protocol: [ipv4]
211 - asscociated_layer_protocol: ipv4
213 address_type: ip_address
215 ip_address_assignment: false
216 floating_ip_activated: false
218 - { get_input: vgw_private_ip_1 }
220 - virtual_binding: VDU_vgw_0
221 #- virtual_link: VL_onap_private
223 Cp_vgw_mux_gw_private_net:
224 type: tosca.nodes.nfv.VduCp
226 layer_protocol: [ipv4]
229 - asscociated_layer_protocol: ipv4
231 address_type: ip_address
233 ip_address_assignment: false
234 floating_ip_activated: false
236 - { get_input: vgw_private_ip_0 }
238 virtual_network_interface_requirements:
239 - name: "sriov-support"
240 support_mandatory: true
241 network_interface_requirements:
242 interfaceType: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "SR-IOV"}'
244 logical_node_requirements:
245 pciVendorId: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "1234"}'
246 pciDeviceId: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "5678"}'
247 pciNumDevices: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "1"}'
249 - virtual_binding: VDU_vgw_0
250 - virtual_link: VL_mux_gw_private_net
253 type: tosca.nodes.nfv.VduCp
255 layer_protocol: [ipv4]
258 - asscociated_layer_protocol: ipv4
260 address_type: ip_address
262 ip_address_assignment: false
263 floating_ip_activated: false
265 - { get_input: vgw_private_ip_2 }
267 - virtual_binding: VDU_vgw_0
268 - virtual_link: VL_cpe_public
270 VirtualStorage_root_all:
271 # this indicate the VDU root storage size
272 type: tosca.nodes.nfv.Vdu.VirtualStorage
274 type_of_storage: root
275 size_of_storage: 40 GB
278 type: tosca.nodes.nfv.Vdu.Compute
280 name: { get_input: vgw_name_0 }
282 configurable_properties:
283 additional_vnfc_configurable_properties: {}
285 min_number_of_instances: 1
286 max_number_of_instances: 1
288 inject_files: # TODO SDC BUG
289 source_path: ../Artifacts/Deployment/OTHER/authorized_keys #SSH authorized_keys
290 dest_path: /home/ubuntu/.ssh/authorized_keys
292 vnf_id: { get_input: vnf_id }
293 vf_module_id: { get_input: vf_module_id }
294 mux_gw_private_net_ipaddr: { get_input: vgw_private_ip_0 }
295 oam_ipaddr: { get_input: vgw_private_ip_1 }
296 oam_cidr: { get_input: onap_private_net_cidr }
297 cpe_public_net_cidr: { get_input: cpe_public_net_cidr }
298 mux_gw_private_net_cidr: { get_input: mux_gw_private_net_cidr }
299 mux_ip_addr: { get_input: mux_ip_addr }
300 vg_vgmux_tunnel_vni: { get_input: vg_vgmux_tunnel_vni }
301 install_script_version: { get_input: install_script_version }
302 cloud_env: { get_input: cloud_env }
303 nexus_artifact_repo: { get_input: nexus_artifact_repo }
306 METADATA=`curl -s http://169.254.169.254/openstack/2012-08-10/meta_data.json`
307 apt-get -y install jq
310 echo $METADATA | jq -r ".meta.$1"
313 # Create configuration files
315 echo "$(get_metadata oam_ipaddr)" > /opt/config/oam_ipaddr.txt
316 echo "$(get_metadata oam_cidr)" > /opt/config/oam_cidr.txt
317 echo "$(get_metadata cpe_public_net_cidr)" > /opt/config/cpe_public_net_cidr.txt
318 echo "$(get_metadata mux_gw_private_net_ipaddr)" > /opt/config/mux_gw_private_net_ipaddr.txt
319 echo "$(get_metadata mux_gw_private_net_cidr)" > /opt/config/mux_gw_private_net_cidr.txt
320 echo "$(get_metadata install_script_version)" > /opt/config/install_script_version.txt
321 echo "$(get_metadata cloud_env)" > /opt/config/cloud_env.txt
322 echo "$(get_metadata mux_ip_addr)" > /opt/config/mux_ip_addr.txt
323 echo "$(get_metadata vg_vgmux_tunnel_vni)" > /opt/config/vg_vgmux_tunnel_vni.txt
324 echo "$(get_metadata nexus_artifact_repo)" > /opt/config/nexus_artifact_repo.txt
326 # Download and run install script
327 apt-get -y install unzip
328 INSTALL_SCRIPT_VERSION=$(get_metadata install_script_version)
329 NEXUS_ARTIFACT_REPO=$(get_metadata nexus_artifact_repo)
330 if [[ "${INSTALL_SCRIPT_VERSION}" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
331 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
332 unzip -j /opt/vcpe-scripts-${INSTALL_SCRIPT_VERSION}.zip -d /opt v_gw_install.sh
334 chmod +x v_gw_install.sh
339 #TODO add local disk size
341 virtual_mem_size: 4096 MB
343 vdu_memory_requirements:
344 memoryPageSize: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "2 MB"}'
345 numberOfPages: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "1024"}'
348 cpu_architecture: generic
350 - virtual_storage: VirtualStorage_root_all
352 sw_image: #TODO need to put glance image name here
353 #file: { get_input: vcpe_image_name }
354 file: ../Artifacts/Deployment/OTHER/image
355 type: tosca.artifacts.nfv.SwImage