Merge branch 'v2.0'
[osm/SO.git] / common / python / rift / mano / tosca_translator / test / data / tosca_ping_pong_epa / Definitions / ping_vnfd.yaml
1 tosca_definitions_version: tosca_simple_profile_for_nfv_1_0
2 description: This is an example RIFT.ware VNF
3 metadata:
4   ID: ping_vnfd
5   vendor: RIFT.io
6   version: 1.0
7 imports:
8 - riftiotypes.yaml
9 node_types:
10   tosca.nodes.nfv.riftio.pingvnfdVNF:
11     derived_from: tosca.nodes.nfv.riftio.VNF1
12     requirements:
13     - virtualLink1:
14         type: tosca.nodes.nfv.VL
15 topology_template:
16   policies:
17   - configuration:
18       properties:
19         config:
20           config_delay: 0
21           config_details:
22             script_type: bash
23           config_priority: 2
24           config_template: "\n#!/bin/bash\n\n# Rest API config\nping_mgmt_ip=<rw_mgmt_ip>\n\
25             ping_mgmt_port=18888\n\n# VNF specific configuration\npong_server_ip=<rw_connection_point_name\
26             \ pong_vnfd/cp0>\nping_rate=5\nserver_port=5555\n\n# Make rest API calls\
27             \ to configure VNF\ncurl -D /dev/null \\\n    -H \"Accept: application/vnd.yang.data+xml\"\
28             \ \\\n    -H \"Content-Type: application/vnd.yang.data+json\" \\\n   \
29             \ -X POST \\\n    -d \"{\\\"ip\\\":\\\"$pong_server_ip\\\", \\\"port\\\
30             \":$server_port}\" \\\n    http://${ping_mgmt_ip}:${ping_mgmt_port}/api/v1/ping/server\n\
31             rc=$?\nif [ $rc -ne 0 ]\nthen\n    echo \"Failed to set server info for\
32             \ ping!\"\n    exit $rc\nfi\nexit 0\n"
33           config_type: script
34         initial_config_primitive:
35         - name: set ping rate
36           parameter:
37           - rate: 5
38           seq: 1
39           user_defined_script: ping_set_rate.py
40       targets: [ping_vnfd_iovdu_0]
41       type: tosca.policies.nfv.riftio.vnf_configuration
42   substitution_mappings:
43     node_type: tosca.nodes.nfv.riftio.pingvnfdVNF
44     requirements:
45     - virtualLink1: [ping_vnfd_cp0, virtualLink]
46   node_templates:
47     ping_vnfd_iovdu_0:
48       type: tosca.nodes.nfv.riftio.VDU1
49       properties:
50         cloud_init: "#cloud-config\npassword: fedora\nchpasswd: { expire: False }\n\
51           ssh_pwauth: True\nruncmd:\n  - [ systemctl, daemon-reload ]\n  - [ systemctl,\
52           \ enable, ping.service ]\n  - [ systemctl, start, --no-block, ping.service\
53           \ ]\n  - [ ifup, eth1 ]\n"
54         count: 1
55       capabilities:
56         hypervisor_epa:
57           properties:
58             type: PREFER_KVM
59             version: 1
60         mgmt_interface:
61           properties:
62             dashboard_params:
63               path: api/v1/ping/stats
64               port: 18888
65             port: 18888
66             protocol: tcp
67         monitoring_param:
68           properties:
69             description: no of ping requests
70             json_query_method: namekey
71             name: ping-request-tx-count
72             ui_data:
73               group_tag: Group1
74               units: packets
75               widget_type: counter
76             url_path: api/v1/ping/stats
77         monitoring_param_1:
78           properties:
79             description: no of ping responses
80             json_query_method: namekey
81             name: ping-response-rx-count
82             ui_data:
83               group_tag: Group1
84               units: packets
85               widget_type: counter
86             url_path: api/v1/ping/stats
87         nfv_compute:
88           properties:
89             cpu_allocation:
90               cpu_affinity: dedicated
91               thread_allocation: prefer
92             disk_size: 4 GB
93             mem_page_size: normal
94             mem_size: 1024 MB
95             num_cpus: 4
96         numa_extension:
97           properties:
98             mem_policy: STRICT
99             node:
100             - id: 0
101               mem_size: 512 MB
102               vcpus:
103               - 0
104               - 1
105             - id: 1
106               mem_size: 512 MB
107               vcpus:
108               - 2
109               - 3
110             node_cnt: 2
111         vswitch_epa:
112           properties:
113             ovs_acceleration: DISABLED
114             ovs_offload: DISABLED
115       artifacts:
116         ping_vnfd_iovdu_0_vm_image:
117           file: ../images/Fedora-x86_64-20-20131211.1-sda-ping.qcow2
118           image_checksum: a6ffaa77f949a9e4ebb082c6147187cf
119           type: tosca.artifacts.Deployment.Image.riftio.QCOW2
120       interfaces:
121         Standard:
122           create: ping_vnfd_iovdu_0_vm_image
123     ping_vnfd_cp0:
124       type: tosca.nodes.nfv.riftio.CP1
125       properties:
126         cp_type: VPORT
127         name: ping_vnfd/cp0
128         vdu_intf_name: eth0
129         vdu_intf_type: VIRTIO
130       requirements:
131       - virtualBinding:
132           node: ping_vnfd_iovdu_0