1 .TH HSPACE 1 2009-06-01 htools "Ganeti H-tools"
3 hspace \- Cluster space analyzer for Ganeti
10 .BI "[-m " cluster "]"
11 .BI "[-n " nodes-file " ]"
12 .BI "[-i " instances-file "]"
13 .BI "[--memory " mem "]"
14 .BI "[--disk " disk "]"
15 .BI "[--req-nodes " req-nodes "]"
16 .BI "[--max-cpu " cpu-ratio "]"
17 .BI "[--min-disk " disk-ratio "]"
23 hspace computes how many additional instances can be fit on a cluster,
24 while maintaining N+1 status.
26 The program will try to place instances, all of the same size, on the
27 cluster, until the point where we don't have any N+1 possible
28 allocation. It uses the exact same allocation algorithm as the hail
31 The output of the program is designed to interpreted as a shell
32 fragment (or parsed as a \fIkey=value\fR file). Options which extend
33 the output (e.g. -p, -v) will output the additional information on
34 stderr (such that the stdout is still parseable).
36 The following keys are available in the output of the script (all
37 prefixed with \fIHTS_\fR):
39 .I SPEC_MEM, SPEC_DSK, SPEC_CPU, SPEC_RQN
40 These represent the specifications of the instance model used for
41 allocation (the memory, disk, cpu, requested nodes).
44 .I CLUSTER_MEM, CLUSTER_DSK, CLUSTER_CPU, CLUSTER_NODES
45 These represent the total memory, disk, CPU count and total nodes in
49 .I INI_SCORE, FIN_SCORE
50 These are the initial (current) and final cluster score (see the hbal
51 man page for details about the scoring algorithm).
54 .I INI_INST_CNT, FIN_INST_CNT
55 The initial and final instance count.
58 .I INI_MEM_FREE, FIN_MEM_FREE
59 The initial and final total free memory in the cluster (but this
60 doesn't necessarily mean available for use).
63 .I INI_MEM_AVAIL, FIN_MEM_AVAIL
64 The initial and final total available memory for allocation in the
65 cluster. If allocating redundant instances, new instances could
66 increase the reserved memory so it doesn't necessarily mean the
67 entirety of this memory can be used for new instance allocations.
70 .I INI_MEM_RESVD, FIN_MEM_RESVD
71 The initial and final reserved memory (for redundancy/N+1 purposes).
74 .I INI_MEM_INST, FIN_MEM_INST
75 The initial and final memory used for instances (actual runtime used
79 .I INI_MEM_OVERHEAD, FIN_MEM_OVERHEAD
80 The initial and final memory overhead - memory used for the node
81 itself and unacounted memory (e.g. due to hypervisor overhead).
84 .I INI_MEM_EFF, HTS_INI_MEM_EFF
85 The initial and final memory efficiency, represented as instance
86 memory divided by total memory.
89 .I INI_DSK_FREE, INI_DSK_AVAIL, INI_DSK_RESVD, INI_DSK_INST, INI_DSK_EFF
90 Initial disk stats, similar to the memory ones.
93 .I FIN_DSK_FREE, FIN_DSK_AVAIL, FIN_DSK_RESVD, FIN_DSK_INST, FIN_DSK_EFF
94 Final disk stats, similar to the memory ones.
97 .I INI_CPU_INST, FIN_CPU_INST
98 Initial and final number of virtual CPUs used by instances.
101 .I INI_CPU_EFF, FIN_CPU_EFF
102 The initial and final CPU efficiency, represented as the count of
103 virtual instance CPUs divided by the total physical CPU count.
106 .I INI_MNODE_MEM_AVAIL, FIN_MNODE_MEM_AVAIL
107 The initial and final maximum per-node available memory. This is not
108 very useful as a metric but can give an impression of the status of
109 the nodes; as an example, this value restricts the maximum instance
110 size that can be still created on the cluster.
113 .I INI_MNODE_DSK_AVAIL, FIN_MNODE_DSK_AVAIL
114 Like the above but for disk.
118 The current usage represented as initial number of instances divided
119 per final number of instances.
123 The number of instances allocated (delta between FIN_INST_CNT and
128 For the last attemp at allocations (which would have increased
129 FIN_INST_CNT with one, if it had succeeded), this is the count of the
130 failure reasons per failure type; currently defined are FAILMEM,
131 FAILDISK and FAILCPU which represent errors due to not enough memory,
132 disk and CPUs, and FAILN1 which represents a non N+1 compliant cluster
133 on which we can't allocate instances at all.
137 The reason for most of the failures, being one of the above FAIL*
142 A marker representing the successful end of the computation, and
143 having value "1". If this key is not present in the output it means
144 that the computation failed and any values present should not be
148 The options that can be passed to the program are as follows:
152 The memory size of the instances to be placed (defaults to 4GiB).
156 The disk size of the instances to be placed (defaults to 100GiB).
159 .BI "--req-nodes " num-nodes
160 The number of nodes for the instances; the default of two means
161 mirrored instances, while passing one means plain type instances.
164 .BI "--max-cpu " cpu-ratio
165 The maximum virtual-to-physical cpu ratio, as a floating point number
166 between zero and one. For example, specifying \fIcpu-ratio\fR as
167 \fB2.5\fR means that, for a 4-cpu machine, a maximum of 10 virtual
168 cpus should be allowed to be in use for primary instances. A value of
169 one doesn't make sense though, as that means no disk space can be used
173 .BI "--min-disk " disk-ratio
174 The minimum amount of free disk space remaining, as a floating point
175 number. For example, specifying \fIdisk-ratio\fR as \fB0.25\fR means
176 that at least one quarter of disk space should be left free on nodes.
180 Prints the before and after node status, in a format designed to allow
181 the user to understand the node's most important parameters.
183 The node list will contain these informations:
187 a character denoting the status of the node, with '-' meaning an
188 offline node, '*' meaning N+1 failure and blank meaning a good node
194 the total node memory
197 the memory used by the node itself
200 the memory used by instances
203 amount memory which seems to be in use but cannot be determined why or
204 by which instance; usually this means that the hypervisor has some
205 overhead or that there are other reporting errors
211 the reserved node memory, which is the amount of free memory needed
221 the number of physical cpus on the node
224 the number of virtual cpus allocated to primary instances
227 number of primary instances
230 number of secondary instances
233 percent of free memory
239 ratio of virtual to physical cpus
244 This option (which can be given multiple times) will mark nodes as
245 being \fIoffline\fR, and instances won't be placed on these nodes.
247 Note that hspace will also mark as offline any nodes which are
248 reported by RAPI as such, or that have "?" in file-based input in any
253 .BI "-n" nodefile ", --nodes=" nodefile
254 The name of the file holding node information (if not collecting via
255 RAPI), instead of the default \fInodes\fR file (but see below how to
256 customize the default value via the environment).
259 .BI "-i" instancefile ", --instances=" instancefile
260 The name of the file holding instance information (if not collecting
261 via RAPI), instead of the default \fIinstances\fR file (but see below
262 how to customize the default value via the environment).
266 Collect data not from files but directly from the
268 given as an argument via RAPI. If the argument doesn't contain a colon
269 (:), then it is converted into a fully-built URL via prepending
270 https:// and appending the default RAPI port, otherwise it's
271 considered a fully-specified URL and is used as-is.
275 Increase the output verbosity. Each usage of this option will increase
276 the verbosity (currently more than 2 doesn't make sense) from the
277 default of one. At verbosity 2 the location of the new instances is
278 shown in the standard error.
282 Decrease the output verbosity. Each usage of this option will decrease
283 the verbosity (less than zero doesn't make sense) from the default of
288 Just show the program version and exit.
292 The exist status of the command will be zero, unless for some reason
293 the algorithm fatally failed (e.g. wrong node or instance data).
297 The algorithm is highly dependent on the number of nodes; its runtime
298 grows exponentially with this number, and as such is impractical for
301 The algorithm doesn't rebalance the cluster or try to get the optimal
302 fit; it just allocates in the best place for the current step, without
303 taking into consideration the impact on future placements.
307 If the variables \fBHTOOLS_NODES\fR and \fBHTOOLS_INSTANCES\fR are
308 present in the environment, they will override the default names for
309 the nodes and instances files. These will have of course no effect
313 .BR hbal "(1), " hscan "(1), " ganeti "(7), " gnt-instance "(8), "
318 Copyright (C) 2009 Google Inc. Permission is granted to copy,
319 distribute and/or modify under the terms of the GNU General Public
320 License as published by the Free Software Foundation; either version 2
321 of the License, or (at your option) any later version.
323 On Debian systems, the complete text of the GNU General Public License
324 can be found in /usr/share/common-licenses/GPL.