Fixed documentation for ApexLake
[yardstick.git] / yardstick / vTC / apexlake / heat_templates / stress_workload.yaml
1 heat_template_version: 2014-10-16
2 description: HOT template to create a DPI
3
4 parameters:
5    name:
6       type: string
7       default: cpu_stress
8    cores:
9        type: string
10    memory:
11        type: string
12
13 resources:
14    internal_net:
15       type: OS::Neutron::Net
16       properties:
17          name: traffic_network
18    internal_subnet:
19       type: OS::Neutron::Subnet
20       properties:
21          network_id: { get_resource: internal_net }
22          cidr: 10.100.0.0/24
23
24    port:
25       type: OS::Neutron::Port
26       properties:
27          network: { get_resource: internal_net }
28          fixed_ips:
29             - subnet: { get_resource: internal_subnet }
30
31    vm1:
32       type: OS::Nova::Server
33       properties:
34          name: traffic_vm1
35          image: ubuntu1404
36          user_data:
37             str_replace:
38                template: |
39                   #!/bin/sh
40                   echo "Creating custom user..."
41                   useradd clouduser -g admin -s /bin/bash -m
42                   echo clouduser:secrete | chpasswd
43                   echo "Enabling ssh password login..."
44                   sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
45                   service ssh restart
46                   sleep 1
47
48                   ifconfig eth1 up
49                   dhclient eth1
50
51                   sed -i 's/localhost/localhost traffic_vm1/g' /etc/hosts
52                   touch /etc/resolfconf/resolv.conf.d/tail
53                   echo 'nameserver 8.8.8.8' > /etc/resolvconf/resolv.conf.d/tail
54                   resolvconf -u
55
56                   # Installation of stress
57                   apt-get install -y stress
58
59                   cd /home/clouduser
60                   # Setup merlin
61                   rm -rf merlin
62                   mkdir merlin
63                   cd merlin
64                   wget http://10.2.1.65/~iolie/merlin/MerlinAgent-12-06-2015-TNovaVM-001.zip
65                   apt-get install -y zip
66                   unzip MerlinAgent-12-06-2015-TNovaVM-001.zip
67                   ./updateConfiguration.py ./instrumentation.cfg tags source=tnova_vm
68                   ./updateConfiguration.py ./instrumentation.cfg tags role=cpu_stress
69                   nohup ./Agent.py ./instrumentation.cfg >log.out 2>&1 &
70                   cd ..
71
72                   # workload setup
73                   nohup stress -c #CORES --vm-bytes #MEMORY
74
75                params:
76                   $NAME: { get_param: name }
77                   $CORES: { get_param: cores }
78                   $MEMORY: { get_param: memory }
79
80          flavor: m1.small
81          networks:
82             - port: { get_resource: port }