blob: 1a2f7dbb31390e109a2595857d205d832d76e29c (
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
heat_template_version: 2014-10-16
description: HOT template to create a DPI
parameters:
nic_type:
type: string
default: normal
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
router:
properties:
admin_state_up: true
name: router
type: OS::Neutron::Router
router_gateway:
properties:
network: external
router_id: { get_resource: router }
type: OS::Neutron::RouterGateway
router_interface_0:
properties:
router_id: { get_resource: router }
subnet_id: { get_resource: internal_subnet }
type: OS::Neutron::RouterInterface
vm1_port_1:
type: OS::Neutron::Port
properties:
network: { get_resource: internal_net }
binding:vnic_type: { get_param: nic_type }
fixed_ips:
- subnet: { get_resource: internal_subnet }
flavor_1:
type: OS::Nova::Flavor
properties:
disk: 20
ram: 4096
vcpus: 4
vm1:
type: OS::Nova::Server
properties:
name: traffic_vm1
key_name: test
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: { get_resource: flavor_1 }
networks:
- port: { get_resource: vm1_port_1 }
|