Merge "bug fix no curl in yardstick docker"
[yardstick.git] / tools / dpdk_install.yml
1 heat_template_version: 2015-04-30
2
3 description: >
4   Used to run VMs with DPDK pktgen
5
6 parameters:
7   image:
8     type: string
9     description: Name of the image
10     default: yardstick-wily-server
11
12   timeout:
13     type: number
14     description: Timeout in seconds for WaitCondition, depends on your image and environment
15     default: 900
16
17   external_net_name:
18     type: string
19     description: Name of the external network which management network will connect to
20     default: admin_floating_net
21
22 resources:
23   flavor:
24     type: OS::Nova::Flavor
25     properties:
26       ram: 4096
27       vcpus: 4
28       disk: 4
29
30   network:
31     type: OS::Neutron::Net
32     properties:
33       name: dpdk_net
34
35   subnet:
36     type: OS::Neutron::Subnet
37     properties:
38       name: dpdk_subnet
39       ip_version: 4
40       cidr: 192.168.0.0/24
41       network: { get_resource: network }
42
43   management_router:
44     type: OS::Neutron::Router
45     properties:
46       name: management_router
47       external_gateway_info:
48         network: { get_param: external_net_name }
49
50   management_router_interface:
51     type: OS::Neutron::RouterInterface
52     properties:
53       router: { get_resource: management_router }
54       subnet: { get_resource: subnet }
55
56   floating_ip:
57     type: OS::Neutron::FloatingIP
58     properties:
59       floating_network: { get_param: external_net_name }
60
61   floating_ip_association:
62     type: OS::Nova::FloatingIPAssociation
63     properties:
64       floating_ip: { get_resource: floating_ip }
65       server_id: {get_resource: dpdk_vm}
66
67   keypair:
68     type: OS::Nova::KeyPair
69     properties:
70       name: yardstick-key
71       public_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD0RkXfW6pksd1cZmXuvXZF/Mlqqq3ahIGcGoULOC97XMpu0vdxMpcUwdjwGqMwEXTVyfHidu0l99bLqOCpSUKCmbWx3ONJ+1kqFx4HwsKEWLiyDYqsuMrDeZT1eFjC5avCoTcrIw2wq5NaBb00lDGagNZOeopaL5YIa4+PizEY23+cir24D67NU21Fg3JE92AIeGlNa4j66L3a+lL0hZq74Dilmp42wm4GsbplRO6KJfyaraowHb1X+TmhCjBgHk6M/OJ9yPAroZyJNcwjMAuuxhAYWRuT3SdbnoUR0RG2VhfDh0qNid7vOqLbhKPeaLLFmzkN+9w3WdCp6LbSYt87 yardstick@yardstick.opnfv.org
72
73   wait_handle:
74     type: OS::Heat::WaitConditionHandle
75
76   wait_condition:
77     type: OS::Heat::WaitCondition
78     properties:
79       handle: { get_resource: wait_handle }
80       count: 1
81       timeout: { get_param: timeout }
82
83   dpdk_vm:
84     type: OS::Nova::Server
85     depends_on: [subnet, keypair, flavor]
86     properties:
87       name: { get_param: "OS::stack_name" }
88       image: { get_param: image }
89       flavor: { get_resource: flavor }
90       key_name: {get_resource: keypair}
91       networks:
92         - network: { get_resource: network }
93       config_drive: True
94       user_data_format : RAW
95       user_data:
96         str_replace:
97           template: |
98             #!/bin/sh
99             cat <<'CEOF' > /tmp/dpdk_post_build.sh
100             export RTE_SDK=/dpdk
101             export RTE_TARGET=x86_64-native-linuxapp-gcc
102             cd /dpdk
103             make install T=x86_64-native-linuxapp-gcc DESTDIR=destdir
104             modprobe uio
105             insmod /dpdk/x86_64-native-linuxapp-gcc/kmod/igb_uio.ko
106             insmod /dpdk/x86_64-native-linuxapp-gcc/kmod/rte_kni.ko
107             cd /pktgen-dpdk
108             make RTE_SDK=/dpdk
109             echo "PCKTGEN BUILT"
110             rm -rf /var/lib/cloud/instances
111             echo "rm succesfull"
112             ls /dpdk/x86_64-native-linuxapp-gcc/kmod/
113             $NOTIFY --data-binary '{"status": "SUCCESS"}'
114             CEOF
115             chmod +x /tmp/dpdk_post_build.sh
116             echo "chmod"
117             nohup /tmp/dpdk_post_build.sh &
118           params:
119             $NOTIFY: { get_attr: ['wait_handle', 'curl_cli'] }
120
121 outputs:
122   vm_uuid:
123     description: uuid of the VM
124     value: { get_attr: [ dpdk_vm, show,id ] }