Statistics
| Branch: | Tag: | Revision:

root / hbal.1 @ 73b2e389

History | View | Annotate | Download (25.1 kB)

1
.TH HBAL 1 2009-03-23 htools "Ganeti H-tools"
2
.SH NAME
3
hbal \- Cluster balancer for Ganeti
4

    
5
.SH SYNOPSIS
6
.B hbal
7
.B "[backend options...]"
8
.B "[algorithm options...]"
9
.B "[reporting options...]"
10

    
11
.B hbal
12
.B --version
13

    
14
.TP
15
Backend options:
16
.BI "[ -m " cluster " ]"
17
|
18
.BI "[ -L[" path "] [-X]]"
19
|
20
.BI "[ -n " nodes-file " ]"
21
.BI "[ -i " instances-file " ]"
22

    
23
.TP
24
Algorithm options:
25
.BI "[ --max-cpu " cpu-ratio " ]"
26
.BI "[ --min-disk " disk-ratio " ]"
27
.BI "[ -l " limit " ]"
28
.BI "[ -e " score " ]"
29
.BI "[ -O " name... " ]"
30
.B "[ --no-disk-moves ]"
31
.BI "[ -U " util-file " ]"
32

    
33
.TP
34
Reporting options:
35
.BI "[ -C[" file "] ]"
36
.BI "[ -p[" fields "] ]"
37
.B "[ --print-instances ]"
38
.B "[ -o ]"
39
.B "[ -v... | -q ]"
40

    
41

    
42
.SH DESCRIPTION
43
hbal is a cluster balancer that looks at the current state of the
44
cluster (nodes with their total and free disk, memory, etc.) and
45
instance placement and computes a series of steps designed to bring
46
the cluster into a better state.
47

    
48
The algorithm used is designed to be stable (i.e. it will give you the
49
same results when restarting it from the middle of the solution) and
50
reasonably fast. It is not, however, designed to be a perfect
51
algorithm \(em it is possible to make it go into a corner from which
52
it can find no improvement, because it looks only one "step" ahead.
53

    
54
By default, the program will show the solution incrementally as it is
55
computed, in a somewhat cryptic format; for getting the actual Ganeti
56
command list, use the \fB-C\fR option.
57

    
58
.SS ALGORITHM
59

    
60
The program works in independent steps; at each step, we compute the
61
best instance move that lowers the cluster score.
62

    
63
The possible move type for an instance are combinations of
64
failover/migrate and replace-disks such that we change one of the
65
instance nodes, and the other one remains (but possibly with changed
66
role, e.g. from primary it becomes secondary). The list is:
67
.RS 4
68
.TP 3
69
\(em
70
failover (f)
71
.TP
72
\(em
73
replace secondary (r)
74
.TP
75
\(em
76
replace primary, a composite move (f, r, f)
77
.TP
78
\(em
79
failover and replace secondary, also composite (f, r)
80
.TP
81
\(em
82
replace secondary and failover, also composite (r, f)
83
.RE
84

    
85
We don't do the only remaining possibility of replacing both nodes
86
(r,f,r,f or the equivalent f,r,f,r) since these move needs an
87
exhaustive search over both candidate primary and secondary nodes, and
88
is O(n*n) in the number of nodes. Furthermore, it doesn't seems to
89
give better scores but will result in more disk replacements.
90

    
91
.SS PLACEMENT RESTRICTIONS
92

    
93
At each step, we prevent an instance move if it would cause:
94

    
95
.RS 4
96
.TP 3
97
\(em
98
a node to go into N+1 failure state
99
.TP
100
\(em
101
an instance to move onto an offline node (offline nodes are either
102
read from the cluster or declared with \fI-O\fR)
103
.TP
104
\(em
105
an exclusion-tag based conflict (exclusion tags are read from the
106
cluster and/or defined via the \fI--exclusion-tags\fR option)
107
.TP
108
\(em
109
a max vcpu/pcpu ratio to be exceeded (configured via \fI--max-cpu\fR)
110
.TP
111
\(em
112
min disk free percentage to go below the configured limit (configured
113
via \fI--min-disk\fR)
114

    
115
.SS CLUSTER SCORING
116

    
117
As said before, the algorithm tries to minimise the cluster score at
118
each step. Currently this score is computed as a sum of the following
119
components:
120
.RS 4
121
.TP 3
122
\(em
123
coefficient of variance of the percent of free memory
124
.TP
125
\(em
126
coefficient of variance of the percent of reserved memory
127
.TP
128
\(em
129
coefficient of variance of the percent of free disk
130
.TP
131
\(em
132
percentage of nodes failing N+1 check
133
.TP
134
\(em
135
percentage of instances living (either as primary or secondary) on
136
offline nodes
137
.TP
138
\(em
139
coefficent of variance of the ratio of virtual-to-physical cpus (for
140
primary instaces of the node)
141
.TP
142
\(em
143
coefficients of variance of the dynamic load on the nodes, for cpus,
144
memory, disk and network
145
.RE
146

    
147
The free memory and free disk values help ensure that all nodes are
148
somewhat balanced in their resource usage. The reserved memory helps
149
to ensure that nodes are somewhat balanced in holding secondary
150
instances, and that no node keeps too much memory reserved for
151
N+1. And finally, the N+1 percentage helps guide the algorithm towards
152
eliminating N+1 failures, if possible.
153

    
154
Except for the N+1 failures and offline instances percentage, we use
155
the coefficient of variance since this brings the values into the same
156
unit so to speak, and with a restrict domain of values (between zero
157
and one). The percentage of N+1 failures, while also in this numeric
158
range, doesn't actually has the same meaning, but it has shown to work
159
well.
160

    
161
The other alternative, using for N+1 checks the coefficient of
162
variance of (N+1 fail=1, N+1 pass=0) across nodes could hint the
163
algorithm to make more N+1 failures if most nodes are N+1 fail
164
already. Since this (making N+1 failures) is not allowed by other
165
rules of the algorithm, so the N+1 checks would simply not work
166
anymore in this case.
167

    
168
The offline instances percentage (meaning the percentage of instances
169
living on offline nodes) will cause the algorithm to actively move
170
instances away from offline nodes. This, coupled with the restriction
171
on placement given by offline nodes, will cause evacuation of such
172
nodes.
173

    
174
The dynamic load values need to be read from an external file (Ganeti
175
doesn't supply them), and are computed for each node as: sum of
176
primary instance cpu load, sum of primary instance memory load, sum of
177
primary and secondary instance disk load (as DRBD generates write load
178
on secondary nodes too in normal case and in degraded scenarios also
179
read load), and sum of primary instance network load. An example of
180
how to generate these values for input to hbal would be to track "xm
181
list" for instance over a day and by computing the delta of the cpu
182
values, and feed that via the \fI-U\fR option for all instances (and
183
keep the other metrics as one). For the algorithm to work, all that is
184
needed is that the values are consistent for a metric across all
185
instances (e.g. all instances use cpu% to report cpu usage, but they
186
could represent network bandwith in Gbps). Note that it's recommended
187
to not have zero as the load value for any instance metric since then
188
secondary instances are not well balanced.
189

    
190
On a perfectly balanced cluster (all nodes the same size, all
191
instances the same size and spread across the nodes equally), the
192
values for all metrics would be zero. This doesn't happen too often in
193
practice :)
194

    
195
.SS OFFLINE INSTANCES
196

    
197
Since current Ganeti versions do not report the memory used by offline
198
(down) instances, ignoring the run status of instances will cause
199
wrong calculations. For this reason, the algorithm subtracts the
200
memory size of down instances from the free node memory of their
201
primary node, in effect simulating the startup of such instances.
202

    
203
.SS EXCLUSION TAGS
204

    
205
The exclusion tags mecanism is designed to prevent instances which run
206
the same workload (e.g. two DNS servers) to land on the same node,
207
which would make the respective node a SPOF for the given service.
208

    
209
It works by tagging instances with certain tags and then building
210
exclusion maps based on these. Which tags are actually used is
211
configured either via the command line (option \fI--exclusion-tags\fR)
212
or via adding them to the cluster tags:
213

    
214
.TP
215
.B --exclusion-tags=a,b
216
This will make all instance tags of the form \fIa:*\fR, \fIb:*\fR be
217
considered for the exclusion map
218

    
219
.TP
220
cluster tags \fBhtools:iextags:a\fR, \fBhtools:iextags:b\fR
221
This will make instance tags \fIa:*\fR, \fIb:*\fR be considered for
222
the exclusion map. More precisely, the suffix of cluster tags starting
223
with \fBhtools:iextags:\fR will become the prefix of the exclusion
224
tags.
225

    
226
.P
227
Both the above forms mean that two instances both having (e.g.) the
228
tag \fIa:foo\fR or \fIb:bar\fR won't end on the same node.
229

    
230
.SH OPTIONS
231
The options that can be passed to the program are as follows:
232
.TP
233
.B -C, --print-commands
234
Print the command list at the end of the run. Without this, the
235
program will only show a shorter, but cryptic output.
236

    
237
Note that the moves list will be split into independent steps, called
238
"jobsets", but only for visual inspection, not for actually
239
parallelisation. It is not possible to parallelise these directly when
240
executed via "gnt-instance" commands, since a compound command
241
(e.g. failover and replace\-disks) must be executed serially. Parallel
242
execution is only possible when using the Luxi backend and the
243
\fI-L\fR option.
244

    
245
The algorithm for splitting the moves into jobsets is by accumulating
246
moves until the next move is touching nodes already touched by the
247
current moves; this means we can't execute in parallel (due to
248
resource allocation in Ganeti) and thus we start a new jobset.
249

    
250
.TP
251
.B -p, --print-nodes
252
Prints the before and after node status, in a format designed to allow
253
the user to understand the node's most important parameters.
254

    
255
It is possible to customise the listed information by passing a
256
comma\(hyseparated list of field names to this option (the field list is
257
currently undocumented). By default, the node list will contain these
258
informations:
259
.RS
260
.TP
261
.B F
262
a character denoting the status of the node, with '\-' meaning an
263
offline node, '*' meaning N+1 failure and blank meaning a good node
264
.TP
265
.B Name
266
the node name
267
.TP
268
.B t_mem
269
the total node memory
270
.TP
271
.B n_mem
272
the memory used by the node itself
273
.TP
274
.B i_mem
275
the memory used by instances
276
.TP
277
.B x_mem
278
amount memory which seems to be in use but cannot be determined why or
279
by which instance; usually this means that the hypervisor has some
280
overhead or that there are other reporting errors
281
.TP
282
.B f_mem
283
the free node memory
284
.TP
285
.B r_mem
286
the reserved node memory, which is the amount of free memory needed
287
for N+1 compliance
288
.TP
289
.B t_dsk
290
total disk
291
.TP
292
.B f_dsk
293
free disk
294
.TP
295
.B pcpu
296
the number of physical cpus on the node
297
.TP
298
.B vcpu
299
the number of virtual cpus allocated to primary instances
300
.TP
301
.B pri
302
number of primary instances
303
.TP
304
.B sec
305
number of secondary instances
306
.TP
307
.B p_fmem
308
percent of free memory
309
.TP
310
.B p_fdsk
311
percent of free disk
312
.TP
313
.B r_cpu
314
ratio of virtual to physical cpus
315
.TP
316
.B lCpu
317
the dynamic CPU load (if the information is available)
318
.TP
319
.B lMem
320
the dynamic memory load (if the information is available)
321
.TP
322
.B lDsk
323
the dynamic disk load (if the information is available)
324
.TP
325
.B lNet
326
the dynamic net load (if the information is available)
327
.RE
328

    
329
.TP
330
.B --print-instances
331
Prints the before and after instance map. This is less useful as the
332
node status, but it can help in understanding instance moves.
333

    
334
.TP
335
.B -o, --oneline
336
Only shows a one\(hyline output from the program, designed for the case
337
when one wants to look at multiple clusters at once and check their
338
status.
339

    
340
The line will contain four fields:
341
.RS
342
.RS 4
343
.TP 3
344
\(em
345
initial cluster score
346
.TP
347
\(em
348
number of steps in the solution
349
.TP
350
\(em
351
final cluster score
352
.TP
353
\(em
354
improvement in the cluster score
355
.RE
356
.RE
357

    
358
.TP
359
.BI "-O " name
360
This option (which can be given multiple times) will mark nodes as
361
being \fIoffline\fR. This means a couple of things:
362
.RS
363
.RS 4
364
.TP 3
365
\(em
366
instances won't be placed on these nodes, not even temporarily;
367
e.g. the \fIreplace primary\fR move is not available if the secondary
368
node is offline, since this move requires a failover.
369
.TP
370
\(em
371
these nodes will not be included in the score calculation (except for
372
the percentage of instances on offline nodes)
373
.RE
374
Note that hbal will also mark as offline any nodes which are reported
375
by RAPI as such, or that have "?" in file\(hybased input in any numeric
376
fields.
377
.RE
378

    
379
.TP
380
.BI "-e" score ", --min-score=" score
381
This parameter denotes the minimum score we are happy with and alters
382
the computation in two ways:
383
.RS
384
.RS 4
385
.TP 3
386
\(em
387
if the cluster has the initial score lower than this value, then we
388
don't enter the algorithm at all, and exit with success
389
.TP
390
\(em
391
during the iterative process, if we reach a score lower than this
392
value, we exit the algorithm
393
.RE
394
The default value of the parameter is currently \fI1e-9\fR (chosen
395
empirically).
396
.RE
397

    
398
.TP
399
.BI "--no-disk-moves"
400
This parameter prevents hbal from using disk move (i.e. "gnt\-instance
401
replace\-disks") operations. This will result in a much quicker
402
balancing, but of course the improvements are limited. It is up to the
403
user to decide when to use one or another.
404

    
405
.TP
406
.BI "-U" util-file
407
This parameter specifies a file holding instance dynamic utilisation
408
information that will be used to tweak the balancing algorithm to
409
equalise load on the nodes (as opposed to static resource usage). The
410
file is in the format "instance_name cpu_util mem_util disk_util
411
net_util" where the "_util" parameters are interpreted as numbers and
412
the instance name must match exactly the instance as read from
413
Ganeti. In case of unknown instance names, the program will abort.
414

    
415
If not given, the default values are one for all metrics and thus
416
dynamic utilisation has only one effect on the algorithm: the
417
equalisation of the secondary instances across nodes (this is the only
418
metric that is not tracked by another, dedicated value, and thus the
419
disk load of instances will cause secondary instance
420
equalisation). Note that value of one will also influence slightly the
421
primary instance count, but that is already tracked via other metrics
422
and thus the influence of the dynamic utilisation will be practically
423
insignificant.
424

    
425
.TP
426
.BI "-n" nodefile ", --nodes=" nodefile
427
The name of the file holding node information (if not collecting via
428
RAPI), instead of the default \fInodes\fR file (but see below how to
429
customize the default value via the environment).
430

    
431
.TP
432
.BI "-i" instancefile ", --instances=" instancefile
433
The name of the file holding instance information (if not collecting
434
via RAPI), instead of the default \fIinstances\fR file (but see below
435
how to customize the default value via the environment).
436

    
437
.TP
438
.BI "-m" cluster
439
Collect data not from files but directly from the
440
.I cluster
441
given as an argument via RAPI. If the argument doesn't contain a colon
442
(:), then it is converted into a fully\(hybuilt URL via prepending
443
https:// and appending the default RAPI port, otherwise it's
444
considered a fully\(hyspecified URL and is used as\(hyis.
445

    
446
.TP
447
.BI "-L[" path "]"
448
Collect data not from files but directly from the master daemon, which
449
is to be contacted via the luxi (an internal Ganeti protocol). An
450
optional \fIpath\fR argument is interpreted as the path to the unix
451
socket on which the master daemon listens; otherwise, the default path
452
used by ganeti when installed with \fI--localstatedir=/var\fR is used.
453

    
454
.TP
455
.B "-X"
456
When using the Luxi backend, hbal can also execute the given
457
commands. The execution method is to execute the individual jobsets
458
(see the \fI-C\fR option for details) in separate stages, aborting if
459
at any time a jobset doesn't have all jobs successful. Each step in
460
the balancing solution will be translated into exactly one Ganeti job
461
(having between one and three OpCodes), and all the steps in a jobset
462
will be executed in parallel. The jobsets themselves are executed
463
serially.
464

    
465
.TP
466
.BI "-l" N ", --max-length=" N
467
Restrict the solution to this length. This can be used for example to
468
automate the execution of the balancing.
469

    
470
.TP
471
.BI "--max-cpu " cpu-ratio
472
The maximum virtual\(hyto\(hyphysical cpu ratio, as a floating point
473
number between zero and one. For example, specifying \fIcpu-ratio\fR
474
as \fB2.5\fR means that, for a 4\(hycpu machine, a maximum of 10
475
virtual cpus should be allowed to be in use for primary instances. A
476
value of one doesn't make sense though, as that means no disk space
477
can be used on it.
478

    
479
.TP
480
.BI "--min-disk " disk-ratio
481
The minimum amount of free disk space remaining, as a floating point
482
number. For example, specifying \fIdisk-ratio\fR as \fB0.25\fR means
483
that at least one quarter of disk space should be left free on nodes.
484

    
485
.TP
486
.B -v, --verbose
487
Increase the output verbosity. Each usage of this option will increase
488
the verbosity (currently more than 2 doesn't make sense) from the
489
default of one.
490

    
491
.TP
492
.B -q, --quiet
493
Decrease the output verbosity. Each usage of this option will decrease
494
the verbosity (less than zero doesn't make sense) from the default of
495
one.
496

    
497
.TP
498
.B -V, --version
499
Just show the program version and exit.
500

    
501
.SH EXIT STATUS
502

    
503
The exist status of the command will be zero, unless for some reason
504
the algorithm fatally failed (e.g. wrong node or instance data).
505

    
506
.SH ENVIRONMENT
507

    
508
If the variables \fBHTOOLS_NODES\fR and \fBHTOOLS_INSTANCES\fR are
509
present in the environment, they will override the default names for
510
the nodes and instances files. These will have of course no effect
511
when the RAPI or Luxi backends are used.
512

    
513
.SH BUGS
514

    
515
The program does not check its input data for consistency, and aborts
516
with cryptic errors messages in this case.
517

    
518
The algorithm is not perfect.
519

    
520
The output format is not easily scriptable, and the program should
521
feed moves directly into Ganeti (either via RAPI or via a gnt\-debug
522
input file).
523

    
524
.SH EXAMPLE
525

    
526
Note that this example are not for the latest version (they don't have
527
full node data).
528

    
529
.SS Default output
530

    
531
With the default options, the program shows each individual step and
532
the improvements it brings in cluster score:
533

    
534
.in +4n
535
.nf
536
.RB "$" " hbal"
537
Loaded 20 nodes, 80 instances
538
Cluster is not N+1 happy, continuing but no guarantee that the cluster will end N+1 happy.
539
Initial score: 0.52329131
540
Trying to minimize the CV...
541
    1. instance14  node1:node10  => node16:node10 0.42109120 a=f r:node16 f
542
    2. instance54  node4:node15  => node16:node15 0.31904594 a=f r:node16 f
543
    3. instance4   node5:node2   => node2:node16  0.26611015 a=f r:node16
544
    4. instance48  node18:node20 => node2:node18  0.21361717 a=r:node2 f
545
    5. instance93  node19:node18 => node16:node19 0.16166425 a=r:node16 f
546
    6. instance89  node3:node20  => node2:node3   0.11005629 a=r:node2 f
547
    7. instance5   node6:node2   => node16:node6  0.05841589 a=r:node16 f
548
    8. instance94  node7:node20  => node20:node16 0.00658759 a=f r:node16
549
    9. instance44  node20:node2  => node2:node15  0.00438740 a=f r:node15
550
   10. instance62  node14:node18 => node14:node16 0.00390087 a=r:node16
551
   11. instance13  node11:node14 => node11:node16 0.00361787 a=r:node16
552
   12. instance19  node10:node11 => node10:node7  0.00336636 a=r:node7
553
   13. instance43  node12:node13 => node12:node1  0.00305681 a=r:node1
554
   14. instance1   node1:node2   => node1:node4   0.00263124 a=r:node4
555
   15. instance58  node19:node20 => node19:node17 0.00252594 a=r:node17
556
Cluster score improved from 0.52329131 to 0.00252594
557
.fi
558
.in
559

    
560
In the above output, we can see:
561
  - the input data (here from files) shows a cluster with 20 nodes and
562
    80 instances
563
  - the cluster is not initially N+1 compliant
564
  - the initial score is 0.52329131
565

    
566
The step list follows, showing the instance, its initial
567
primary/secondary nodes, the new primary secondary, the cluster list,
568
and the actions taken in this step (with 'f' denoting failover/migrate
569
and 'r' denoting replace secondary).
570

    
571
Finally, the program shows the improvement in cluster score.
572

    
573
A more detailed output is obtained via the \fB-C\fR and \fB-p\fR options:
574

    
575
.in +4n
576
.nf
577
.RB "$" " hbal"
578
Loaded 20 nodes, 80 instances
579
Cluster is not N+1 happy, continuing but no guarantee that the cluster will end N+1 happy.
580
Initial cluster status:
581
N1 Name   t_mem f_mem r_mem t_dsk f_dsk pri sec  p_fmem  p_fdsk
582
 * node1  32762  1280  6000  1861  1026   5   3 0.03907 0.55179
583
   node2  32762 31280 12000  1861  1026   0   8 0.95476 0.55179
584
 * node3  32762  1280  6000  1861  1026   5   3 0.03907 0.55179
585
 * node4  32762  1280  6000  1861  1026   5   3 0.03907 0.55179
586
 * node5  32762  1280  6000  1861   978   5   5 0.03907 0.52573
587
 * node6  32762  1280  6000  1861  1026   5   3 0.03907 0.55179
588
 * node7  32762  1280  6000  1861  1026   5   3 0.03907 0.55179
589
   node8  32762  7280  6000  1861  1026   4   4 0.22221 0.55179
590
   node9  32762  7280  6000  1861  1026   4   4 0.22221 0.55179
591
 * node10 32762  7280 12000  1861  1026   4   4 0.22221 0.55179
592
   node11 32762  7280  6000  1861   922   4   5 0.22221 0.49577
593
   node12 32762  7280  6000  1861  1026   4   4 0.22221 0.55179
594
   node13 32762  7280  6000  1861   922   4   5 0.22221 0.49577
595
   node14 32762  7280  6000  1861   922   4   5 0.22221 0.49577
596
 * node15 32762  7280 12000  1861  1131   4   3 0.22221 0.60782
597
   node16 32762 31280     0  1861  1860   0   0 0.95476 1.00000
598
   node17 32762  7280  6000  1861  1106   5   3 0.22221 0.59479
599
 * node18 32762  1280  6000  1396   561   5   3 0.03907 0.40239
600
 * node19 32762  1280  6000  1861  1026   5   3 0.03907 0.55179
601
   node20 32762 13280 12000  1861   689   3   9 0.40535 0.37068
602

    
603
Initial score: 0.52329131
604
Trying to minimize the CV...
605
    1. instance14  node1:node10  => node16:node10 0.42109120 a=f r:node16 f
606
    2. instance54  node4:node15  => node16:node15 0.31904594 a=f r:node16 f
607
    3. instance4   node5:node2   => node2:node16  0.26611015 a=f r:node16
608
    4. instance48  node18:node20 => node2:node18  0.21361717 a=r:node2 f
609
    5. instance93  node19:node18 => node16:node19 0.16166425 a=r:node16 f
610
    6. instance89  node3:node20  => node2:node3   0.11005629 a=r:node2 f
611
    7. instance5   node6:node2   => node16:node6  0.05841589 a=r:node16 f
612
    8. instance94  node7:node20  => node20:node16 0.00658759 a=f r:node16
613
    9. instance44  node20:node2  => node2:node15  0.00438740 a=f r:node15
614
   10. instance62  node14:node18 => node14:node16 0.00390087 a=r:node16
615
   11. instance13  node11:node14 => node11:node16 0.00361787 a=r:node16
616
   12. instance19  node10:node11 => node10:node7  0.00336636 a=r:node7
617
   13. instance43  node12:node13 => node12:node1  0.00305681 a=r:node1
618
   14. instance1   node1:node2   => node1:node4   0.00263124 a=r:node4
619
   15. instance58  node19:node20 => node19:node17 0.00252594 a=r:node17
620
Cluster score improved from 0.52329131 to 0.00252594
621

    
622
Commands to run to reach the above solution:
623
  echo step 1
624
  echo gnt\-instance migrate instance14
625
  echo gnt\-instance replace\-disks \-n node16 instance14
626
  echo gnt\-instance migrate instance14
627
  echo step 2
628
  echo gnt\-instance migrate instance54
629
  echo gnt\-instance replace\-disks \-n node16 instance54
630
  echo gnt\-instance migrate instance54
631
  echo step 3
632
  echo gnt\-instance migrate instance4
633
  echo gnt\-instance replace\-disks \-n node16 instance4
634
  echo step 4
635
  echo gnt\-instance replace\-disks \-n node2 instance48
636
  echo gnt\-instance migrate instance48
637
  echo step 5
638
  echo gnt\-instance replace\-disks \-n node16 instance93
639
  echo gnt\-instance migrate instance93
640
  echo step 6
641
  echo gnt\-instance replace\-disks \-n node2 instance89
642
  echo gnt\-instance migrate instance89
643
  echo step 7
644
  echo gnt\-instance replace\-disks \-n node16 instance5
645
  echo gnt\-instance migrate instance5
646
  echo step 8
647
  echo gnt\-instance migrate instance94
648
  echo gnt\-instance replace\-disks \-n node16 instance94
649
  echo step 9
650
  echo gnt\-instance migrate instance44
651
  echo gnt\-instance replace\-disks \-n node15 instance44
652
  echo step 10
653
  echo gnt\-instance replace\-disks \-n node16 instance62
654
  echo step 11
655
  echo gnt\-instance replace\-disks \-n node16 instance13
656
  echo step 12
657
  echo gnt\-instance replace\-disks \-n node7 instance19
658
  echo step 13
659
  echo gnt\-instance replace\-disks \-n node1 instance43
660
  echo step 14
661
  echo gnt\-instance replace\-disks \-n node4 instance1
662
  echo step 15
663
  echo gnt\-instance replace\-disks \-n node17 instance58
664

    
665
Final cluster status:
666
N1 Name   t_mem f_mem r_mem t_dsk f_dsk pri sec  p_fmem  p_fdsk
667
   node1  32762  7280  6000  1861  1026   4   4 0.22221 0.55179
668
   node2  32762  7280  6000  1861  1026   4   4 0.22221 0.55179
669
   node3  32762  7280  6000  1861  1026   4   4 0.22221 0.55179
670
   node4  32762  7280  6000  1861  1026   4   4 0.22221 0.55179
671
   node5  32762  7280  6000  1861  1078   4   5 0.22221 0.57947
672
   node6  32762  7280  6000  1861  1026   4   4 0.22221 0.55179
673
   node7  32762  7280  6000  1861  1026   4   4 0.22221 0.55179
674
   node8  32762  7280  6000  1861  1026   4   4 0.22221 0.55179
675
   node9  32762  7280  6000  1861  1026   4   4 0.22221 0.55179
676
   node10 32762  7280  6000  1861  1026   4   4 0.22221 0.55179
677
   node11 32762  7280  6000  1861  1022   4   4 0.22221 0.54951
678
   node12 32762  7280  6000  1861  1026   4   4 0.22221 0.55179
679
   node13 32762  7280  6000  1861  1022   4   4 0.22221 0.54951
680
   node14 32762  7280  6000  1861  1022   4   4 0.22221 0.54951
681
   node15 32762  7280  6000  1861  1031   4   4 0.22221 0.55408
682
   node16 32762  7280  6000  1861  1060   4   4 0.22221 0.57007
683
   node17 32762  7280  6000  1861  1006   5   4 0.22221 0.54105
684
   node18 32762  7280  6000  1396   761   4   2 0.22221 0.54570
685
   node19 32762  7280  6000  1861  1026   4   4 0.22221 0.55179
686
   node20 32762 13280  6000  1861  1089   3   5 0.40535 0.58565
687

    
688
.fi
689
.in
690

    
691
Here we see, beside the step list, the initial and final cluster
692
status, with the final one showing all nodes being N+1 compliant, and
693
the command list to reach the final solution. In the initial listing,
694
we see which nodes are not N+1 compliant.
695

    
696
The algorithm is stable as long as each step above is fully completed,
697
e.g. in step 8, both the migrate and the replace\-disks are
698
done. Otherwise, if only the migrate is done, the input data is
699
changed in a way that the program will output a different solution
700
list (but hopefully will end in the same state).
701

    
702
.SH SEE ALSO
703
.BR hspace "(1), " hscan "(1), " hail "(1), "
704
.BR ganeti "(7), " gnt-instance "(8), " gnt-node "(8)"
705

    
706
.SH "COPYRIGHT"
707
.PP
708
Copyright (C) 2009 Google Inc. Permission is granted to copy,
709
distribute and/or modify under the terms of the GNU General Public
710
License as published by the Free Software Foundation; either version 2
711
of the License, or (at your option) any later version.
712
.PP
713
On Debian systems, the complete text of the GNU General Public License
714
can be found in /usr/share/common-licenses/GPL.