Statistics
| Branch: | Tag: | Revision:

root / man / hbal.rst @ 14b4e045

History | View | Annotate | Download (26.7 kB)

1
HBAL(1) Ganeti | Version @GANETI_VERSION@
2
=========================================
3

    
4
NAME
5
----
6

    
7
hbal \- Cluster balancer for Ganeti
8

    
9
SYNOPSIS
10
--------
11

    
12
**hbal** {backend options...} [algorithm options...] [reporting options...]
13

    
14
**hbal** \--version
15

    
16

    
17
Backend options:
18

    
19
{ **-m** *cluster* | **-L[** *path* **] [-X]** | **-t** *data-file* |
20
**-I** *path* }
21

    
22
Algorithm options:
23

    
24
**[ \--max-cpu *cpu-ratio* ]**
25
**[ \--min-disk *disk-ratio* ]**
26
**[ -l *limit* ]**
27
**[ -e *score* ]**
28
**[ -g *delta* ]** **[ \--min-gain-limit *threshold* ]**
29
**[ -O *name...* ]**
30
**[ \--no-disk-moves ]**
31
**[ \--no-instance-moves ]**
32
**[ -U *util-file* ]**
33
**[ \--ignore-dynu ]**
34
**[ \--evac-mode ]**
35
**[ \--select-instances *inst...* ]**
36
**[ \--exclude-instances *inst...* ]**
37

    
38
Reporting options:
39

    
40
**[ -C[ *file* ] ]**
41
**[ -p[ *fields* ] ]**
42
**[ \--print-instances ]**
43
**[ -S *file* ]**
44
**[ -v... | -q ]**
45

    
46

    
47
DESCRIPTION
48
-----------
49

    
50
hbal is a cluster balancer that looks at the current state of the
51
cluster (nodes with their total and free disk, memory, etc.) and
52
instance placement and computes a series of steps designed to bring
53
the cluster into a better state.
54

    
55
The algorithm used is designed to be stable (i.e. it will give you the
56
same results when restarting it from the middle of the solution) and
57
reasonably fast. It is not, however, designed to be a perfect algorithm:
58
it is possible to make it go into a corner from which it can find no
59
improvement, because it looks only one "step" ahead.
60

    
61
By default, the program will show the solution incrementally as it is
62
computed, in a somewhat cryptic format; for getting the actual Ganeti
63
command list, use the **-C** option.
64

    
65
ALGORITHM
66
~~~~~~~~~
67

    
68
The program works in independent steps; at each step, we compute the
69
best instance move that lowers the cluster score.
70

    
71
The possible move type for an instance are combinations of
72
failover/migrate and replace-disks such that we change one of the
73
instance nodes, and the other one remains (but possibly with changed
74
role, e.g. from primary it becomes secondary). The list is:
75

    
76
- failover (f)
77
- replace secondary (r)
78
- replace primary, a composite move (f, r, f)
79
- failover and replace secondary, also composite (f, r)
80
- replace secondary and failover, also composite (r, f)
81

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

    
88
PLACEMENT RESTRICTIONS
89
~~~~~~~~~~~~~~~~~~~~~~
90

    
91
At each step, we prevent an instance move if it would cause:
92

    
93
- a node to go into N+1 failure state
94
- an instance to move onto an offline node (offline nodes are either
95
  read from the cluster or declared with *-O*; drained nodes are
96
  considered offline)
97
- an exclusion-tag based conflict (exclusion tags are read from the
98
  cluster and/or defined via the *\--exclusion-tags* option)
99
- a max vcpu/pcpu ratio to be exceeded (configured via *\--max-cpu*)
100
- min disk free percentage to go below the configured limit
101
  (configured via *\--min-disk*)
102

    
103
CLUSTER SCORING
104
~~~~~~~~~~~~~~~
105

    
106
As said before, the algorithm tries to minimise the cluster score at
107
each step. Currently this score is computed as a weighted sum of the
108
following components:
109

    
110
- standard deviation of the percent of free memory
111
- standard deviation of the percent of reserved memory
112
- standard deviation of the percent of free disk
113
- count of nodes failing N+1 check
114
- count of instances living (either as primary or secondary) on
115
  offline nodes; in the sense of hbal (and the other htools) drained
116
  nodes are considered offline
117
- count of instances living (as primary) on offline nodes; this
118
  differs from the above metric by helping failover of such instances
119
  in 2-node clusters
120
- standard deviation of the ratio of virtual-to-physical cpus (for
121
  primary instances of the node)
122
- standard deviation of the dynamic load on the nodes, for cpus,
123
  memory, disk and network
124

    
125
The free memory and free disk values help ensure that all nodes are
126
somewhat balanced in their resource usage. The reserved memory helps
127
to ensure that nodes are somewhat balanced in holding secondary
128
instances, and that no node keeps too much memory reserved for
129
N+1. And finally, the N+1 percentage helps guide the algorithm towards
130
eliminating N+1 failures, if possible.
131

    
132
Except for the N+1 failures and offline instances counts, we use the
133
standard deviation since when used with values within a fixed range
134
(we use percents expressed as values between zero and one) it gives
135
consistent results across all metrics (there are some small issues
136
related to different means, but it works generally well). The 'count'
137
type values will have higher score and thus will matter more for
138
balancing; thus these are better for hard constraints (like evacuating
139
nodes and fixing N+1 failures). For example, the offline instances
140
count (i.e. the number of instances living on offline nodes) will
141
cause the algorithm to actively move instances away from offline
142
nodes. This, coupled with the restriction on placement given by
143
offline nodes, will cause evacuation of such nodes.
144

    
145
The dynamic load values need to be read from an external file (Ganeti
146
doesn't supply them), and are computed for each node as: sum of
147
primary instance cpu load, sum of primary instance memory load, sum of
148
primary and secondary instance disk load (as DRBD generates write load
149
on secondary nodes too in normal case and in degraded scenarios also
150
read load), and sum of primary instance network load. An example of
151
how to generate these values for input to hbal would be to track ``xm
152
list`` for instances over a day and by computing the delta of the cpu
153
values, and feed that via the *-U* option for all instances (and keep
154
the other metrics as one). For the algorithm to work, all that is
155
needed is that the values are consistent for a metric across all
156
instances (e.g. all instances use cpu% to report cpu usage, and not
157
something related to number of CPU seconds used if the CPUs are
158
different), and that they are normalised to between zero and one. Note
159
that it's recommended to not have zero as the load value for any
160
instance metric since then secondary instances are not well balanced.
161

    
162
On a perfectly balanced cluster (all nodes the same size, all
163
instances the same size and spread across the nodes equally), the
164
values for all metrics would be zero. This doesn't happen too often in
165
practice :)
166

    
167
OFFLINE INSTANCES
168
~~~~~~~~~~~~~~~~~
169

    
170
Since current Ganeti versions do not report the memory used by offline
171
(down) instances, ignoring the run status of instances will cause
172
wrong calculations. For this reason, the algorithm subtracts the
173
memory size of down instances from the free node memory of their
174
primary node, in effect simulating the startup of such instances.
175

    
176
EXCLUSION TAGS
177
~~~~~~~~~~~~~~
178

    
179
The exclusion tags mechanism is designed to prevent instances which
180
run the same workload (e.g. two DNS servers) to land on the same node,
181
which would make the respective node a SPOF for the given service.
182

    
183
It works by tagging instances with certain tags and then building
184
exclusion maps based on these. Which tags are actually used is
185
configured either via the command line (option *\--exclusion-tags*)
186
or via adding them to the cluster tags:
187

    
188
\--exclusion-tags=a,b
189
  This will make all instance tags of the form *a:\**, *b:\** be
190
  considered for the exclusion map
191

    
192
cluster tags *htools:iextags:a*, *htools:iextags:b*
193
  This will make instance tags *a:\**, *b:\** be considered for the
194
  exclusion map. More precisely, the suffix of cluster tags starting
195
  with *htools:iextags:* will become the prefix of the exclusion tags.
196

    
197
Both the above forms mean that two instances both having (e.g.) the
198
tag *a:foo* or *b:bar* won't end on the same node.
199

    
200
OPTIONS
201
-------
202

    
203
The options that can be passed to the program are as follows:
204

    
205
-C, \--print-commands
206
  Print the command list at the end of the run. Without this, the
207
  program will only show a shorter, but cryptic output.
208

    
209
  Note that the moves list will be split into independent steps,
210
  called "jobsets", but only for visual inspection, not for actually
211
  parallelisation. It is not possible to parallelise these directly
212
  when executed via "gnt-instance" commands, since a compound command
213
  (e.g. failover and replace-disks) must be executed
214
  serially. Parallel execution is only possible when using the Luxi
215
  backend and the *-L* option.
216

    
217
  The algorithm for splitting the moves into jobsets is by
218
  accumulating moves until the next move is touching nodes already
219
  touched by the current moves; this means we can't execute in
220
  parallel (due to resource allocation in Ganeti) and thus we start a
221
  new jobset.
222

    
223
-p, \--print-nodes
224
  Prints the before and after node status, in a format designed to allow
225
  the user to understand the node's most important parameters. See the
226
  man page **htools**\(1) for more details about this option.
227

    
228
\--print-instances
229
  Prints the before and after instance map. This is less useful as the
230
  node status, but it can help in understanding instance moves.
231

    
232
-O *name*
233
  This option (which can be given multiple times) will mark nodes as
234
  being *offline*. This means a couple of things:
235

    
236
  - instances won't be placed on these nodes, not even temporarily;
237
    e.g. the *replace primary* move is not available if the secondary
238
    node is offline, since this move requires a failover.
239
  - these nodes will not be included in the score calculation (except
240
    for the percentage of instances on offline nodes)
241

    
242
  Note that algorithm will also mark as offline any nodes which are
243
  reported by RAPI as such, or that have "?" in file-based input in
244
  any numeric fields.
245

    
246
-e *score*, \--min-score=*score*
247
  This parameter denotes the minimum score we are happy with and alters
248
  the computation in two ways:
249

    
250
  - if the cluster has the initial score lower than this value, then we
251
    don't enter the algorithm at all, and exit with success
252
  - during the iterative process, if we reach a score lower than this
253
    value, we exit the algorithm
254

    
255
  The default value of the parameter is currently ``1e-9`` (chosen
256
  empirically).
257

    
258
-g *delta*, \--min-gain=*delta*
259
  Since the balancing algorithm can sometimes result in just very tiny
260
  improvements, that bring less gain that they cost in relocation
261
  time, this parameter (defaulting to 0.01) represents the minimum
262
  gain we require during a step, to continue balancing.
263

    
264
\--min-gain-limit=*threshold*
265
  The above min-gain option will only take effect if the cluster score
266
  is already below *threshold* (defaults to 0.1). The rationale behind
267
  this setting is that at high cluster scores (badly balanced
268
  clusters), we don't want to abort the rebalance too quickly, as
269
  later gains might still be significant. However, under the
270
  threshold, the total gain is only the threshold value, so we can
271
  exit early.
272

    
273
\--no-disk-moves
274
  This parameter prevents hbal from using disk move
275
  (i.e. "gnt-instance replace-disks") operations. This will result in
276
  a much quicker balancing, but of course the improvements are
277
  limited. It is up to the user to decide when to use one or another.
278

    
279
\--no-instance-moves
280
  This parameter prevents hbal from using instance moves
281
  (i.e. "gnt-instance migrate/failover") operations. This will only use
282
  the slow disk-replacement operations, and will also provide a worse
283
  balance, but can be useful if moving instances around is deemed unsafe
284
  or not preferred.
285

    
286
\--evac-mode
287
  This parameter restricts the list of instances considered for moving
288
  to the ones living on offline/drained nodes. It can be used as a
289
  (bulk) replacement for Ganeti's own *gnt-node evacuate*, with the
290
  note that it doesn't guarantee full evacuation.
291

    
292
\--select-instances=*instances*
293
  This parameter marks the given instances (as a comma-separated list)
294
  as the only ones being moved during the rebalance.
295

    
296
\--exclude-instances=*instances*
297
  This parameter marks the given instances (as a comma-separated list)
298
  from being moved during the rebalance.
299

    
300
-U *util-file*
301
  This parameter specifies a file holding instance dynamic utilisation
302
  information that will be used to tweak the balancing algorithm to
303
  equalise load on the nodes (as opposed to static resource
304
  usage). The file is in the format "instance_name cpu_util mem_util
305
  disk_util net_util" where the "_util" parameters are interpreted as
306
  numbers and the instance name must match exactly the instance as
307
  read from Ganeti. In case of unknown instance names, the program
308
  will abort.
309

    
310
  If not given, the default values are one for all metrics and thus
311
  dynamic utilisation has only one effect on the algorithm: the
312
  equalisation of the secondary instances across nodes (this is the
313
  only metric that is not tracked by another, dedicated value, and
314
  thus the disk load of instances will cause secondary instance
315
  equalisation). Note that value of one will also influence slightly
316
  the primary instance count, but that is already tracked via other
317
  metrics and thus the influence of the dynamic utilisation will be
318
  practically insignificant.
319

    
320
\--ignore-dynu
321
  If given, all dynamic utilisation information will be ignored by
322
  assuming it to be 0. This option will take precedence over any data
323
  passed by the ``-U`` option.
324

    
325
-S *filename*, \--save-cluster=*filename*
326
  If given, the state of the cluster before the balancing is saved to
327
  the given file plus the extension "original"
328
  (i.e. *filename*.original), and the state at the end of the
329
  balancing is saved to the given file plus the extension "balanced"
330
  (i.e. *filename*.balanced). This allows re-feeding the cluster state
331
  to either hbal itself or for example hspace via the ``-t`` option.
332

    
333
-t *datafile*, \--text-data=*datafile*
334
  Backend specification: the name of the file holding node and instance
335
  information (if not collecting via RAPI or LUXI). This or one of the
336
  other backends must be selected. The option is described in the man
337
  page **htools**\(1).
338

    
339
-m *cluster*
340
  Backend specification: collect data directly from the *cluster* given
341
  as an argument via RAPI. The option is described in the man page
342
  **htools**\(1).
343

    
344
-L [*path*]
345
  Backend specification: collect data directly from the master daemon,
346
  which is to be contacted via LUXI (an internal Ganeti protocol). The
347
  option is described in the man page **htools**\(1).
348

    
349
-X
350
  When using the Luxi backend, hbal can also execute the given
351
  commands. The execution method is to execute the individual jobsets
352
  (see the *-C* option for details) in separate stages, aborting if at
353
  any time a jobset doesn't have all jobs successful. Each step in the
354
  balancing solution will be translated into exactly one Ganeti job
355
  (having between one and three OpCodes), and all the steps in a
356
  jobset will be executed in parallel. The jobsets themselves are
357
  executed serially.
358

    
359
  The execution of the job series can be interrupted, see below for
360
  signal handling.
361

    
362
-l *N*, \--max-length=*N*
363
  Restrict the solution to this length. This can be used for example
364
  to automate the execution of the balancing.
365

    
366
\--max-cpu=*cpu-ratio*
367
  The maximum virtual to physical cpu ratio, as a floating point number
368
  greater than or equal to one. For example, specifying *cpu-ratio* as
369
  **2.5** means that, for a 4-cpu machine, a maximum of 10 virtual cpus
370
  should be allowed to be in use for primary instances. A value of
371
  exactly one means there will be no over-subscription of CPU (except
372
  for the CPU time used by the node itself), and values below one do not
373
  make sense, as that means other resources (e.g. disk) won't be fully
374
  utilised due to CPU restrictions.
375

    
376
\--min-disk=*disk-ratio*
377
  The minimum amount of free disk space remaining, as a floating point
378
  number. For example, specifying *disk-ratio* as **0.25** means that
379
  at least one quarter of disk space should be left free on nodes.
380

    
381
-G *uuid*, \--group=*uuid*
382
  On an multi-group cluster, select this group for
383
  processing. Otherwise hbal will abort, since it cannot balance
384
  multiple groups at the same time.
385

    
386
-v, \--verbose
387
  Increase the output verbosity. Each usage of this option will
388
  increase the verbosity (currently more than 2 doesn't make sense)
389
  from the default of one.
390

    
391
-q, \--quiet
392
  Decrease the output verbosity. Each usage of this option will
393
  decrease the verbosity (less than zero doesn't make sense) from the
394
  default of one.
395

    
396
-V, \--version
397
  Just show the program version and exit.
398

    
399
SIGNAL HANDLING
400
---------------
401

    
402
When executing jobs via LUXI (using the ``-X`` option), normally hbal
403
will execute all jobs until either one errors out or all the jobs finish
404
successfully.
405

    
406
Since balancing can take a long time, it is possible to stop hbal early
407
in two ways:
408

    
409
- by sending a ``SIGINT`` (``^C``), hbal will register the termination
410
  request, and will wait until the currently submitted jobs finish, at
411
  which point it will exit (with exit code 0 if all jobs finished
412
  correctly, otherwise with exit code 1 as usual)
413

    
414
- by sending a ``SIGTERM``, hbal will immediately exit (with exit code
415
  2\); it is the responsibility of the user to follow up with Ganeti
416
  and check the result of the currently-executing jobs
417

    
418
Note that in any situation, it's perfectly safe to kill hbal, either via
419
the above signals or via any other signal (e.g. ``SIGQUIT``,
420
``SIGKILL``), since the jobs themselves are processed by Ganeti whereas
421
hbal (after submission) only watches their progression. In this case,
422
the user will have to query Ganeti for job results.
423

    
424
EXIT STATUS
425
-----------
426

    
427
The exit status of the command will be zero, unless for some reason the
428
algorithm failed (e.g. wrong node or instance data), invalid command
429
line options, or (in case of job execution) one of the jobs has failed.
430

    
431
Once job execution via Luxi has started (``-X``), if the balancing was
432
interrupted early (via *SIGINT*, or via ``--max-length``) but all jobs
433
executed successfully, then the exit status is zero; a non-zero exit
434
code means that the cluster state should be investigated, since a job
435
failed or we couldn't compute its status and this can also point to a
436
problem on the Ganeti side.
437

    
438
BUGS
439
----
440

    
441
The program does not check all its input data for consistency, and
442
sometime aborts with cryptic errors messages with invalid data.
443

    
444
The algorithm is not perfect.
445

    
446
EXAMPLE
447
-------
448

    
449
Note that these examples are not for the latest version (they don't
450
have full node data).
451

    
452
Default output
453
~~~~~~~~~~~~~~
454

    
455
With the default options, the program shows each individual step and
456
the improvements it brings in cluster score::
457

    
458
    $ hbal
459
    Loaded 20 nodes, 80 instances
460
    Cluster is not N+1 happy, continuing but no guarantee that the cluster will end N+1 happy.
461
    Initial score: 0.52329131
462
    Trying to minimize the CV...
463
        1. instance14  node1:node10  => node16:node10 0.42109120 a=f r:node16 f
464
        2. instance54  node4:node15  => node16:node15 0.31904594 a=f r:node16 f
465
        3. instance4   node5:node2   => node2:node16  0.26611015 a=f r:node16
466
        4. instance48  node18:node20 => node2:node18  0.21361717 a=r:node2 f
467
        5. instance93  node19:node18 => node16:node19 0.16166425 a=r:node16 f
468
        6. instance89  node3:node20  => node2:node3   0.11005629 a=r:node2 f
469
        7. instance5   node6:node2   => node16:node6  0.05841589 a=r:node16 f
470
        8. instance94  node7:node20  => node20:node16 0.00658759 a=f r:node16
471
        9. instance44  node20:node2  => node2:node15  0.00438740 a=f r:node15
472
       10. instance62  node14:node18 => node14:node16 0.00390087 a=r:node16
473
       11. instance13  node11:node14 => node11:node16 0.00361787 a=r:node16
474
       12. instance19  node10:node11 => node10:node7  0.00336636 a=r:node7
475
       13. instance43  node12:node13 => node12:node1  0.00305681 a=r:node1
476
       14. instance1   node1:node2   => node1:node4   0.00263124 a=r:node4
477
       15. instance58  node19:node20 => node19:node17 0.00252594 a=r:node17
478
    Cluster score improved from 0.52329131 to 0.00252594
479

    
480
In the above output, we can see:
481

    
482
- the input data (here from files) shows a cluster with 20 nodes and
483
  80 instances
484
- the cluster is not initially N+1 compliant
485
- the initial score is 0.52329131
486

    
487
The step list follows, showing the instance, its initial
488
primary/secondary nodes, the new primary secondary, the cluster list,
489
and the actions taken in this step (with 'f' denoting failover/migrate
490
and 'r' denoting replace secondary).
491

    
492
Finally, the program shows the improvement in cluster score.
493

    
494
A more detailed output is obtained via the *-C* and *-p* options::
495

    
496
    $ hbal
497
    Loaded 20 nodes, 80 instances
498
    Cluster is not N+1 happy, continuing but no guarantee that the cluster will end N+1 happy.
499
    Initial cluster status:
500
    N1 Name   t_mem f_mem r_mem t_dsk f_dsk pri sec  p_fmem  p_fdsk
501
     * node1  32762  1280  6000  1861  1026   5   3 0.03907 0.55179
502
       node2  32762 31280 12000  1861  1026   0   8 0.95476 0.55179
503
     * node3  32762  1280  6000  1861  1026   5   3 0.03907 0.55179
504
     * node4  32762  1280  6000  1861  1026   5   3 0.03907 0.55179
505
     * node5  32762  1280  6000  1861   978   5   5 0.03907 0.52573
506
     * node6  32762  1280  6000  1861  1026   5   3 0.03907 0.55179
507
     * node7  32762  1280  6000  1861  1026   5   3 0.03907 0.55179
508
       node8  32762  7280  6000  1861  1026   4   4 0.22221 0.55179
509
       node9  32762  7280  6000  1861  1026   4   4 0.22221 0.55179
510
     * node10 32762  7280 12000  1861  1026   4   4 0.22221 0.55179
511
       node11 32762  7280  6000  1861   922   4   5 0.22221 0.49577
512
       node12 32762  7280  6000  1861  1026   4   4 0.22221 0.55179
513
       node13 32762  7280  6000  1861   922   4   5 0.22221 0.49577
514
       node14 32762  7280  6000  1861   922   4   5 0.22221 0.49577
515
     * node15 32762  7280 12000  1861  1131   4   3 0.22221 0.60782
516
       node16 32762 31280     0  1861  1860   0   0 0.95476 1.00000
517
       node17 32762  7280  6000  1861  1106   5   3 0.22221 0.59479
518
     * node18 32762  1280  6000  1396   561   5   3 0.03907 0.40239
519
     * node19 32762  1280  6000  1861  1026   5   3 0.03907 0.55179
520
       node20 32762 13280 12000  1861   689   3   9 0.40535 0.37068
521

    
522
    Initial score: 0.52329131
523
    Trying to minimize the CV...
524
        1. instance14  node1:node10  => node16:node10 0.42109120 a=f r:node16 f
525
        2. instance54  node4:node15  => node16:node15 0.31904594 a=f r:node16 f
526
        3. instance4   node5:node2   => node2:node16  0.26611015 a=f r:node16
527
        4. instance48  node18:node20 => node2:node18  0.21361717 a=r:node2 f
528
        5. instance93  node19:node18 => node16:node19 0.16166425 a=r:node16 f
529
        6. instance89  node3:node20  => node2:node3   0.11005629 a=r:node2 f
530
        7. instance5   node6:node2   => node16:node6  0.05841589 a=r:node16 f
531
        8. instance94  node7:node20  => node20:node16 0.00658759 a=f r:node16
532
        9. instance44  node20:node2  => node2:node15  0.00438740 a=f r:node15
533
       10. instance62  node14:node18 => node14:node16 0.00390087 a=r:node16
534
       11. instance13  node11:node14 => node11:node16 0.00361787 a=r:node16
535
       12. instance19  node10:node11 => node10:node7  0.00336636 a=r:node7
536
       13. instance43  node12:node13 => node12:node1  0.00305681 a=r:node1
537
       14. instance1   node1:node2   => node1:node4   0.00263124 a=r:node4
538
       15. instance58  node19:node20 => node19:node17 0.00252594 a=r:node17
539
    Cluster score improved from 0.52329131 to 0.00252594
540

    
541
    Commands to run to reach the above solution:
542
      echo step 1
543
      echo gnt-instance migrate instance14
544
      echo gnt-instance replace-disks -n node16 instance14
545
      echo gnt-instance migrate instance14
546
      echo step 2
547
      echo gnt-instance migrate instance54
548
      echo gnt-instance replace-disks -n node16 instance54
549
      echo gnt-instance migrate instance54
550
      echo step 3
551
      echo gnt-instance migrate instance4
552
      echo gnt-instance replace-disks -n node16 instance4
553
      echo step 4
554
      echo gnt-instance replace-disks -n node2 instance48
555
      echo gnt-instance migrate instance48
556
      echo step 5
557
      echo gnt-instance replace-disks -n node16 instance93
558
      echo gnt-instance migrate instance93
559
      echo step 6
560
      echo gnt-instance replace-disks -n node2 instance89
561
      echo gnt-instance migrate instance89
562
      echo step 7
563
      echo gnt-instance replace-disks -n node16 instance5
564
      echo gnt-instance migrate instance5
565
      echo step 8
566
      echo gnt-instance migrate instance94
567
      echo gnt-instance replace-disks -n node16 instance94
568
      echo step 9
569
      echo gnt-instance migrate instance44
570
      echo gnt-instance replace-disks -n node15 instance44
571
      echo step 10
572
      echo gnt-instance replace-disks -n node16 instance62
573
      echo step 11
574
      echo gnt-instance replace-disks -n node16 instance13
575
      echo step 12
576
      echo gnt-instance replace-disks -n node7 instance19
577
      echo step 13
578
      echo gnt-instance replace-disks -n node1 instance43
579
      echo step 14
580
      echo gnt-instance replace-disks -n node4 instance1
581
      echo step 15
582
      echo gnt-instance replace-disks -n node17 instance58
583

    
584
    Final cluster status:
585
    N1 Name   t_mem f_mem r_mem t_dsk f_dsk pri sec  p_fmem  p_fdsk
586
       node1  32762  7280  6000  1861  1026   4   4 0.22221 0.55179
587
       node2  32762  7280  6000  1861  1026   4   4 0.22221 0.55179
588
       node3  32762  7280  6000  1861  1026   4   4 0.22221 0.55179
589
       node4  32762  7280  6000  1861  1026   4   4 0.22221 0.55179
590
       node5  32762  7280  6000  1861  1078   4   5 0.22221 0.57947
591
       node6  32762  7280  6000  1861  1026   4   4 0.22221 0.55179
592
       node7  32762  7280  6000  1861  1026   4   4 0.22221 0.55179
593
       node8  32762  7280  6000  1861  1026   4   4 0.22221 0.55179
594
       node9  32762  7280  6000  1861  1026   4   4 0.22221 0.55179
595
       node10 32762  7280  6000  1861  1026   4   4 0.22221 0.55179
596
       node11 32762  7280  6000  1861  1022   4   4 0.22221 0.54951
597
       node12 32762  7280  6000  1861  1026   4   4 0.22221 0.55179
598
       node13 32762  7280  6000  1861  1022   4   4 0.22221 0.54951
599
       node14 32762  7280  6000  1861  1022   4   4 0.22221 0.54951
600
       node15 32762  7280  6000  1861  1031   4   4 0.22221 0.55408
601
       node16 32762  7280  6000  1861  1060   4   4 0.22221 0.57007
602
       node17 32762  7280  6000  1861  1006   5   4 0.22221 0.54105
603
       node18 32762  7280  6000  1396   761   4   2 0.22221 0.54570
604
       node19 32762  7280  6000  1861  1026   4   4 0.22221 0.55179
605
       node20 32762 13280  6000  1861  1089   3   5 0.40535 0.58565
606

    
607
Here we see, beside the step list, the initial and final cluster
608
status, with the final one showing all nodes being N+1 compliant, and
609
the command list to reach the final solution. In the initial listing,
610
we see which nodes are not N+1 compliant.
611

    
612
The algorithm is stable as long as each step above is fully completed,
613
e.g. in step 8, both the migrate and the replace-disks are
614
done. Otherwise, if only the migrate is done, the input data is
615
changed in a way that the program will output a different solution
616
list (but hopefully will end in the same state).
617

    
618
.. vim: set textwidth=72 :
619
.. Local Variables:
620
.. mode: rst
621
.. fill-column: 72
622
.. End: