forked from gluster/gluster-performance-test-suite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
perftest.yml
181 lines (161 loc) · 4.57 KB
/
perftest.yml
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
---
- name: Setup passwordless ssh from control machine to cluster
hosts: control
remote_user: root
roles:
- setup-control-machine-connectivity-to-cluster
- name: Unmount glusterfs from clients
hosts: cluster_clients
remote_user: root
tasks:
- mount:
path: /gluster-mount
state: unmounted
- name: Check if gluster is installed
hosts: cluster_servers
remote_user: root
tasks:
- shell: command -v gluster >/dev/null 2>&1
register: is_gluster_present
ignore_errors: yes
- debug: msg="{{ is_gluster_present.rc }}"
- name: Cleanup delete gluster volume and lv
remote_user: root
hosts: cluster_servers
vars_files:
- "{{ cleanup_vars }}"
pre_tasks:
- name: Delete Gluster volume(s)
gluster_volume:
state: absent
name: "{{ item }}"
ignore_errors: yes
with_items: "{{ gluster_volumes }}"
run_once: true
when: is_gluster_present.rc|int == 0
roles:
- { role: gluster.infra, when: is_gluster_present.rc|int == 0 }
- name: Common setup on gluster machines
hosts: cluster_machines
remote_user: root
roles:
- common-setup
- name: Remove gluster and its repositories
hosts: cluster_machines
remote_user: root
roles:
- remove-gluster-and-its-repositories
- name: Setup upstream repository
hosts: cluster_machines
remote_user: root
roles:
- { role: setup-upstream-repo, when: build == "upstream" }
- name: Subscribe to RHSM
hosts: cluster_machines
remote_user: root
gather_facts: no
vars_files:
- "{{ rhsm_vars }}"
roles:
- { role: gluster.repos, when: use_rhsm_repository|int == 1 }
- name: Setup custom build repository
hosts: cluster_machines
remote_user: root
roles:
- { role: setup-custom-build-repo, when: build == "custom" }
- name: Install and start gluster
hosts: cluster_servers
remote_user: root
roles:
- install-and-start-gluster
- name: Client specific setup on gluster machines
hosts: cluster_clients
remote_user: root
roles:
- gluster-client-setup
- name: Setting up backend and creating a volume
remote_user: root
hosts: cluster_servers
vars_files:
- "{{ backend_variables }}"
vars:
# Firewall setup
gluster_infra_fw_ports:
- 2049/tcp
- 54321/tcp
- 5900/tcp
- 5900-6923/tcp
- 5666/tcp
- 16514/tcp
gluster_infra_fw_services:
- glusterfs
- samba
gluster_cluster_hosts: "{{ groups['cluster_servers'] }}"
gluster_cluster_status: absent
gluster_cluster_transport: 'tcp'
gluster_cluster_force: 'yes'
gluster_cluster_options:
diagnostics.count-fop-hits: 'on'
diagnostics.latency-measurement: 'on'
network.inode-lru-limit: '200000'
performance.md-cache-timeout: '600'
performance.cache-invalidation: 'on'
performance.stat-prefetch: 'on'
features.cache-invalidation-timeout: '600'
features.cache-invalidation: 'on'
nfs.disable: 'off'
pre_tasks:
- name: setting appropriate gluster options for smallfile
set_fact:
gluster_cluster_options: "{{ gluster_cluster_options | combine({'server.event-threads': '4', 'client.event-threads': '4', 'cluster.lookup-optimize': 'on'})}}"
when: tool == "smallfile"
roles:
- gluster.infra
- gluster.cluster
- name: Mount gluster volume on all the clients
hosts: cluster_clients
remote_user: root
gather_facts: true
tasks:
- mount:
path: /gluster-mount
src: "{{ should_mount_from }}:/testvol"
fstype: glusterfs
state: mounted
- name: Install performance benchmarking tools
hosts: cluster_clients
remote_user: root
roles:
- { role: install-perf-benchmarking-tools, when: benchmarking_tools|int == 1 }
- name: Execute perf test and get results
hosts: master_client
remote_user: root
environment:
CLIENT: "{{groups['cluster_clients']}}"
roles:
- execute-perf-and-get-results
- name: Fetch pcplogs from all the machines
hosts: cluster_machines
remote_user: root
tasks:
- name: Find pcplogs
find :
paths: /var/log/pcp/pmlogger/
recurse: yes
register: files_to_copy
- name: Get pcplogs
fetch:
src: "{{ item.path }}"
dest: "{{ download_results_at_location }}/results/pcplogs"
with_items: "{{ files_to_copy.files }}"
ignore_errors: yes
- name: delete the ssh key if specifically asked
hosts: control_machine
tasks:
- file:
path: "{{ item }}"
state: absent
with_items:
- ~/.ssh/id_rsa
- ~/.ssh/id_rsa.pub
when: delete_key is defined