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..."]
18 .BI "[ -m " cluster " ]"
22 .BI "[ -n " nodes-file " ]"
23 .BI "[ -i " instances-file " ]"
27 .BI "[ --max-cpu " cpu-ratio " ]"
28 .BI "[ --min-disk " disk-ratio " ]"
29 .BI "[ -O " name... " ]"
33 .BI "[--memory " mem "]"
34 .BI "[--disk " disk "]"
35 .BI "[--req-nodes " req-nodes "]"
36 .BI "[--vcpus " vcpus "]"
40 hspace computes how many additional instances can be fit on a cluster,
41 while maintaining N+1 status.
43 The program will try to place instances, all of the same size, on the
44 cluster, until the point where we don't have any N+1 possible
45 allocation. It uses the exact same allocation algorithm as the hail
48 The output of the program is designed to interpreted as a shell
49 fragment (or parsed as a \fIkey=value\fR file). Options which extend
50 the output (e.g. -p, -v) will output the additional information on
51 stderr (such that the stdout is still parseable).
53 The following keys are available in the output of the script (all
54 prefixed with \fIHTS_\fR):
56 .I SPEC_MEM, SPEC_DSK, SPEC_CPU, SPEC_RQN
57 These represent the specifications of the instance model used for
58 allocation (the memory, disk, cpu, requested nodes).
61 .I CLUSTER_MEM, CLUSTER_DSK, CLUSTER_CPU, CLUSTER_NODES
62 These represent the total memory, disk, CPU count and total nodes in
66 .I INI_SCORE, FIN_SCORE
67 These are the initial (current) and final cluster score (see the hbal
68 man page for details about the scoring algorithm).
71 .I INI_INST_CNT, FIN_INST_CNT
72 The initial and final instance count.
75 .I INI_MEM_FREE, FIN_MEM_FREE
76 The initial and final total free memory in the cluster (but this
77 doesn't necessarily mean available for use).
80 .I INI_MEM_AVAIL, FIN_MEM_AVAIL
81 The initial and final total available memory for allocation in the
82 cluster. If allocating redundant instances, new instances could
83 increase the reserved memory so it doesn't necessarily mean the
84 entirety of this memory can be used for new instance allocations.
87 .I INI_MEM_RESVD, FIN_MEM_RESVD
88 The initial and final reserved memory (for redundancy/N+1 purposes).
91 .I INI_MEM_INST, FIN_MEM_INST
92 The initial and final memory used for instances (actual runtime used
96 .I INI_MEM_OVERHEAD, FIN_MEM_OVERHEAD
97 The initial and final memory overhead - memory used for the node
98 itself and unacounted memory (e.g. due to hypervisor overhead).
101 .I INI_MEM_EFF, HTS_INI_MEM_EFF
102 The initial and final memory efficiency, represented as instance
103 memory divided by total memory.
106 .I INI_DSK_FREE, INI_DSK_AVAIL, INI_DSK_RESVD, INI_DSK_INST, INI_DSK_EFF
107 Initial disk stats, similar to the memory ones.
110 .I FIN_DSK_FREE, FIN_DSK_AVAIL, FIN_DSK_RESVD, FIN_DSK_INST, FIN_DSK_EFF
111 Final disk stats, similar to the memory ones.
114 .I INI_CPU_INST, FIN_CPU_INST
115 Initial and final number of virtual CPUs used by instances.
118 .I INI_CPU_EFF, FIN_CPU_EFF
119 The initial and final CPU efficiency, represented as the count of
120 virtual instance CPUs divided by the total physical CPU count.
123 .I INI_MNODE_MEM_AVAIL, FIN_MNODE_MEM_AVAIL
124 The initial and final maximum per-node available memory. This is not
125 very useful as a metric but can give an impression of the status of
126 the nodes; as an example, this value restricts the maximum instance
127 size that can be still created on the cluster.
130 .I INI_MNODE_DSK_AVAIL, FIN_MNODE_DSK_AVAIL
131 Like the above but for disk.
135 The current usage represented as initial number of instances divided
136 per final number of instances.
140 The number of instances allocated (delta between FIN_INST_CNT and
145 For the last attemp at allocations (which would have increased
146 FIN_INST_CNT with one, if it had succeeded), this is the count of the
147 failure reasons per failure type; currently defined are FAILMEM,
148 FAILDISK and FAILCPU which represent errors due to not enough memory,
149 disk and CPUs, and FAILN1 which represents a non N+1 compliant cluster
150 on which we can't allocate instances at all.
154 The reason for most of the failures, being one of the above FAIL*
159 A marker representing the successful end of the computation, and
160 having value "1". If this key is not present in the output it means
161 that the computation failed and any values present should not be
165 The options that can be passed to the program are as follows:
169 The memory size of the instances to be placed (defaults to 4GiB).
173 The disk size of the instances to be placed (defaults to 100GiB).
176 .BI "--req-nodes " num-nodes
177 The number of nodes for the instances; the default of two means
178 mirrored instances, while passing one means plain type instances.
182 The number of VCPUs of the instances to be placed (defaults to 1).
185 .BI "--max-cpu " cpu-ratio
186 The maximum virtual-to-physical cpu ratio, as a floating point number
187 between zero and one. For example, specifying \fIcpu-ratio\fR as
188 \fB2.5\fR means that, for a 4-cpu machine, a maximum of 10 virtual
189 cpus should be allowed to be in use for primary instances. A value of
190 one doesn't make sense though, as that means no disk space can be used
194 .BI "--min-disk " disk-ratio
195 The minimum amount of free disk space remaining, as a floating point
196 number. For example, specifying \fIdisk-ratio\fR as \fB0.25\fR means
197 that at least one quarter of disk space should be left free on nodes.
201 Prints the before and after node status, in a format designed to allow
202 the user to understand the node's most important parameters.
204 The node list will contain these informations:
208 a character denoting the status of the node, with '-' meaning an
209 offline node, '*' meaning N+1 failure and blank meaning a good node
215 the total node memory
218 the memory used by the node itself
221 the memory used by instances
224 amount memory which seems to be in use but cannot be determined why or
225 by which instance; usually this means that the hypervisor has some
226 overhead or that there are other reporting errors
232 the reserved node memory, which is the amount of free memory needed
242 the number of physical cpus on the node
245 the number of virtual cpus allocated to primary instances
248 number of primary instances
251 number of secondary instances
254 percent of free memory
260 ratio of virtual to physical cpus
263 the dynamic CPU load (if the information is available)
266 the dynamic memory load (if the information is available)
269 the dynamic disk load (if the information is available)
272 the dynamic net load (if the information is available)
277 This option (which can be given multiple times) will mark nodes as
278 being \fIoffline\fR, and instances won't be placed on these nodes.
280 Note that hspace will also mark as offline any nodes which are
281 reported by RAPI as such, or that have "?" in file-based input in any
286 .BI "-n" nodefile ", --nodes=" nodefile
287 The name of the file holding node information (if not collecting via
288 RAPI), instead of the default \fInodes\fR file (but see below how to
289 customize the default value via the environment).
292 .BI "-i" instancefile ", --instances=" instancefile
293 The name of the file holding instance information (if not collecting
294 via RAPI), instead of the default \fIinstances\fR file (but see below
295 how to customize the default value via the environment).
299 Collect data not from files but directly from the
301 given as an argument via RAPI. If the argument doesn't contain a colon
302 (:), then it is converted into a fully-built URL via prepending
303 https:// and appending the default RAPI port, otherwise it's
304 considered a fully-specified URL and is used as-is.
308 Collect data not from files but directly from the master daemon, which
309 is to be contacted via the luxi (an internal Ganeti protocol). An
310 optional \fIpath\fR argument is interpreted as the path to the unix
311 socket on which the master daemon listens; otherwise, the default path
312 used by ganeti when installed with "--localstatedir=/var" is used.
315 .BI "--simulate " description
316 Instead of using actual data, build an empty cluster given a node
317 description. The \fIdescription\fR parameter must be a comma-separate
318 list of four elements, describing in order:
324 the number of nodes in the cluster
327 the disk size of the nodes, in mebibytes
330 the memory size of the nodes, in mebibytes
333 the cpu core count for the nodes
337 An example description would be \fB20,102400,16384,4\fR describing a
338 20-node cluster where each node has 100GiB of disk space, 16GiB of
339 memory and 4 CPU cores. Note that all nodes must have the same specs
346 Increase the output verbosity. Each usage of this option will increase
347 the verbosity (currently more than 2 doesn't make sense) from the
348 default of one. At verbosity 2 the location of the new instances is
349 shown in the standard error.
353 Decrease the output verbosity. Each usage of this option will decrease
354 the verbosity (less than zero doesn't make sense) from the default of
359 Just show the program version and exit.
363 The exist status of the command will be zero, unless for some reason
364 the algorithm fatally failed (e.g. wrong node or instance data).
368 The algorithm is highly dependent on the number of nodes; its runtime
369 grows exponentially with this number, and as such is impractical for
372 The algorithm doesn't rebalance the cluster or try to get the optimal
373 fit; it just allocates in the best place for the current step, without
374 taking into consideration the impact on future placements.
378 If the variables \fBHTOOLS_NODES\fR and \fBHTOOLS_INSTANCES\fR are
379 present in the environment, they will override the default names for
380 the nodes and instances files. These will have of course no effect
384 .BR hbal "(1), " hscan "(1), " ganeti "(7), " gnt-instance "(8), "
389 Copyright (C) 2009 Google Inc. Permission is granted to copy,
390 distribute and/or modify under the terms of the GNU General Public
391 License as published by the Free Software Foundation; either version 2
392 of the License, or (at your option) any later version.
394 On Debian systems, the complete text of the GNU General Public License
395 can be found in /usr/share/common-licenses/GPL.