Read cluster tags in the LUXI backend
[ganeti-local] / hspace.1
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 .BI "[ -p[" fields "] ]"
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 .BI " --simulate " spec
26
27 .TP
28 Algorithm options:
29 .BI "[ --max-cpu " cpu-ratio " ]"
30 .BI "[ --min-disk " disk-ratio " ]"
31 .BI "[ -O " name... " ]"
32
33 .TP
34 Request options:
35 .BI "[--memory " mem "]"
36 .BI "[--disk " disk "]"
37 .BI "[--req-nodes " req-nodes "]"
38 .BI "[--vcpus " vcpus "]"
39 .BI "[--tiered-alloc " spec "]"
40
41
42 .SH DESCRIPTION
43 hspace computes how many additional instances can be fit on a cluster,
44 while maintaining N+1 status.
45
46 The program will try to place instances, all of the same size, on the
47 cluster, until the point where we don't have any N+1 possible
48 allocation. It uses the exact same allocation algorithm as the hail
49 iallocator plugin.
50
51 The output of the program is designed to interpreted as a shell
52 fragment (or parsed as a \fIkey=value\fR file). Options which extend
53 the output (e.g. \-p, \-v) will output the additional information on
54 stderr (such that the stdout is still parseable).
55
56 The following keys are available in the output of the script (all
57 prefixed with \fIHTS_\fR):
58 .TP
59 .I SPEC_MEM, SPEC_DSK, SPEC_CPU, SPEC_RQN
60 These represent the specifications of the instance model used for
61 allocation (the memory, disk, cpu, requested nodes).
62
63 .TP
64 .I CLUSTER_MEM, CLUSTER_DSK, CLUSTER_CPU, CLUSTER_NODES
65 These represent the total memory, disk, CPU count and total nodes in
66 the cluster.
67
68 .TP
69 .I INI_SCORE, FIN_SCORE
70 These are the initial (current) and final cluster score (see the hbal
71 man page for details about the scoring algorithm).
72
73 .TP
74 .I INI_INST_CNT, FIN_INST_CNT
75 The initial and final instance count.
76
77 .TP
78 .I INI_MEM_FREE, FIN_MEM_FREE
79 The initial and final total free memory in the cluster (but this
80 doesn't necessarily mean available for use).
81
82 .TP
83 .I INI_MEM_AVAIL, FIN_MEM_AVAIL
84 The initial and final total available memory for allocation in the
85 cluster. If allocating redundant instances, new instances could
86 increase the reserved memory so it doesn't necessarily mean the
87 entirety of this memory can be used for new instance allocations.
88
89 .TP
90 .I INI_MEM_RESVD, FIN_MEM_RESVD
91 The initial and final reserved memory (for redundancy/N+1 purposes).
92
93 .TP
94 .I INI_MEM_INST, FIN_MEM_INST
95 The initial and final memory used for instances (actual runtime used
96 RAM).
97
98 .TP
99 .I INI_MEM_OVERHEAD, FIN_MEM_OVERHEAD
100 The initial and final memory overhead \(em memory used for the node
101 itself and unacounted memory (e.g. due to hypervisor overhead).
102
103 .TP
104 .I INI_MEM_EFF, HTS_INI_MEM_EFF
105 The initial and final memory efficiency, represented as instance
106 memory divided by total memory.
107
108 .TP
109 .I INI_DSK_FREE, INI_DSK_AVAIL, INI_DSK_RESVD, INI_DSK_INST, INI_DSK_EFF
110 Initial disk stats, similar to the memory ones.
111
112 .TP
113 .I FIN_DSK_FREE, FIN_DSK_AVAIL, FIN_DSK_RESVD, FIN_DSK_INST, FIN_DSK_EFF
114 Final disk stats, similar to the memory ones.
115
116 .TP
117 .I INI_CPU_INST, FIN_CPU_INST
118 Initial and final number of virtual CPUs used by instances.
119
120 .TP
121 .I INI_CPU_EFF, FIN_CPU_EFF
122 The initial and final CPU efficiency, represented as the count of
123 virtual instance CPUs divided by the total physical CPU count.
124
125 .TP
126 .I INI_MNODE_MEM_AVAIL, FIN_MNODE_MEM_AVAIL
127 The initial and final maximum per\(hynode available memory. This is not
128 very useful as a metric but can give an impression of the status of
129 the nodes; as an example, this value restricts the maximum instance
130 size that can be still created on the cluster.
131
132 .TP
133 .I INI_MNODE_DSK_AVAIL, FIN_MNODE_DSK_AVAIL
134 Like the above but for disk.
135
136 .TP
137 .I TSPEC
138 If the tiered allocation mode has been enabled, this parameter holds
139 the pairs of specifications and counts of instances that can be
140 created in this mode. The value of the key is a space\(hyseparated list
141 of values; each value is of the form \fImemory,disk,vcpu=count\fR
142 where the memory, disk and vcpu are the values for the current spec,
143 and count is how many instances of this spec can be created. A
144 complete value for this variable could be: \fB4096,102400,2=225
145 2560,102400,2=20 512,102400,2=21\fR.
146
147 .TP
148 .I ALLOC_USAGE
149 The current usage represented as initial number of instances divided
150 per final number of instances.
151
152 .TP
153 .I ALLOC_COUNT
154 The number of instances allocated (delta between FIN_INST_CNT and
155 INI_INST_CNT).
156
157 .TP
158 .I ALLOC_FAIL*_CNT
159 For the last attemp at allocations (which would have increased
160 FIN_INST_CNT with one, if it had succeeded), this is the count of the
161 failure reasons per failure type; currently defined are FAILMEM,
162 FAILDISK and FAILCPU which represent errors due to not enough memory,
163 disk and CPUs, and FAILN1 which represents a non N+1 compliant cluster
164 on which we can't allocate instances at all.
165
166 .TP
167 .I ALLOC_FAIL_REASON
168 The reason for most of the failures, being one of the above FAIL*
169 strings.
170
171 .TP
172 .I OK
173 A marker representing the successful end of the computation, and
174 having value "1". If this key is not present in the output it means
175 that the computation failed and any values present should not be
176 relied upon.
177
178 .PP
179
180 If the tiered allocation mode is enabled, then many of the INI_/FIN_
181 metrics will be also displayed with a TRL_ prefix, and denote the
182 cluster status at the end of the tiered allocation run.
183
184 .SH OPTIONS
185 The options that can be passed to the program are as follows:
186
187 .TP
188 .BI "--memory " mem
189 The memory size of the instances to be placed (defaults to 4GiB).
190
191 .TP
192 .BI "--disk " disk
193 The disk size of the instances to be placed (defaults to 100GiB).
194
195 .TP
196 .BI "--req-nodes " num-nodes
197 The number of nodes for the instances; the default of two means
198 mirrored instances, while passing one means plain type instances.
199
200 .TP
201 .BI "--vcpus " vcpus
202 The number of VCPUs of the instances to be placed (defaults to 1).
203
204 .TP
205 .BI "--max-cpu " cpu-ratio
206 The maximum virtual\(hyto\(hyphysical cpu ratio, as a floating point
207 number between zero and one. For example, specifying \fIcpu-ratio\fR
208 as \fB2.5\fR means that, for a 4\(hycpu machine, a maximum of 10
209 virtual cpus should be allowed to be in use for primary instances. A
210 value of one doesn't make sense though, as that means no disk space
211 can be used on it.
212
213 .TP
214 .BI "--min-disk " disk-ratio
215 The minimum amount of free disk space remaining, as a floating point
216 number. For example, specifying \fIdisk-ratio\fR as \fB0.25\fR means
217 that at least one quarter of disk space should be left free on nodes.
218
219 .TP
220 .B -p, --print-nodes
221 Prints the before and after node status, in a format designed to allow
222 the user to understand the node's most important parameters.
223
224 It is possible to customise the listed information by passing a
225 comma\(hyseparated list of field names to this option (the field list is
226 currently undocumented). By default, the node list will contain these
227 informations:
228 .RS
229 .TP
230 .B F
231 a character denoting the status of the node, with '\-' meaning an
232 offline node, '*' meaning N+1 failure and blank meaning a good node
233 .TP
234 .B Name
235 the node name
236 .TP
237 .B t_mem
238 the total node memory
239 .TP
240 .B n_mem
241 the memory used by the node itself
242 .TP
243 .B i_mem
244 the memory used by instances
245 .TP
246 .B x_mem
247 amount memory which seems to be in use but cannot be determined why or
248 by which instance; usually this means that the hypervisor has some
249 overhead or that there are other reporting errors
250 .TP
251 .B f_mem
252 the free node memory
253 .TP
254 .B r_mem
255 the reserved node memory, which is the amount of free memory needed
256 for N+1 compliance
257 .TP
258 .B t_dsk
259 total disk
260 .TP
261 .B f_dsk
262 free disk
263 .TP
264 .B pcpu
265 the number of physical cpus on the node
266 .TP
267 .B vcpu
268 the number of virtual cpus allocated to primary instances
269 .TP
270 .B pri
271 number of primary instances
272 .TP
273 .B sec
274 number of secondary instances
275 .TP
276 .B p_fmem
277 percent of free memory
278 .TP
279 .B p_fdsk
280 percent of free disk
281 .TP
282 .B r_cpu
283 ratio of virtual to physical cpus
284 .TP
285 .B lCpu
286 the dynamic CPU load (if the information is available)
287 .TP
288 .B lMem
289 the dynamic memory load (if the information is available)
290 .TP
291 .B lDsk
292 the dynamic disk load (if the information is available)
293 .TP
294 .B lNet
295 the dynamic net load (if the information is available)
296 .RE
297
298 .TP
299 .BI "-O " name
300 This option (which can be given multiple times) will mark nodes as
301 being \fIoffline\fR, and instances won't be placed on these nodes.
302
303 Note that hspace will also mark as offline any nodes which are
304 reported by RAPI as such, or that have "?" in file\(hybased input in any
305 numeric fields.
306 .RE
307
308 .TP
309 .BI "-n" nodefile ", --nodes=" nodefile
310 The name of the file holding node information (if not collecting via
311 RAPI), instead of the default \fInodes\fR file (but see below how to
312 customize the default value via the environment).
313
314 .TP
315 .BI "-i" instancefile ", --instances=" instancefile
316 The name of the file holding instance information (if not collecting
317 via RAPI), instead of the default \fIinstances\fR file (but see below
318 how to customize the default value via the environment).
319
320 .TP
321 .BI "-m" cluster
322 Collect data not from files but directly from the
323 .I cluster
324 given as an argument via RAPI. If the argument doesn't contain a colon
325 (:), then it is converted into a fully\(hybuilt URL via prepending
326 https:// and appending the default RAPI port, otherwise it's
327 considered a fully\(hyspecified URL and is used as\(hyis.
328
329 .TP
330 .BI "-L[" path "]"
331 Collect data not from files but directly from the master daemon, which
332 is to be contacted via the luxi (an internal Ganeti protocol). An
333 optional \fIpath\fR argument is interpreted as the path to the unix
334 socket on which the master daemon listens; otherwise, the default path
335 used by ganeti when installed with \fI--localstatedir=/var\fR is used.
336
337 .TP
338 .BI "--simulate " description
339 Instead of using actual data, build an empty cluster given a node
340 description. The \fIdescription\fR parameter must be a
341 comma\(hyseparated list of four elements, describing in order:
342
343 .RS
344
345 .RS
346 .TP
347 the number of nodes in the cluster
348
349 .TP
350 the disk size of the nodes, in mebibytes
351
352 .TP
353 the memory size of the nodes, in mebibytes
354
355 .TP
356 the cpu core count for the nodes
357
358 .RE
359
360 An example description would be \fB20,102400,16384,4\fR describing a
361 20\(hynode cluster where each node has 100GiB of disk space, 16GiB of
362 memory and 4 CPU cores. Note that all nodes must have the same specs
363 currently.
364
365 .RE
366
367 .TP
368 .BI "--tiered-alloc " spec
369 Beside the standard, fixed\(hysize allocation, also do a tiered
370 allocation scheme where the algorithm starts from the given
371 specification and allocates until there is no more space; then it
372 decreases the specification and tries the allocation again. The
373 decrease is done on the matric that last failed during allocation. The
374 specification given is similar to the \fI--simulate\fR option and it
375 holds:
376
377 .RS
378
379 .RS
380
381 .TP
382 the disk size of the instance
383
384 .TP
385 the memory size of the instance
386
387 .TP
388 the vcpu count for the insance
389
390 .RE
391
392 An example description would be \fB10240,8192,2\fR describing an
393 initial starting specification of 10GiB of disk space, 4GiB of memory
394 and 2 VCPUs.
395
396 Also note that the normal allocation and the tiered allocation are
397 independent, and both start from the initial cluster state; as such,
398 the instance count for these two modes are not related one to another.
399
400 .RE
401
402 .TP
403 .B -v, --verbose
404 Increase the output verbosity. Each usage of this option will increase
405 the verbosity (currently more than 2 doesn't make sense) from the
406 default of one. At verbosity 2 the location of the new instances is
407 shown in the standard error.
408
409 .TP
410 .B -q, --quiet
411 Decrease the output verbosity. Each usage of this option will decrease
412 the verbosity (less than zero doesn't make sense) from the default of
413 one.
414
415 .TP
416 .B -V, --version
417 Just show the program version and exit.
418
419 .SH EXIT STATUS
420
421 The exist status of the command will be zero, unless for some reason
422 the algorithm fatally failed (e.g. wrong node or instance data).
423
424 .SH BUGS
425
426 The algorithm is highly dependent on the number of nodes; its runtime
427 grows exponentially with this number, and as such is impractical for
428 really big clusters.
429
430 The algorithm doesn't rebalance the cluster or try to get the optimal
431 fit; it just allocates in the best place for the current step, without
432 taking into consideration the impact on future placements.
433
434 .SH ENVIRONMENT
435
436 If the variables \fBHTOOLS_NODES\fR and \fBHTOOLS_INSTANCES\fR are
437 present in the environment, they will override the default names for
438 the nodes and instances files. These will have of course no effect
439 when the RAPI or Luxi backends are used.
440
441 .SH SEE ALSO
442 .BR hbal "(1), " hscan "(1), " ganeti "(7), " gnt-instance "(8), "
443 .BR gnt-node "(8)"
444
445 .SH "COPYRIGHT"
446 .PP
447 Copyright (C) 2009 Google Inc. Permission is granted to copy,
448 distribute and/or modify under the terms of the GNU General Public
449 License as published by the Free Software Foundation; either version 2
450 of the License, or (at your option) any later version.
451 .PP
452 On Debian systems, the complete text of the GNU General Public License
453 can be found in /usr/share/common-licenses/GPL.