Statistics
| Branch: | Tag: | Revision:

root / hbal.1 @ ada2fc6d

History | View | Annotate | Download (25.3 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 "[ -t " data-file " ]"
21

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

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

    
42

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

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

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

    
59
.SS ALGORITHM
60

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

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

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

    
92
.SS PLACEMENT RESTRICTIONS
93

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

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

    
116
.SS CLUSTER SCORING
117

    
118
As said before, the algorithm tries to minimise the cluster score at
119
each step. Currently this score is computed as a sum of the following
120
components:
121
.RS 4
122
.TP 3
123
\(em
124
standard deviation of the percent of free memory
125
.TP
126
\(em
127
standard deviation of the percent of reserved memory
128
.TP
129
\(em
130
standard deviation of the percent of free disk
131
.TP
132
\(em
133
count of nodes failing N+1 check
134
.TP
135
\(em
136
count of instances living (either as primary or secondary) on
137
offline nodes
138
.TP
139
\(em
140
count of instances living (as primary) on offline nodes; this differs
141
from the above metric by helping failover of such instances in 2-node
142
clusters
143
.TP
144
\(em
145
standard deviation of the ratio of virtual-to-physical cpus (for
146
primary instances of the node)
147
.TP
148
\(em
149
standard deviation of the dynamic load on the nodes, for cpus,
150
memory, disk and network
151
.RE
152

    
153
The free memory and free disk values help ensure that all nodes are
154
somewhat balanced in their resource usage. The reserved memory helps
155
to ensure that nodes are somewhat balanced in holding secondary
156
instances, and that no node keeps too much memory reserved for
157
N+1. And finally, the N+1 percentage helps guide the algorithm towards
158
eliminating N+1 failures, if possible.
159

    
160
Except for the N+1 failures and offline instances counts, we use the
161
standard deviation since when used with values within a fixed range
162
(we use percents expressed as values between zero and one) it gives
163
consistent results across all metrics (there are some small issues
164
related to different means, but it works generally well). The 'count'
165
type values will have higher score and thus will matter more for
166
balancing; thus these are better for hard constraints (like evacuating
167
nodes and fixing N+1 failures). For example, the offline instances
168
count (i.e. the number of instances living on offline nodes) will
169
cause the algorithm to actively move instances away from offline
170
nodes. This, coupled with the restriction on placement given by
171
offline nodes, will cause evacuation of such nodes.
172

    
173
The dynamic load values need to be read from an external file (Ganeti
174
doesn't supply them), and are computed for each node as: sum of
175
primary instance cpu load, sum of primary instance memory load, sum of
176
primary and secondary instance disk load (as DRBD generates write load
177
on secondary nodes too in normal case and in degraded scenarios also
178
read load), and sum of primary instance network load. An example of
179
how to generate these values for input to hbal would be to track "xm
180
list" for instance over a day and by computing the delta of the cpu
181
values, and feed that via the \fI-U\fR option for all instances (and
182
keep the other metrics as one). For the algorithm to work, all that is
183
needed is that the values are consistent for a metric across all
184
instances (e.g. all instances use cpu% to report cpu usage, and not
185
something related to number of CPU seconds used if the CPUs are
186
different), and that they are normalised to between zero and one. Note
187
that it's recommended to not have zero as the load value for any
188
instance metric since then 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 mechanism is designed to prevent instances which
206
run 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
.B "--evac-mode"
407
This parameter restricts the list of instances considered for moving
408
to the ones living on offline/drained nodes. It can be used as a
409
(bulk) replacement for Ganeti's own \fIgnt-node evacuate\fR, with the
410
note that it doesn't guarantee full evacuation.
411

    
412
.TP
413
.BI "--exclude-instances " instances
414
This parameter marks the given instances (as a comma-separated list)
415
from being moved during the rebalance.
416

    
417
.TP
418
.BI "-U" util-file
419
This parameter specifies a file holding instance dynamic utilisation
420
information that will be used to tweak the balancing algorithm to
421
equalise load on the nodes (as opposed to static resource usage). The
422
file is in the format "instance_name cpu_util mem_util disk_util
423
net_util" where the "_util" parameters are interpreted as numbers and
424
the instance name must match exactly the instance as read from
425
Ganeti. In case of unknown instance names, the program will abort.
426

    
427
If not given, the default values are one for all metrics and thus
428
dynamic utilisation has only one effect on the algorithm: the
429
equalisation of the secondary instances across nodes (this is the only
430
metric that is not tracked by another, dedicated value, and thus the
431
disk load of instances will cause secondary instance
432
equalisation). Note that value of one will also influence slightly the
433
primary instance count, but that is already tracked via other metrics
434
and thus the influence of the dynamic utilisation will be practically
435
insignificant.
436

    
437
.TP
438
.BI "-t" datafile ", --text-data=" datafile
439
The name of the file holding node and instance information (if not
440
collecting via RAPI or LUXI). This or one of the other backends must
441
be selected.
442

    
443
.TP
444
.BI "-m" cluster
445
Collect data directly from the
446
.I cluster
447
given as an argument via RAPI. If the argument doesn't contain a colon
448
(:), then it is converted into a fully\(hybuilt URL via prepending
449
https:// and appending the default RAPI port, otherwise it's
450
considered a fully\(hyspecified URL and is used as\(hyis.
451

    
452
.TP
453
.BI "-L[" path "]"
454
Collect data directly from the master daemon, which is to be contacted
455
via the luxi (an internal Ganeti protocol). An optional \fIpath\fR
456
argument is interpreted as the path to the unix socket on which the
457
master daemon listens; otherwise, the default path used by ganeti when
458
installed with \fI--localstatedir=/var\fR is used.
459

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

    
471
.TP
472
.BI "-l" N ", --max-length=" N
473
Restrict the solution to this length. This can be used for example to
474
automate the execution of the balancing.
475

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

    
485
.TP
486
.BI "--min-disk " disk-ratio
487
The minimum amount of free disk space remaining, as a floating point
488
number. For example, specifying \fIdisk-ratio\fR as \fB0.25\fR means
489
that at least one quarter of disk space should be left free on nodes.
490

    
491
.TP
492
.B -v, --verbose
493
Increase the output verbosity. Each usage of this option will increase
494
the verbosity (currently more than 2 doesn't make sense) from the
495
default of one.
496

    
497
.TP
498
.B -q, --quiet
499
Decrease the output verbosity. Each usage of this option will decrease
500
the verbosity (less than zero doesn't make sense) from the default of
501
one.
502

    
503
.TP
504
.B -V, --version
505
Just show the program version and exit.
506

    
507
.SH EXIT STATUS
508

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

    
512
.SH ENVIRONMENT
513

    
514
If the variables \fBHTOOLS_NODES\fR and \fBHTOOLS_INSTANCES\fR are
515
present in the environment, they will override the default names for
516
the nodes and instances files. These will have of course no effect
517
when the RAPI or Luxi backends are used.
518

    
519
.SH BUGS
520

    
521
The program does not check its input data for consistency, and aborts
522
with cryptic errors messages in this case.
523

    
524
The algorithm is not perfect.
525

    
526
The output format is not easily scriptable, and the program should
527
feed moves directly into Ganeti (either via RAPI or via a gnt\-debug
528
input file).
529

    
530
.SH EXAMPLE
531

    
532
Note that this example are not for the latest version (they don't have
533
full node data).
534

    
535
.SS Default output
536

    
537
With the default options, the program shows each individual step and
538
the improvements it brings in cluster score:
539

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

    
566
In the above output, we can see:
567
  - the input data (here from files) shows a cluster with 20 nodes and
568
    80 instances
569
  - the cluster is not initially N+1 compliant
570
  - the initial score is 0.52329131
571

    
572
The step list follows, showing the instance, its initial
573
primary/secondary nodes, the new primary secondary, the cluster list,
574
and the actions taken in this step (with 'f' denoting failover/migrate
575
and 'r' denoting replace secondary).
576

    
577
Finally, the program shows the improvement in cluster score.
578

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

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

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

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

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

    
694
.fi
695
.in
696

    
697
Here we see, beside the step list, the initial and final cluster
698
status, with the final one showing all nodes being N+1 compliant, and
699
the command list to reach the final solution. In the initial listing,
700
we see which nodes are not N+1 compliant.
701

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

    
708
.SH SEE ALSO
709
.BR hspace "(1), " hscan "(1), " hail "(1), "
710
.BR ganeti "(7), " gnt-instance "(8), " gnt-node "(8)"
711

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