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
265 This option (which can be given multiple times) will mark nodes as
266 being \fIoffline\fR, and instances won't be placed on these nodes.
268 Note that hspace will also mark as offline any nodes which are
269 reported by RAPI as such, or that have "?" in file-based input in any
274 .BI "-n" nodefile ", --nodes=" nodefile
275 The name of the file holding node information (if not collecting via
276 RAPI), instead of the default \fInodes\fR file (but see below how to
277 customize the default value via the environment).
280 .BI "-i" instancefile ", --instances=" instancefile
281 The name of the file holding instance information (if not collecting
282 via RAPI), instead of the default \fIinstances\fR file (but see below
283 how to customize the default value via the environment).
287 Collect data not from files but directly from the
289 given as an argument via RAPI. If the argument doesn't contain a colon
290 (:), then it is converted into a fully-built URL via prepending
291 https:// and appending the default RAPI port, otherwise it's
292 considered a fully-specified URL and is used as-is.
296 Collect data not from files but directly from the master daemon, which
297 is to be contacted via the luxi (an internal Ganeti protocol). An
298 optional \fIpath\fR argument is interpreted as the path to the unix
299 socket on which the master daemon listens; otherwise, the default path
300 used by ganeti when installed with "--localstatedir=/var" is used.
304 Increase the output verbosity. Each usage of this option will increase
305 the verbosity (currently more than 2 doesn't make sense) from the
306 default of one. At verbosity 2 the location of the new instances is
307 shown in the standard error.
311 Decrease the output verbosity. Each usage of this option will decrease
312 the verbosity (less than zero doesn't make sense) from the default of
317 Just show the program version and exit.
321 The exist status of the command will be zero, unless for some reason
322 the algorithm fatally failed (e.g. wrong node or instance data).
326 The algorithm is highly dependent on the number of nodes; its runtime
327 grows exponentially with this number, and as such is impractical for
330 The algorithm doesn't rebalance the cluster or try to get the optimal
331 fit; it just allocates in the best place for the current step, without
332 taking into consideration the impact on future placements.
336 If the variables \fBHTOOLS_NODES\fR and \fBHTOOLS_INSTANCES\fR are
337 present in the environment, they will override the default names for
338 the nodes and instances files. These will have of course no effect
342 .BR hbal "(1), " hscan "(1), " ganeti "(7), " gnt-instance "(8), "
347 Copyright (C) 2009 Google Inc. Permission is granted to copy,
348 distribute and/or modify under the terms of the GNU General Public
349 License as published by the Free Software Foundation; either version 2
350 of the License, or (at your option) any later version.
352 On Debian systems, the complete text of the GNU General Public License
353 can be found in /usr/share/common-licenses/GPL.