Add Robot Tests for VNF Package Management
[integration/csit.git] / tests / so / etsi / data / responses / expectedVnfd / MainServiceTemplate.yaml
1 tosca_definitions_version: tosca_simple_yaml_1_0
2 metadata:
3   template_name: vCPE_vgw
4   template_version: "1.0"
5   template_author: onap
6   VNFD_SCHEMA_VERSION: "2.5.1+1"
7   descriptor_id: b1bb0ce7-2222-4fa7-95ed-4840d70a1177
8 description: vCPE_vgw
9
10 imports:
11   - onap_dm.yaml
12
13 topology_template:
14   #substitution_mappings:
15   #  node_type: onap.vcpe_vgw
16   #  requirements:
17   #    virtual_link: [ Cp_vgw_public, virtual_link ] # expose as external CP
18   #    virtual_link: [ Cp_vgw_onap_private, virtual_link ] # expose as external CP
19
20   inputs:
21     vcpe_image_name:
22       type: string
23       description: image name for vcpe in openstack glance
24       default: ubuntu_16.04
25     public_net_id:
26       type: string
27       description: public network id used during onap installation
28       default: external
29     onap_private_net_id:
30       type: string
31       description: onap OAM network id
32       default: oam_onap
33     onap_private_net_cidr:
34       type: string
35       description: oanp OAM network cidr
36       default: 10.0.0.0/16
37     mux_gw_private_net_id:
38       type: string
39       description: Private network that connects vGMUX to vGWs
40       default: zdfw1muxgw01_private
41     mux_gw_private_net_cidr:
42       type: string
43       description: he CIDR of the vGMUX private network
44       default: 10.5.0.0/24
45     cpe_public_net_id:
46       type: string
47       description: cpe public net name
48       default: zdfw1cpe01_public
49     cpe_public_net_cidr:
50       type: string
51       description: cpe public net cidr
52       default: 10.2.0.0/24
53     vgw_private_ip_0:
54       type: string
55       description: Private IP address that is assigned to the vGW to communicate with vGMUX
56       default: 10.5.0.21
57     vgw_private_ip_1:
58       type: string
59       description: Private IP address that is assigned to the vGW to communicate with ONAP components
60       default: 10.0.101.30
61     vgw_private_ip_2:
62       type: string
63       description: Private IP address that is assigned to the vGW to communicate with vCPE public network
64       default: 10.2.0.3
65     vgw_name_0:
66       type: string
67       description: Name of the vGW
68       default: zdcpe1cpe01gw01
69     dcae_collector_ip:
70       type: string
71       description: dcae collector ip
72       default: 10.0.4.102
73     dcae_collector_port:
74       type: string
75       description: dcae collector port
76       default: "8080"
77     pub_key:
78       type: string
79       description: ssh public key
80       default: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGx6SKrAuCz1V8KGevZueksLdWoPWJP6z3r29Z7TmPVEOjM+7PIPeSs2BVRx3rnHZBAlasMrZ+fJBS25ts9vfC+ItezQah/hr9vrkmwxCR54Lb84poW+sToPeF6i5eZY7W+jWJfLaFSFx9d2vp4zes/fOlT3NvYCXbn/3QdryQoGl7VFI8oemZypVcikZXElJeeKgAVdSwnrzuqtO/tmbXcAeSbYvVjki8ywYcsWMVMYWUWhh+1BAB6kXnTsIWqzrq0Pfvy+81WDwtiqsqmd93HY8hE0scBrXFBZzQS/AYfIFBlEuFNdLczchntjbZ0n7dmDXk8zHtCZYNk7kwb8k/
81     nexus_artifact_repo:
82       type: string
83       description: Root URL for the Nexus repository for Maven artifacts
84       default: https://nexus.onap.org
85     demo_artifacts_version:
86       type: string
87       description: artifacts version used in demo vnfs
88       default: 1.2.0
89     install_script_version:
90       type: string
91       description: install script version number
92       default: 1.2.0-SNAPSHOT
93     cloud_env:
94       type: string
95       description: cloud environment(openstack or rackspace)
96       default: openstack
97     mux_ip_addr:
98       type: string
99       description: IP address of vGMUX
100       default: 10.5.0.20
101     vg_vgmux_tunnel_vni:
102       type: string
103       description: vni value of vG-vGMUX vxlan tunnel
104       default: "100"
105     vnf_id:
106       type: string
107       description: The VNF ID is provided by ONAP
108       default: vCPE_Infrastructure_GW_demo_app
109     vf_module_id:
110       type: string
111       description: The vCPE Module ID is provided by ONAP
112       default: vCPE_Customer_GW
113
114   node_templates:
115     LLU_VNF:
116       type: tosca.nodes.nfv.VNF
117       properties:
118         descriptor_id: b1bb0ce7-2222-4fa7-95ed-4840d70a1177
119         provider: onap
120         product_name: vcpe_vgw
121         software_version: '1.0'
122         descriptor_version: '1.0'
123         flavour_id: simple
124         flavour_description: simple
125         vnfm_info: ['gvnfm']
126
127     #onap public net
128 #    VL_public:
129 #      type: tosca.nodes.nfv.VnfVirtualLink
130 #      properties:
131 #        connectivity_type:
132 #          layer_protocols: [ipv4]
133 #        vl_profile:
134 #          max_bitrate_requirements:
135 #            root: 10000000
136 #            leaf: 10000000
137 #          min_bitrate_requirements:
138 #            root: 10000000
139 #            leaf: 10000000
140 #          virtual_link_protocol_data:
141 #            - associated_layer_protocol: ipv4
142 #              l3_protocol_data:
143 #                ip_version: ipv4
144 #                name: { get_input: public_net_id }
145 #
146 #    #onap oam net
147 #    VL_onap_private:
148 #      type: tosca.nodes.nfv.VnfVirtualLink
149 #      properties:
150 #        connectivity_type:
151 #          layer_protocols: [ipv4]
152 #        vl_profile:
153 #          max_bitrate_requirements:
154 #            root: 10000000
155 #            leaf: 10000000
156 #          min_bitrate_requirements:
157 #            root: 10000000
158 #            leaf: 10000000
159 #          virtual_link_protocol_data:
160 #            - associated_layer_protocol: ipv4
161 #              l3_protocol_data:
162 #                ip_version: ipv4
163 #                name: { get_input: onap_private_net_id }
164 #                cidr: { get_input: onap_private_net_cidr }
165
166     #Private network that connects vGMUX to vGWs
167     VL_mux_gw_private_net:
168       type: tosca.nodes.nfv.VnfVirtualLink
169       properties:
170         connectivity_type:
171           layer_protocols: [ipv4]
172         vl_profile:
173           max_bitrate_requirements:
174             root: 10000000
175             leaf: 10000000
176           min_bitrate_requirements:
177             root: 10000000
178             leaf: 10000000
179           virtual_link_protocol_data:
180             - associated_layer_protocol: ipv4
181               l3_protocol_data:
182                 name: { get_input: mux_gw_private_net_id }
183                 ip_version: ipv4
184                 cidr: { get_input: mux_gw_private_net_cidr }
185                 dhcp_enabled: false
186
187     #cpe public network
188     VL_cpe_public:
189       type: tosca.nodes.nfv.VnfVirtualLink
190       properties:
191         connectivity_type:
192           layer_protocols: [ipv4]
193         vl_profile:
194           max_bitrate_requirements:
195             root: 10000000
196             leaf: 10000000
197           min_bitrate_requirements:
198             root: 10000000
199             leaf: 10000000
200           virtual_link_protocol_data:
201             - associated_layer_protocol: ipv4
202               l3_protocol_data:
203                 name: { get_input: cpe_public_net_id }
204                 ip_version: ipv4
205                 cidr: { get_input: cpe_public_net_cidr }
206                 dhcp_enabled: false
207
208     # vgw related
209     Cp_vgw_public:
210       type: tosca.nodes.nfv.VduCp
211       properties:
212         layer_protocols: [ipv4]
213         trunk_mode: false
214         protocol:
215           - associated_layer_protocol: ipv4
216             address_data:
217               - address_type: ip_address
218                 l3_address_data:
219                   ip_address_assignment: false
220                   floating_ip_activated: false
221       requirements:
222         - virtual_binding: VDU_vgw_0
223         #- virtual_link: VL_public
224
225     Cp_vgw_onap_private:
226       type: tosca.nodes.nfv.VduCp
227       properties:
228         layer_protocols: [ipv4]
229         trunk_mode: false
230         protocol:
231           - associated_layer_protocol: ipv4
232             address_data:
233               - address_type: ip_address
234                 l3_address_data:
235                   ip_address_assignment: false
236                   floating_ip_activated: false
237                   fixed_ip_address:
238                     - { get_input: vgw_private_ip_1 }
239       requirements:
240         - virtual_binding: VDU_vgw_0
241         #- virtual_link: VL_onap_private
242
243     Cp_vgw_mux_gw_private_net:
244       type: tosca.nodes.nfv.VduCp
245       properties:
246         layer_protocols: [ipv4]
247         trunk_mode: false
248         protocol:
249           - associated_layer_protocol: ipv4
250             address_data:
251               - address_type: ip_address
252                 l3_address_data:
253                   ip_address_assignment: false
254                   floating_ip_activated: false
255                   fixed_ip_address:
256                     - { get_input: vgw_private_ip_0 }
257         virtual_network_interface_requirements:
258           - name: dpdk support
259             support_mandatory: true
260             network_interface_requirements:
261               dataProcessingAccelerationLibrary: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "DPDK"}'
262       requirements:
263         - virtual_binding: VDU_vgw_0
264         - virtual_link: VL_mux_gw_private_net
265
266     Cp_vgw_cpe_public:
267       type: tosca.nodes.nfv.VduCp
268       properties:
269         layer_protocols: [ipv4]
270         trunk_mode: false
271         protocol:
272           - associated_layer_protocol: ipv4
273             address_data:
274               - address_type: ip_address
275                 l3_address_data:
276                   ip_address_assignment: false
277                   floating_ip_activated: false
278                   fixed_ip_address:
279                     - { get_input: vgw_private_ip_2 }
280       requirements:
281         - virtual_binding: VDU_vgw_0
282         - virtual_link: VL_cpe_public
283
284     VDU_vgw_0:
285       type: tosca.nodes.nfv.Vdu.Compute
286       properties:
287         name: { get_input: vgw_name_0 }
288         description: vgw
289         vdu_profile:
290           min_number_of_instances: 1
291           max_number_of_instances: 1
292           watchdog: none
293         inject_files: # TODO SDC BUG
294           source_path: ../Artifacts/Deployment/OTHER/authorized_keys #SSH authorized_keys
295           dest_path: /home/ubuntu/.ssh/authorized_keys
296         meta_data:
297           vnf_id: { get_input: vnf_id }
298           vf_module_id: { get_input: vf_module_id }
299           mux_gw_private_net_ipaddr: { get_input: vgw_private_ip_0 }
300           oam_ipaddr: { get_input: vgw_private_ip_1 }
301           oam_cidr: { get_input: onap_private_net_cidr }
302           cpe_public_net_cidr: { get_input: cpe_public_net_cidr }
303           mux_gw_private_net_cidr: { get_input: mux_gw_private_net_cidr }
304           mux_ip_addr: { get_input: mux_ip_addr }
305           vg_vgmux_tunnel_vni: { get_input: vg_vgmux_tunnel_vni }
306           install_script_version: { get_input: install_script_version }
307           cloud_env: { get_input: cloud_env }
308           nexus_artifact_repo: { get_input: nexus_artifact_repo }
309         boot_data: |
310           #!/bin/bash
311           METADATA=`curl -s http://169.254.169.254/openstack/2012-08-10/meta_data.json`
312           apt-get -y install jq
313
314           get_metadata () {
315             echo $METADATA | jq -r ".meta.$1"
316           }
317
318           # Create configuration files
319           mkdir /opt/config
320           echo "$(get_metadata oam_ipaddr)" > /opt/config/oam_ipaddr.txt
321           echo "$(get_metadata oam_cidr)" > /opt/config/oam_cidr.txt
322           echo "$(get_metadata cpe_public_net_cidr)" > /opt/config/cpe_public_net_cidr.txt
323           echo "$(get_metadata mux_gw_private_net_ipaddr)" > /opt/config/mux_gw_private_net_ipaddr.txt
324           echo "$(get_metadata mux_gw_private_net_cidr)" > /opt/config/mux_gw_private_net_cidr.txt
325           echo "$(get_metadata install_script_version)" > /opt/config/install_script_version.txt
326           echo "$(get_metadata cloud_env)" > /opt/config/cloud_env.txt
327           echo "$(get_metadata mux_ip_addr)" > /opt/config/mux_ip_addr.txt
328           echo "$(get_metadata vg_vgmux_tunnel_vni)" > /opt/config/vg_vgmux_tunnel_vni.txt
329           echo "$(get_metadata nexus_artifact_repo)" > /opt/config/nexus_artifact_repo.txt
330
331           # Download and run install script
332           apt-get -y install unzip
333           INSTALL_SCRIPT_VERSION=$(get_metadata install_script_version)
334           NEXUS_ARTIFACT_REPO=$(get_metadata nexus_artifact_repo)
335           if [[ "${INSTALL_SCRIPT_VERSION}" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
336           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
337           unzip -j /opt/vcpe-scripts-${INSTALL_SCRIPT_VERSION}.zip -d /opt v_gw_install.sh
338           cd /opt
339           chmod +x v_gw_install.sh
340           ./v_gw_install.sh
341       capabilities:
342         virtual_compute:
343           properties:
344             virtual_memory:
345               virtual_mem_size: 4096 MB
346               vdu_mem_requirements:
347                 memoryPageSize: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "2 MB"}'
348                 numberOfPages: '{"schemaVersion": "0","schemaSelector": "","hardwarePlatform": "generic","mandatory": "true", "configurationValue": "1024"}'
349             virtual_cpu:
350               num_virtual_cpu: 2
351               cpu_architecture: generic
352             virtual_local_storage:
353               - size_of_storage: 40 GB
354       artifacts:
355         sw_image: #TODO need to put glance image name here
356           #file: { get_input: vcpe_image_name }
357           file: ../Artifacts/Deployment/OTHER/image
358           type: tosca.artifacts.nfv.SwImage