HBAL(1)
π HBAL(1) β hbal π
Version 3.1.0~rc2 Β· the Cluster balancer for Ganeti, bestie edition π
β¨ NAME β¨
hbal β Cluster balancer for Ganeti π«Ά
πΈ SYNOPSIS πΈ
hbal {backend options...} [algorithm options...] [reporting options...]
hbal --version
Backend options:
{ -m cluster | -L[ path ] [-X] | -t data-file | -I path }
Algorithm options:
[ --max-cpu *cpu-ratio* ] [ --min-disk *disk-ratio* ] [ -l *limit* ] [ -e
*score* ] [ -g *delta* ] [ --min-gain-limit *threshold* ] [ -O *name...* ] [
--no-disk-moves ] [ --no-instance-moves ] [ -U *util-file* ] [ --ignore-dynu
] [ --ignore-soft-errors ] [ --mond *yes|no* ] [ --mond-xen ] [
--exit-on-missing-mond-data ] [ --evac-mode ] [ --restricted-migration ] [
--select-instances *inst...* ] [ --exclude-instances *inst...* ]
Reporting options:
[ -C[ *file* ] ] [ -p[ *fields* ] ] [ --print-instances ] [ -S *file* ] [ -v...
| -q ]
π DESCRIPTION π
okay so, hbal is a cluster balancer. it peeks at the current state of your cluster β nodes with their total and free disk, memory, etc. π β plus instance placement, and then it computes a whole series of steps designed to bring that cluster into a better state. slay. π
The algorithm it uses is designed to be stable β like, if you restart it from the middle of the solution you get the same results, iconic β and reasonably fast. but no cap, it is not a perfect algorithm: it's possible to make it go into a corner from which it can find no improvement, because it only looks one "step" ahead. π lowkey tragic but that's the vibe.
The program accesses the cluster state via Rapi or Luxi. it also requests data over the network from all MonDs with the --mond option. currently it uses only data produced by the CPUload collector. β¨
By default, the program will show the solution incrementally as it is computed, in a somewhat cryptic format; for getting the actual Ganeti command list, use the -C option. π
π§ ALGORITHM π§
The program works in independent steps; at each step, we compute the best instance move that lowers the cluster score. main character energy fr fr.
The possible move type for an instance are combinations of failover/migrate and replace-disks such that we change one of the instance nodes, and the other one remains (but possibly with changed role, e.g. from primary it becomes secondary). the list is:
- failover (
f) - replace secondary (
r) - replace primary, a composite move (
f,r,f) - failover and replace secondary, also composite (
f,r) - replace secondary and failover, also composite (
r,f)
We don't do the only remaining possibility of replacing both nodes (r,f,r,f or the equivalent f,r,f,r) since these move needs an exhaustive search over both candidate primary and secondary nodes, and is O(n*n) in the number of nodes. furthermore, it doesn't seems to give better scores but will result in more disk replacements. π not worth it bestie.
π§ PLACEMENT RESTRICTIONS π§
At each step, we prevent an instance move if it would cause:
- a node to go into N+1 failure state
- an instance to move onto an offline node (offline nodes are either read from the cluster or declared with
-O; drained nodes are considered offline) - an exclusion-tag based conflict (exclusion tags are read from the cluster and/or defined via the
--exclusion-tagsoption) - a max vcpu/pcpu ratio to be exceeded (configured via
--max-cpu) - min disk free percentage to go below the configured limit (configured via
--min-disk)
π CLUSTER SCORING π
As said before, the algorithm tries to minimise the cluster score at each step. currently this score is computed as a weighted sum of the following components:
- standard deviation of the percent of free memory
- standard deviation of the percent of reserved memory
- the sum of the percentages of reserved memory
- standard deviation of the percent of free disk
- count of nodes failing N+1 check
- count of instances living (either as primary or secondary) on offline nodes; in the sense of
hbal(and the other htools) drained nodes are considered offline - count of instances living (as primary) on offline nodes; this differs from the above metric by helping failover of such instances in 2-node clusters
- standard deviation of the ratio of virtual-to-physical cpus (for primary instances of the node)
- standard deviation of the fraction of the available spindles (in dedicated mode, spindles represent physical spindles; otherwise this oversubscribable measure for IO load, and the oversubscription factor is taken into account when computing the number of available spindles)
- standard deviation of the dynamic load on the nodes, for cpus, memory, disk and network
- standard deviation of the CPU load provided by MonD
- the count of instances with primary and secondary in the same failure domain
- the count of instances sharing the same exclusion tags which primary instances placed in the same failure domain
- the overall sum of dissatisfied desired locations among all cluster instances
The free memory and free disk values help ensure that all nodes are somewhat balanced in their resource usage. the reserved memory helps to ensure that nodes are somewhat balanced in holding secondary instances, and that no node keeps too much memory reserved for N+1. and finally, the N+1 percentage helps guide the algorithm towards eliminating N+1 failures, if possible. π¦
Except for the N+1 failures, offline instances counts, failure domain violation counts and desired locations count, we use the standard deviation since when used with values within a fixed range (we use percents expressed as values between zero and one) it gives consistent results across all metrics (there are some small issues related to different means, but it works generally well). the 'count' type values will have higher score and thus will matter more for balancing; thus these are better for hard constraints (like evacuating nodes and fixing N+1 failures). for example, the offline instances count (i.e. the number of instances living on offline nodes) will cause the algorithm to actively move instances away from offline nodes. this, coupled with the restriction on placement given by offline nodes, will cause evacuation of such nodes. π
The dynamic load values need to be read from an external file (Ganeti doesn't supply them), and are computed for each node as: sum of primary instance cpu load, sum of primary instance memory load, sum of primary and secondary instance disk load (as DRBD generates write load on secondary nodes too in normal case and in degraded scenarios also read load), and sum of primary instance network load. an example of how to generate these values for input to hbal would be to track xl list for instances over a day and by computing the delta of the cpu values, and feed that via the -U option for all instances (and keep the other metrics as one). for the algorithm to work, all that is needed is that the values are consistent for a metric across all instances (e.g. all instances use cpu% to report cpu usage, and not something related to number of CPU seconds used if the CPUs are different), and that they are normalised to between zero and one. note that it's recommended to not have zero as the load value for any instance metric since then secondary instances are not well balanced. β
The CPUload from MonD's data collector will be used only if all MonDs are running, otherwise it won't affect the cluster score. since we can't find the CPU load of each instance, we can assume that the CPU load of an instance is proportional to the number of its vcpus. with this heuristic, instances from nodes with high CPU load will tend to move to nodes with less CPU load. π₯
On a perfectly balanced cluster (all nodes the same size, all instances the same size and spread across the nodes equally, all desired locations satisfied), the values for all metrics would be zero, with the exception of the total percentage of reserved memory. this doesn't happen too often in practice :) π
π OFFLINE INSTANCES π
Since current Ganeti versions do not report the memory used by offline (down) instances, ignoring the run status of instances will cause wrong calculations. for this reason, the algorithm subtracts the memory size of down instances from the free node memory of their primary node, in effect simulating the startup of such instances. β¨
π DESIRED LOCATION TAGS π
Sometimes, administrators want specific instances located in a particular, typically geographic, location. to support this desired location tags are introduced.
If the cluster is tagged htools:desiredlocation:x then tags starting with x are desired location tags. instances can be assigned tags of the form x that means that instance wants to be placed on a node tagged with a location tag x. (that means that cluster should be tagged htools:nlocation:x too).
Instance pinning is just heuristics, not a hard enforced requirement; it will only be achieved by the cluster metrics favouring such placements. π
π« EXCLUSION TAGS π«
The exclusion tags mechanism is designed to prevent instances which run the same workload (e.g. two DNS servers) to land on the same node, which would make the respective node a SPOF for the given service. π
It works by tagging instances with certain tags and then building exclusion maps based on these. which tags are actually used is configured either via the command line (option --exclusion-tags) or via adding them to the cluster tags:
--exclusion-tags=a,bβ this will make all instance tags of the forma:*,b:*be considered for the exclusion map- cluster tags
htools:iextags:a,htools:iextags:bβ this will make instance tagsa:*,b:*be considered for the exclusion map. more precisely, the suffix of cluster tags starting withhtools:iextags:will become the prefix of the exclusion tags.
Both the above forms mean that two instances both having (e.g.) the tag a:foo or b:bar won't end on the same node. π
π« MIGRATION TAGS π«
If Ganeti is deployed on a heterogeneous cluster, migration might not be possible between all nodes of a node group. one example of such a situation is upgrading the hypervisor node by node. to make hbal aware of those restrictions, the following cluster tags are used.
- cluster tags
htools:migration:a,htools:migration:b, etc β this make make node tags of the forma:*,b:*, etc be considered migration restriction. more precisely, the suffix of cluster tags starting withhtools:migration:will become the prefix of the migration tags. only those migrations will be taken into consideration where all migration tags of the source node are also present on the target node.
cluster tags htools:allowmigration:x::yfor migration tags x and y β this one is literally just you asserting that a node tagged y is able to receive instances in the exact same way as if it had an x tag. That's the whole thing. π
So the simple case? Hypervisor upgrade era. Tag every node you've already upgraded with a migration tag and you're done, slay. π In more complicated situations, you can always use a completely different migration tag for each hypervisor you've got and then explicitly state the allowed migration directions with htools:allowmigration: tags. No cap.
π¦ LOCATION TAGS π¦
Okay so within a node group, some nodes might be more likely to fail at the same time because of a common cause of error (think: they share the same power supply unit π). Ganeti can be made aware of those common causes of failure by means of tags.
cluster tags htools:nlocation:a,htools:nlocation:b, etc β this makes node tags of the forma:*,b:*, etc be considered to have a common cause of failure.
Instances whose primary and secondary node have a common cause of failure, and instances sharing the same exclusion tag with primary nodes having a common failure, are considered badly placed. Such placements are always allowed, bestie, they're just never getting away with it β they count heavily towards the cluster score. π«
β¨ OPTIONS β¨
The options that can be passed to the program are as follows:
-C,--print-commandsβ prints the command list at the end of the run. Without this, the program will only show a shorter, but cryptic output.
Note that the moves list will be split into independent steps, calledjobsets, but only for visual inspection β not for actually parallelisation. It is not possible to parallelise these directly when executed viagnt-instancecommands, since a compound command (e.g. failover and replace-disks) must be executed serially. Parallel execution is only possible when using the Luxi backend and the-Loption.
The algorithm for splitting the moves into jobsets is by accumulating moves until the next move is touching nodes already touched by the current moves; this means we can't execute in parallel (due to resource allocation in Ganeti) and thus we start a new jobset.
-p,--print-nodesβ prints the before and after node status, in a format designed to allow the user to understand the node's most important parameters. See the man pagehtools(1)for more details about this option. π--print-instancesβ prints the before and after instance map. This is less useful as the node status, but it can help in understanding instance moves.-Oname β this option (which can be given multiple times) will mark nodes as being offline. This means a couple of things:- instances won't be placed on these nodes, not even temporarily; e.g. the replace primary move is not available if the secondary node is offline, since this move requires a failover.
- these nodes will not be included in the score calculation (except for the percentage of instances on offline nodes).
Note that algorithm will also mark as offline any nodes which are reported by RAPI as such, or that have ? in file-based input in any numeric fields.
-escore,--min-score=score β this parameter denotes how much above the N+1 bound the cluster score can for us to be happy with, and it alters the computation in two ways:- if the cluster has the initial score lower than this value, then we don't enter the algorithm at all, and exit with success.
- during the iterative process, if we reach a score lower than this value, we exit the algorithm.
The default value of the parameter is currently 1e-9 (chosen empirically). π₯
-gdelta,--min-gain=delta β since the balancing algorithm can sometimes result in just very tiny improvements, that bring less gain that they cost in relocation time, this parameter (defaulting to0.01) represents the minimum gain we require during a step, to continue balancing.--min-gain-limit=threshold β the above min-gain option will only take effect if the cluster score is already below threshold (defaults to0.1). The rationale behind this setting is that at high cluster scores (badly balanced clusters), we don't want to abort the rebalance too quickly, as later gains might still be significant. However, under the threshold, the total gain is only the threshold value, so we can exit early.--no-disk-movesβ this parameter prevents hbal from using disk move (i.e.gnt-instance replace-disks) operations. This will result in a much quicker balancing, but of course the improvements are limited. It is up to the user to decide when to use one or another.--no-instance-movesβ this parameter prevents hbal from using instance moves (i.e.gnt-instance migrate/failover) operations. This will only use the slow disk-replacement operations, and will also provide a worse balance, but can be useful if moving instances around is deemed unsafe or not preferred.--evac-modeβ this parameter restricts the list of instances considered for moving to the ones living on offline/drained nodes. It can be used as a (bulk) replacement for Ganeti's owngnt-node evacuate, with the note that it doesn't guarantee full evacuation. π--restricted-migrationβ this parameter disallows any replace-primary moves (frf), as well as those replace-and-failover moves (rf) where the primary node of the instance is not drained. If used together with the--evac-modeoption, the only migrations that hbal will do are migrations of instances off a drained node. This can be useful if during a reinstall of the base operating system migration is only possible from the old OS to the new OS. Note, however, that usually the use of migration tags is the better choice.--select-instances=instances β this parameter marks the given instances (as a comma-separated list) as the only ones being moved during the rebalance.--exclude-instances=instances β this parameter marks the given instances (as a comma-separated list) from being moved during the rebalance.-Uutil-file β this parameter specifies a file holding instance dynamic utilisation information that will be used to tweak the balancing algorithm to equalise load on the nodes (as opposed to static resource usage). The file is in the formatinstance_name cpu_util mem_util disk_util net_utilwhere the_utilparameters are interpreted as numbers and the instance name must match exactly the instance as read from Ganeti. In case of unknown instance names, the program will abort. π
If not given, the default values are one for all metrics and thus dynamic utilisation has only one effect on the algorithm: the equalisation of the secondary instances across nodes (this is the only metric that is not tracked by another, dedicated value, and thus the disk load of instances will cause secondary instance equalisation). Note that value of one will also influence slightly the primary instance count, but that is already tracked via other metrics and thus the influence of the dynamic utilisation will be practically insignificant.
--ignore-dynuβ if given, all dynamic utilisation information will be ignored by assuming it to be0. This option will take precedence over any data passed by the-Uoption or by the MonDs with the--mondand the--mond-dataoption.--ignore-soft-errorsβ if given, all checks for soft errors will be omitted when considering balancing moves. In this way, progress can be made in a cluster where all nodes are in a policy-wise bad state, like exceeding oversubscription ratios on CPU or spindles.-Sfilename,--save-cluster=filename β if given, the state of the cluster before the balancing is saved to the given file plus the extensionoriginal(i.e. filename.original), and the state at the end of the balancing is saved to the given file plus the extensionbalanced(i.e. filename.balanced). This allows re-feeding the cluster state to either hbal itself or for example hspace via the-toption.-tdatafile,--text-data=datafile β backend specification: the name of the file holding node and instance information (if not collecting via RAPI or LUXI). This or one of the other backends must be selected. The option is described in the man pagehtools(1).--mond=yes|no β if given the program will query all MonDs to fetch data from the supported data collectors over the network.--mond-xenβ if given, also query Xen-specific collectors from MonD, provided that monitoring daemons are queried at all.--exit-on-missing-mond-dataβ if given, abort if the data obtainable from querying MonDs is incomplete. The default behavior is to continue with a best guess based on the static information.--mond-datadatafile β the name of the file holding the data provided by MonD, to override querying MonDs over the network. This is mostly used for debugging. The file must be in JSON format and present an array of JSON objects, one for every node, with two members. The first member namednodeis the name of the node and the second member namedreportsis an array of report objects. The report objects must be in the same format as produced by the monitoring agent. π§-mcluster β backend specification: collect data directly from the cluster given as an argument via RAPI. The option is described in the man pagehtools(1).-L[*path*] β backend specification: collect data directly from the master daemon, which is to be contacted via LUXI (an internal Ganeti protocol). The option is described in the man pagehtools(1).
okay continuing bestie, we were literally mid-thought about -X π
So the way the execution works: it takes each individual jobset (peep the -C option for the deets) and runs them in separate stages, and it will abort if at any point a jobset doesn't come back with every single job successful. Every step in the balancing solution gets translated into exactly one Ganeti job (that job has between one and three OpCodes in it, no cap), and all the steps inside one jobset get executed in parallel. The jobsets themselves though? Those run serially. One at a time. Patient queen behavior. π
And yeah, you can interrupt the whole job series execution β scroll down to the signal handling section, it's all there. π«Ά
-l N,--max-length=Nβ caps the solution at this length. This is lowkey the move if you wanna automate the execution of the balancing. set it and let it cook β¨--max-cpu=cpu-ratioβ the max virtual-to-physical CPU ratio, as a floating point number that has to be greater than or equal to one. So like, if you set cpu-ratio to2.5, that means on a 4-cpu machine you'd allow a maximum of 10 virtual cpus in use for primary instances. A value of exactly1means no CPU over-subscription at all (except the CPU time the node itself eats, obviously π ), and values below one are just... nonsense. They literally don't make sense, because it'd mean other resources (like disk, bestie, the disk) won't be fully utilised due to CPU restrictions. Don't do it. π--min-disk=disk-ratioβ the minimum amount of free disk space that stays remaining, as a floating point number. So say you set disk-ratio to0.25β that means at least one quarter of the disk space should be left free on nodes. Leave some room for the girlies, she needs space to breathe π¦-Guuid,--group=uuidβ on a multi-group cluster, this selects this group for processing. If you don't, hbal will just abort, because it literally cannot balance multiple groups at the same time. One group at a time, periodt. π-v,--verboseβ bump up the output verbosity. Every time you use this option it goes up another notch (ngl more than 2 currently doesn't make sense), starting from the default of one. More-v= more yapping about what's happening π’-q,--quietβ turn the output verbosity down. Each use drops it another level (less than zero doesn't make sense, bestie), from the default of one. Shhh, she's concentrating π€«-V,--versionβ just shows the program version and dips. That's it, that's the whole job βοΈ
π¨ SIGNAL HANDLING π¨
When you're executing jobs via LUXI (that's with the -X option, iykyk), hbal normally just runs all the jobs until either one of them errors out or every last one finishes successfully. Simple.
But balancing can take a long time, so there are two ways to stop hbal early:
- send a
SIGINT(^C) and hbal will register that you want it to stop, then wait until the currently submitted jobs finish, and at that point it'll exit. The exit code will be0if all the jobs finished correctly, otherwise1as usual. She's polite, she finishes her plate first π½οΈ - send a
SIGTERMand hbal will immediately exit with exit code2. And here's the thing β it is your responsibility to follow up with Ganeti and check the result of the jobs that were currently executing. You're on your own for that part, bestie, she's gone π
Also, in any situation, it's perfectly safe to kill hbal. Whether it's via the signals above or literally any other signal (likeSIGQUIT,SIGKILL, whatever you want), because the jobs themselves are processed by Ganeti, and hbal (after submission) is only sitting there watching their progression. So if you do that, you'll just have to query Ganeti for the job results yourself. No drama, no corruption. π«Ά
π« EXIT STATUS π«
The exit status of the command will be zero, unless for some reason the algorithm failed (like, wrong node data or wrong instance data), or there were invalid command line options, or β in the case of job execution β one of the jobs has failed. Basically zero means we vibed, non-zero means something went sideways. π
And once job execution via Luxi has started (-X), here's the tea: if the balancing got interrupted early (via SIGINT, or via --max-length) but all the jobs that did execute succeeded, then the exit status is still zero. A non-zero exit code means you should go investigate the cluster state, because either a job failed, or we couldn't compute its status β and that second one can also point to a problem on the Ganeti side. Don't ignore it, go look. π
π BUGS π
The program does not check all of its input data for consistency, and sometimes it'll just abort with cryptic error messages when you feed it invalid data. Not the cutest look, but here we are π
Also: the algorithm is not perfect. She's doing her best, okay? π
okay we're not done yet, keep scrolling bestie β there's more coming πΈ
πΈ EXAMPLE πΈ
Heads up bestie: these examples are not for the latest version (they don't have full node data). Just so you know what you're looking at. π
β¨ Default output β¨
Okay so with the plain default options, hbal literally shows you every single step it takes and the glow-up it brings to your cluster score. It's giving before-and-after. π
$ hbal
Loaded 20 nodes, 80 instances
Cluster is not N+1 happy, continuing but no guarantee that the cluster will end N+1 happy.
Initial score: 0.52329131
Trying to minimize the CV...
1. instance14 node1:node10 => node16:node10 0.42109120 a=f r:node16 f
2. instance54 node4:node15 => node16:node15 0.31904594 a=f r:node16 f
3. instance4 node5:node2 => node2:node16 0.26611015 a=f r:node16
4. instance48 node18:node20 => node2:node18 0.21361717 a=r:node2 f
5. instance93 node19:node18 => node16:node19 0.16166425 a=r:node16 f
6. instance89 node3:node20 => node2:node3 0.11005629 a=r:node2 f
7. instance5 node6:node2 => node16:node6 0.05841589 a=r:node16 f
8. instance94 node7:node20 => node20:node16 0.00658759 a=f r:node16
9. instance44 node20:node2 => node2:node15 0.00438740 a=f r:node15
10. instance62 node14:node18 => node14:node16 0.00390087 a=r:node16
11. instance13 node11:node14 => node11:node16 0.00361787 a=r:node16
12. instance19 node10:node11 => node10:node7 0.00336636 a=r:node7
13. instance43 node12:node13 => node12:node1 0.00305681 a=r:node1
14. instance1 node1:node2 => node1:node4 0.00263124 a=r:node4
15. instance58 node19:node20 => node19:node17 0.00252594 a=r:node17
Cluster score improved from 0.52329131 to 0.00252594
So like, what are we even looking at here? Let me break it down for you, no gatekeeping π :
- the input data (in this case coming from files) shows a cluster with 20 nodes and 80 instances
- the cluster is not initially N+1 compliant
- the initial score is
0.52329131
Then the step list rolls in, and it shows the instance, its initial primary/secondary nodes, the new primary secondary, the cluster list, and the actions taken in that step β where 'f' means failover/migrate and 'r' means replace secondary. iykyk π«Ά
And finally? The program flexes the improvement in cluster score. Slay.
π¦ A more detailed output π¦
Wanna see everything? Pass the -C and -p options and it gets so much more extra (affectionate):
$ hbal
Loaded 20 nodes, 80 instances
Cluster is not N+1 happy, continuing but no guarantee that the cluster will end N+1 happy.
Initial cluster status:
N1 Name t_mem f_mem r_mem t_dsk f_dsk pri sec p_fmem p_fdsk
* node1 32762 1280 6000 1861 1026 5 3 0.03907 0.55179
node2 32762 31280 12000 1861 1026 0 8 0.95476 0.55179
* node3 32762 1280 6000 1861 1026 5 3 0.03907 0.55179
* node4 32762 1280 6000 1861 1026 5 3 0.03907 0.55179
* node5 32762 1280 6000 1861 978 5 5 0.03907 0.52573
* node6 32762 1280 6000 1861 1026 5 3 0.03907 0.55179
* node7 32762 1280 6000 1861 1026 5 3 0.03907 0.55179
node8 32762 7280 6000 1861 1026 4 4 0.22221 0.55179
node9 32762 7280 6000 1861 1026 4 4 0.22221 0.55179
* node10 32762 7280 12000 1861 1026 4 4 0.22221 0.55179
node11 32762 7280 6000 1861 922 4 5 0.22221 0.49577
node12 32762 7280 6000 1861 1026 4 4 0.22221 0.55179
node13 32762 7280 6000 1861 922 4 5 0.22221 0.49577
node14 32762 7280 6000 1861 922 4 5 0.22221 0.49577
* node15 32762 7280 12000 1861 1131 4 3 0.22221 0.60782
node16 32762 31280 0 1861 1860 0 0 0.95476 1.00000
node17 32762 7280 6000 1861 1106 5 3 0.22221 0.59479
* node18 32762 1280 6000 1396 561 5 3 0.03907 0.40239
* node19 32762 1280 6000 1861 1026 5 3 0.03907 0.55179
node20 32762 13280 12000 1861 689 3 9 0.40535 0.37068
Initial score: 0.52329131
Trying to minimize the CV...
1. instance14 node1:node10 => node16:node10 0.42109120 a=f r:node16 f
2. instance54 node4:node15 => node16:node15 0.31904594 a=f r:node16 f
3. instance4 node5:node2 => node2:node16 0.26611015 a=f r:node16
4. instance48 node18:node20 => node2:node18 0.21361717 a=r:node2 f
5. instance93 node19:node18 => node16:node19 0.16166425 a=r:node16 f
6. instance89 node3:node20 => node2:node3 0.11005629 a=r:node2 f
7. instance5 node6:node2 => node16:node6 0.05841589 a=r:node16 f
8. instance94 node7:node20 => node20:node16 0.00658759 a=f r:node16
9. instance44 node20:node2 => node2:node15 0.00438740 a=f r:node15
10. instance62 node14:node18 => node14:node16 0.00390087 a=r:node16
11. instance13 node11:node14 => node11:node16 0.00361787 a=r:node16
12. instance19 node10:node11 => node10:node7 0.00336636 a=r:node7
13. instance43 node12:node13 => node12:node1 0.00305681 a=r:node1
14. instance1 node1:node2 => node1:node4 0.00263124 a=r:node4
15. instance58 node19:node20 => node19:node17 0.00252594 a=r:node17
Cluster score improved from 0.52329131 to 0.00252594
Commands to run to reach the above solution:
echo step 1
echo gnt-instance migrate instance14
echo gnt-instance replace-disks -n node16 instance14
echo gnt-instance migrate instance14
echo step 2
echo gnt-instance migrate instance54
echo gnt-instance replace-disks -n node16 instance54
echo gnt-instance migrate instance54
echo step 3
echo gnt-instance migrate instance4
echo gnt-instance replace-disks -n node16 instance4
echo step 4
echo gnt-instance replace-disks -n node2 instance48
echo gnt-instance migrate instance48
echo step 5
echo gnt-instance replace-disks -n node16 instance93
echo gnt-instance migrate instance93
echo step 6
echo gnt-instance replace-disks -n node2 instance89
echo gnt-instance migrate instance89
echo step 7
echo gnt-instance replace-disks -n node16 instance5
echo gnt-instance migrate instance5
echo step 8
echo gnt-instance migrate instance94
echo gnt-instance replace-disks -n node16 instance94
echo step 9
echo gnt-instance migrate instance44
echo gnt-instance replace-disks -n node15 instance44
echo step 10
echo gnt-instance replace-disks -n node16 instance62
echo step 11
echo gnt-instance replace-disks -n node16 instance13
echo step 12
echo gnt-instance replace-disks -n node7 instance19
echo step 13
echo gnt-instance replace-disks -n node1 instance43
echo step 14
echo gnt-instance replace-disks -n node4 instance1
echo step 15
echo gnt-instance replace-disks -n node17 instance58
Final cluster status:
N1 Name t_mem f_mem r_mem t_dsk f_dsk pri sec p_fmem p_fdsk
node1 32762 7280 6000 1861 1026 4 4 0.22221 0.55179
node2 32762 7280 6000 1861 1026 4 4 0.22221 0.55179
node3 32762 7280 6000 1861 1026 4 4 0.22221 0.55179
node4 32762 7280 6000 1861 1026 4 4 0.22221 0.55179
node5 32762 7280 6000 1861 1078 4 5 0.22221 0.57947
node6 32762 7280 6000 1861 1026 4 4 0.22221 0.55179
node7 32762 7280 6000 1861 1026 4 4 0.22221 0.55179
node8 32762 7280 6000 1861 1026 4 4 0.22221 0.55179
node9 32762 7280 6000 1861 1026 4 4 0.22221 0.55179
node10 32762 7280 6000 1861 1026 4 4 0.22221 0.55179
node11 32762 7280 6000 1861 1022 4 4 0.22221 0.54951
node12 32762 7280 6000 1861 1026 4 4 0.22221 0.55179
node13 32762 7280 6000 1861 1022 4 4 0.22221 0.54951
node14 32762 7280 6000 1861 1022 4 4 0.22221 0.54951
node15 32762 7280 6000 1861 1031 4 4 0.22221 0.55408
node16 32762 7280 6000 1861 1060 4 4 0.22221 0.57007
node17 32762 7280 6000 1861 1006 5 4 0.22221 0.54105
node18 32762 7280 6000 1396 761 4 2 0.22221 0.54570
node19 32762 7280 6000 1861 1026 4 4 0.22221 0.55179
node20 32762 13280 6000 1861 1089 3 5 0.40535 0.58565
So here we get, next to the step list, the initial and final cluster status β and the final one shows literally all nodes being N+1 compliant π β plus the command list to reach the final solution. And in that initial listing, you can clock exactly which nodes are not N+1 compliant. Iconic.
WAIT. Important: the algorithm is stable as long as each step above is fully completed, like, e.g. in step 8, both the migrate and the replace-disks get done. Otherwise β if only the migrate is done β the input data gets changed in a way that the program will output a different solution list (but hopefully will end in the same state). π So don't half-do the steps, bestie, fr fr.
π REPORTING BUGS π
Found a bug? Report it to the project's issue tracker, or hit up the developers using the Ganeti mailing list. They wanna hear it, promise π«Ά
π SEE ALSO π
Ganeti overview and specifications: ganeti(7) (general overview), ganeti-os-interface(7) (guest OS definitions), ganeti-extstorage-interface(7) (external storage providers).
Ganeti commands: gnt-cluster(8) (cluster-wide commands), gnt-job(8) (job-related commands), gnt-node(8) (node-related commands), gnt-instance(8) (instance commands), gnt-os(8) (guest OS commands), gnt-storage(8) (storage commands), gnt-group(8) (node group commands), gnt-backup(8) (instance import/export commands), gnt-debug(8) (debug commands).
Ganeti daemons: ganeti-watcher(8) (automatic instance restarter), ganeti-cleaner(8) (job queue cleaner), ganeti-noded(8) (node daemon), ganeti-rapi(8) (remote API daemon).
Ganeti htools: htools(1) (generic binary), hbal(1) (cluster balancer), hspace(1) (capacity calculation), hail(1) (IAllocator plugin), hscan(1) (data gatherer from remote clusters), hinfo(1) (cluster information printer), mon-collector(7) (data collectors interface).
π COPYRIGHT π
okay bestie, final section, and yeah it's the legal one π«Ά β but don't scroll past it, it's lowkey doing the most important job here.
Copyright (C) 2006-2015 Google Inc. All rights reserved.
so the way that Google was like "here, take it, it's yours" π β redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
then comes the big all-caps moment, and honestly it's giving "we are not liable for a single thing, periodt" π :
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
no cap: that whole block means if this thing eats your cluster, your data, or your entire weekend π β that's on you, not on the copyright holders. "AS IS" is carrying the entire team on its back here, fr fr.
and that's the whole page, bestie πΈ you made it to the end of a very long man page and honestly? iconic behavior. this one ships out of Ganeti and it's filed under HBAL(1) in your friendly neighborhood manual section. now go forth and read the docs like the main character you are πβ¨
π¦ where this page comes from
- debian trixie: ganeti-htools-3.1 3.1.0~rc2-3 Β· BSD-2-Clause
- ubuntu questing: ganeti-htools-3.1 3.1.0~rc2-4
- ubuntu resolute: ganeti-htools-3.1 3.1.0~rc2-4build1 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms