Statistics
| Branch: | Tag: | Revision:

root / hspace.1 @ 848a9ac5

History | View | Annotate | Download (9.9 kB)

1
.TH HSPACE 1 2009-06-01 htools "Ganeti H-tools"
2
.SH NAME
3
hspace \- Cluster space analyzer for Ganeti
4

    
5
.SH SYNOPSIS
6
.B hspace
7
.B "[backend options...]"
8
.B "[algorithm options...]"
9
.B "[request options..."]
10
.B "[-p]"
11
.B "[-v... | -q]"
12

    
13
.B hspace
14
.B --version
15

    
16
.TP
17
Backend options:
18
.BI "[ -m " cluster " ]"
19
|
20
.BI "[ -L[" path "]]"
21
|
22
.BI "[ -n " nodes-file " ]"
23
.BI "[ -i " instances-file " ]"
24

    
25
.TP
26
Algorithm options:
27
.BI "[ --max-cpu " cpu-ratio " ]"
28
.BI "[ --min-disk " disk-ratio " ]"
29
.BI "[ -O " name... " ]"
30

    
31
.TP
32
Request options:
33
.BI "[--memory " mem "]"
34
.BI "[--disk " disk "]"
35
.BI "[--req-nodes " req-nodes "]"
36

    
37

    
38
.SH DESCRIPTION
39
hspace computes how many additional instances can be fit on a cluster,
40
while maintaining N+1 status.
41

    
42
The program will try to place instances, all of the same size, on the
43
cluster, until the point where we don't have any N+1 possible
44
allocation. It uses the exact same allocation algorithm as the hail
45
iallocator plugin.
46

    
47
The output of the program is designed to interpreted as a shell
48
fragment (or parsed as a \fIkey=value\fR file). Options which extend
49
the output (e.g. -p, -v) will output the additional information on
50
stderr (such that the stdout is still parseable).
51

    
52
The following keys are available in the output of the script (all
53
prefixed with \fIHTS_\fR):
54
.TP
55
.I SPEC_MEM, SPEC_DSK, SPEC_CPU, SPEC_RQN
56
These represent the specifications of the instance model used for
57
allocation (the memory, disk, cpu, requested nodes).
58

    
59
.TP
60
.I CLUSTER_MEM, CLUSTER_DSK, CLUSTER_CPU, CLUSTER_NODES
61
These represent the total memory, disk, CPU count and total nodes in
62
the cluster.
63

    
64
.TP
65
.I INI_SCORE, FIN_SCORE
66
These are the initial (current) and final cluster score (see the hbal
67
man page for details about the scoring algorithm).
68

    
69
.TP
70
.I INI_INST_CNT, FIN_INST_CNT
71
The initial and final instance count.
72

    
73
.TP
74
.I INI_MEM_FREE, FIN_MEM_FREE
75
The initial and final total free memory in the cluster (but this
76
doesn't necessarily mean available for use).
77

    
78
.TP
79
.I INI_MEM_AVAIL, FIN_MEM_AVAIL
80
The initial and final total available memory for allocation in the
81
cluster. If allocating redundant instances, new instances could
82
increase the reserved memory so it doesn't necessarily mean the
83
entirety of this memory can be used for new instance allocations.
84

    
85
.TP
86
.I INI_MEM_RESVD, FIN_MEM_RESVD
87
The initial and final reserved memory (for redundancy/N+1 purposes).
88

    
89
.TP
90
.I INI_MEM_INST, FIN_MEM_INST
91
The initial and final memory used for instances (actual runtime used
92
RAM).
93

    
94
.TP
95
.I INI_MEM_OVERHEAD, FIN_MEM_OVERHEAD
96
The initial and final memory overhead - memory used for the node
97
itself and unacounted memory (e.g. due to hypervisor overhead).
98

    
99
.TP
100
.I INI_MEM_EFF, HTS_INI_MEM_EFF
101
The initial and final memory efficiency, represented as instance
102
memory divided by total memory.
103

    
104
.TP
105
.I INI_DSK_FREE, INI_DSK_AVAIL, INI_DSK_RESVD, INI_DSK_INST, INI_DSK_EFF
106
Initial disk stats, similar to the memory ones.
107

    
108
.TP
109
.I FIN_DSK_FREE, FIN_DSK_AVAIL, FIN_DSK_RESVD, FIN_DSK_INST, FIN_DSK_EFF
110
Final disk stats, similar to the memory ones.
111

    
112
.TP
113
.I INI_CPU_INST, FIN_CPU_INST
114
Initial and final number of virtual CPUs used by instances.
115

    
116
.TP
117
.I INI_CPU_EFF, FIN_CPU_EFF
118
The initial and final CPU efficiency, represented as the count of
119
virtual instance CPUs divided by the total physical CPU count.
120

    
121
.TP
122
.I INI_MNODE_MEM_AVAIL, FIN_MNODE_MEM_AVAIL
123
The initial and final maximum per-node available memory. This is not
124
very useful as a metric but can give an impression of the status of
125
the nodes; as an example, this value restricts the maximum instance
126
size that can be still created on the cluster.
127

    
128
.TP
129
.I INI_MNODE_DSK_AVAIL, FIN_MNODE_DSK_AVAIL
130
Like the above but for disk.
131

    
132
.TP
133
.I ALLOC_USAGE
134
The current usage represented as initial number of instances divided
135
per final number of instances.
136

    
137
.TP
138
.I ALLOC_COUNT
139
The number of instances allocated (delta between FIN_INST_CNT and
140
INI_INST_CNT).
141

    
142
.TP
143
.I ALLOC_FAIL*_CNT
144
For the last attemp at allocations (which would have increased
145
FIN_INST_CNT with one, if it had succeeded), this is the count of the
146
failure reasons per failure type; currently defined are FAILMEM,
147
FAILDISK and FAILCPU which represent errors due to not enough memory,
148
disk and CPUs, and FAILN1 which represents a non N+1 compliant cluster
149
on which we can't allocate instances at all.
150

    
151
.TP
152
.I ALLOC_FAIL_REASON
153
The reason for most of the failures, being one of the above FAIL*
154
strings.
155

    
156
.TP
157
.I OK
158
A marker representing the successful end of the computation, and
159
having value "1". If this key is not present in the output it means
160
that the computation failed and any values present should not be
161
relied upon.
162

    
163
.SH OPTIONS
164
The options that can be passed to the program are as follows:
165

    
166
.TP
167
.BI "--memory " mem
168
The memory size of the instances to be placed (defaults to 4GiB).
169

    
170
.TP
171
.BI "--disk " disk
172
The disk size of the instances to be placed (defaults to 100GiB).
173

    
174
.TP
175
.BI "--req-nodes " num-nodes
176
The number of nodes for the instances; the default of two means
177
mirrored instances, while passing one means plain type instances.
178

    
179
.TP
180
.BI "--max-cpu " cpu-ratio
181
The maximum virtual-to-physical cpu ratio, as a floating point number
182
between zero and one. For example, specifying \fIcpu-ratio\fR as
183
\fB2.5\fR means that, for a 4-cpu machine, a maximum of 10 virtual
184
cpus should be allowed to be in use for primary instances. A value of
185
one doesn't make sense though, as that means no disk space can be used
186
on it.
187

    
188
.TP
189
.BI "--min-disk " disk-ratio
190
The minimum amount of free disk space remaining, as a floating point
191
number. For example, specifying \fIdisk-ratio\fR as \fB0.25\fR means
192
that at least one quarter of disk space should be left free on nodes.
193

    
194
.TP
195
.B -p, --print-nodes
196
Prints the before and after node status, in a format designed to allow
197
the user to understand the node's most important parameters.
198

    
199
The node list will contain these informations:
200
.RS
201
.TP
202
.B F
203
a character denoting the status of the node, with '-' meaning an
204
offline node, '*' meaning N+1 failure and blank meaning a good node
205
.TP
206
.B Name
207
the node name
208
.TP
209
.B t_mem
210
the total node memory
211
.TP
212
.B n_mem
213
the memory used by the node itself
214
.TP
215
.B i_mem
216
the memory used by instances
217
.TP
218
.B x_mem
219
amount memory which seems to be in use but cannot be determined why or
220
by which instance; usually this means that the hypervisor has some
221
overhead or that there are other reporting errors
222
.TP
223
.B f_mem
224
the free node memory
225
.TP
226
.B r_mem
227
the reserved node memory, which is the amount of free memory needed
228
for N+1 compliance
229
.TP
230
.B t_dsk
231
total disk
232
.TP
233
.B f_dsk
234
free disk
235
.TP
236
.B pcpu
237
the number of physical cpus on the node
238
.TP
239
.B vcpu
240
the number of virtual cpus allocated to primary instances
241
.TP
242
.B pri
243
number of primary instances
244
.TP
245
.B sec
246
number of secondary instances
247
.TP
248
.B p_fmem
249
percent of free memory
250
.TP
251
.B p_fdsk
252
percent of free disk
253
.TP
254
.B r_cpu
255
ratio of virtual to physical cpus
256
.RE
257

    
258
.TP
259
.BI "-O " name
260
This option (which can be given multiple times) will mark nodes as
261
being \fIoffline\fR, and instances won't be placed on these nodes.
262

    
263
Note that hspace will also mark as offline any nodes which are
264
reported by RAPI as such, or that have "?" in file-based input in any
265
numeric fields.
266
.RE
267

    
268
.TP
269
.BI "-n" nodefile ", --nodes=" nodefile
270
The name of the file holding node information (if not collecting via
271
RAPI), instead of the default \fInodes\fR file (but see below how to
272
customize the default value via the environment).
273

    
274
.TP
275
.BI "-i" instancefile ", --instances=" instancefile
276
The name of the file holding instance information (if not collecting
277
via RAPI), instead of the default \fIinstances\fR file (but see below
278
how to customize the default value via the environment).
279

    
280
.TP
281
.BI "-m" cluster
282
Collect data not from files but directly from the
283
.I cluster
284
given as an argument via RAPI. If the argument doesn't contain a colon
285
(:), then it is converted into a fully-built URL via prepending
286
https:// and appending the default RAPI port, otherwise it's
287
considered a fully-specified URL and is used as-is.
288

    
289
.TP
290
.BI "-L[" path "]"
291
Collect data not from files but directly from the master daemon, which
292
is to be contacted via the luxi (an internal Ganeti protocol). An
293
optional \fIpath\fR argument is interpreted as the path to the unix
294
socket on which the master daemon listens; otherwise, the default path
295
used by ganeti when installed with "--localstatedir=/var" is used.
296

    
297
.TP
298
.B -v, --verbose
299
Increase the output verbosity. Each usage of this option will increase
300
the verbosity (currently more than 2 doesn't make sense) from the
301
default of one. At verbosity 2 the location of the new instances is
302
shown in the standard error.
303

    
304
.TP
305
.B -q, --quiet
306
Decrease the output verbosity. Each usage of this option will decrease
307
the verbosity (less than zero doesn't make sense) from the default of
308
one.
309

    
310
.TP
311
.B -V, --version
312
Just show the program version and exit.
313

    
314
.SH EXIT STATUS
315

    
316
The exist status of the command will be zero, unless for some reason
317
the algorithm fatally failed (e.g. wrong node or instance data).
318

    
319
.SH BUGS
320

    
321
The algorithm is highly dependent on the number of nodes; its runtime
322
grows exponentially with this number, and as such is impractical for
323
really big clusters.
324

    
325
The algorithm doesn't rebalance the cluster or try to get the optimal
326
fit; it just allocates in the best place for the current step, without
327
taking into consideration the impact on future placements.
328

    
329
.SH ENVIRONMENT
330

    
331
If the variables \fBHTOOLS_NODES\fR and \fBHTOOLS_INSTANCES\fR are
332
present in the environment, they will override the default names for
333
the nodes and instances files. These will have of course no effect
334
when RAPI is used.
335

    
336
.SH SEE ALSO
337
.BR hbal "(1), " hscan "(1), " ganeti "(7), " gnt-instance "(8), "
338
.BR gnt-node "(8)"
339

    
340
.SH "COPYRIGHT"
341
.PP
342
Copyright (C) 2009 Google Inc. Permission is granted to copy,
343
distribute and/or modify under the terms of the GNU General Public
344
License as published by the Free Software Foundation; either version 2
345
of the License, or (at your option) any later version.
346
.PP
347
On Debian systems, the complete text of the GNU General Public License
348
can be found in /usr/share/common-licenses/GPL.