aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/vTC/apexlake/heat_templates/stress_workload.yaml
blob: 85477fe85d5dec283badb2b36c9165a1fc09bb8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
heat_template_version: 2014-10-16
description: HOT template to create a DPI

parameters:
   name:
      type: string
      default: cpu_stress
   cores:
       type: string
   memory:
       type: string

resources:
   internal_net:
      type: OS::Neutron::Net
      properties:
         name: traffic_network
   internal_subnet:
      type: OS::Neutron::Subnet
      properties:
         network_id: { get_resource: internal_net }
         cidr: 10.100.0.0/24

   port:
      type: OS::Neutron::Port
      properties:
         network: { get_resource: internal_net }
         fixed_ips:
            - subnet: { get_resource: internal_subnet }

   vm1:
      type: OS::Nova::Server
      properties:
         name: traffic_vm1
         image: ubuntu1404
         user_data:
            str_replace:
               template: |
                  #!/bin/sh
                  echo "Creating custom user..."
                  useradd clouduser -g admin -s /bin/bash -m
                  echo clouduser:secrete | chpasswd
                  echo "Enabling ssh password login..."
                  sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
                  service ssh restart
                  sleep 1

                  ifconfig eth1 up
                  dhclient eth1

                  sed -i 's/localhost/localhost traffic_vm1/g' /etc/hosts
                  touch /etc/resolfconf/resolv.conf.d/tail
                  echo 'nameserver 8.8.8.8' > /etc/resolvconf/resolv.conf.d/tail
                  resolvconf -u

                  # Installation of stress
                  apt-get install -y stress

                  cd /home/clouduser
                  # Setup merlin
                  rm -rf merlin
                  mkdir merlin
                  cd merlin
                  wget http://10.2.1.65/~iolie/merlin/MerlinAgent-12-06-2015-TNovaVM-001.zip
                  apt-get install -y zip
                  unzip MerlinAgent-12-06-2015-TNovaVM-001.zip
                  ./updateConfiguration.py ./instrumentation.cfg tags source=tnova_vm
                  ./updateConfiguration.py ./instrumentation.cfg tags role=cpu_stress
                  nohup ./Agent.py ./instrumentation.cfg >log.out 2>&1 &
                  cd ..

                  # workload setup
                  nohup stress -c #CORES --vm-bytes #MEMORY

               params:
                  $NAME: { get_param: name }
                  $CORES: { get_param: cores }
                  $MEMORY: { get_param: memory }

         flavor: m1.small
         networks:
            - port: { get_resource: port }