1 .TH HSPACE 1 2009-06-01 htools "Ganeti H-tools"
3 hspace \- Cluster space analyzer for Ganeti
7 .B "[backend options...]"
8 .B "[algorithm options...]"
9 .B "[request options..."]
10 .BI "[ -p[" fields "] ]"
23 .BI " -i " instances-file
25 .BI " --simulate " spec
29 .BI "[ --max-cpu " cpu-ratio " ]"
30 .BI "[ --min-disk " disk-ratio " ]"
31 .BI "[ -O " name... " ]"
35 .BI "[--memory " mem "]"
36 .BI "[--disk " disk "]"
37 .BI "[--req-nodes " req-nodes "]"
38 .BI "[--vcpus " vcpus "]"
39 .BI "[--tiered-alloc " spec "]"
43 hspace computes how many additional instances can be fit on a cluster,
44 while maintaining N+1 status.
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
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).
56 The following keys are available in the output of the script (all
57 prefixed with \fIHTS_\fR):
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).
64 .I CLUSTER_MEM, CLUSTER_DSK, CLUSTER_CPU, CLUSTER_NODES
65 These represent the total memory, disk, CPU count and total nodes in
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).
74 .I INI_INST_CNT, FIN_INST_CNT
75 The initial and final instance count.
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).
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.
90 .I INI_MEM_RESVD, FIN_MEM_RESVD
91 The initial and final reserved memory (for redundancy/N+1 purposes).
94 .I INI_MEM_INST, FIN_MEM_INST
95 The initial and final memory used for instances (actual runtime used
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).
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.
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.
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.
117 .I INI_CPU_INST, FIN_CPU_INST
118 Initial and final number of virtual CPUs used by instances.
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.
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.
133 .I INI_MNODE_DSK_AVAIL, FIN_MNODE_DSK_AVAIL
134 Like the above but for disk.
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.
149 The current usage represented as initial number of instances divided
150 per final number of instances.
154 The number of instances allocated (delta between FIN_INST_CNT and
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.
168 The reason for most of the failures, being one of the above FAIL*
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
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.
185 The options that can be passed to the program are as follows:
189 The memory size of the instances to be placed (defaults to 4GiB).
193 The disk size of the instances to be placed (defaults to 100GiB).
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.
202 The number of VCPUs of the instances to be placed (defaults to 1).
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
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.
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.
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
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
238 the total node memory
241 the memory used by the node itself
244 the memory used by instances
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
255 the reserved node memory, which is the amount of free memory needed
265 the number of physical cpus on the node
268 the number of virtual cpus allocated to primary instances
271 number of primary instances
274 number of secondary instances
277 percent of free memory
283 ratio of virtual to physical cpus
286 the dynamic CPU load (if the information is available)
289 the dynamic memory load (if the information is available)
292 the dynamic disk load (if the information is available)
295 the dynamic net load (if the information is available)
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.
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
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).
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).
322 Collect data not from files but directly from the
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.
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.
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:
347 the number of nodes in the cluster
350 the disk size of the nodes, in mebibytes
353 the memory size of the nodes, in mebibytes
356 the cpu core count for the nodes
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
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
382 the disk size of the instance
385 the memory size of the instance
388 the vcpu count for the insance
392 An example description would be \fB10240,8192,2\fR describing an
393 initial starting specification of 10GiB of disk space, 4GiB of memory
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.
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.
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
417 Just show the program version and exit.
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).
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
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.
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.
442 .BR hbal "(1), " hscan "(1), " ganeti "(7), " gnt-instance "(8), "
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.
452 On Debian systems, the complete text of the GNU General Public License
453 can be found in /usr/share/common-licenses/GPL.