Revision 632fb7ec doc/iallocator.rst
b/doc/iallocator.rst | ||
---|---|---|
1 | 1 |
Ganeti automatic instance allocation |
2 | 2 |
==================================== |
3 | 3 |
|
4 |
Documents Ganeti version 2.0
|
|
4 |
Documents Ganeti version 2.1
|
|
5 | 5 |
|
6 | 6 |
.. contents:: |
7 | 7 |
|
... | ... | |
87 | 87 |
a dictionary containing the request data: |
88 | 88 |
|
89 | 89 |
type |
90 |
the request type; this can be either ``allocate`` or ``relocate``; |
|
91 |
the ``allocate`` request is used when a new instance needs to be |
|
92 |
placed on the cluster, while the ``relocate`` request is used when |
|
93 |
an existing instance needs to be moved within the cluster |
|
90 |
the request type; this can be either ``allocate``, ``relocate`` or |
|
91 |
``multi-evacuate``; the ``allocate`` request is used when a new |
|
92 |
instance needs to be placed on the cluster, while the ``relocate`` |
|
93 |
request is used when an existing instance needs to be moved within |
|
94 |
the cluster; the ``multi-evacuate`` protocol requests that the |
|
95 |
script computes the optimal relocate solution for all secondary |
|
96 |
instances of the given nodes |
|
97 |
|
|
98 |
The following keys are needed in allocate/relocate mode: |
|
94 | 99 |
|
95 | 100 |
name |
96 |
the name of the instance; if the request is a realocation, then |
|
97 |
this name will be found in the list of instances (see below),
|
|
98 |
otherwise is the FQDN of the new instance
|
|
101 |
the name of the instance; if the request is a realocation, then this
|
|
102 |
name will be found in the list of instances (see below), otherwise
|
|
103 |
is the FQDN of the new instance |
|
99 | 104 |
|
100 | 105 |
required_nodes |
101 | 106 |
how many nodes should the algorithm return; while this information |
... | ... | |
161 | 166 |
2.0, this list will always contain a single node, the current |
162 | 167 |
secondary of the instance. |
163 | 168 |
|
169 |
The multi-evacuate mode has instead a single request argument: |
|
170 |
|
|
171 |
nodes |
|
172 |
the names of the nodes to be evacuated |
|
173 |
|
|
164 | 174 |
instances |
165 | 175 |
a dictionary with the data for the current existing instance on the |
166 | 176 |
cluster, indexed by instance name; the contents are similar to the |
... | ... | |
244 | 254 |
a string with information from the scripts; if the allocation fails, |
245 | 255 |
this will be shown to the user |
246 | 256 |
|
247 |
nodes |
|
248 |
the list of nodes computed by the algorithm; even if the algorithm |
|
249 |
failed (i.e. success is false), this must be returned as an empty |
|
250 |
list; also note that the length of this list must equal the |
|
251 |
``requested_nodes`` entry in the input message, otherwise Ganeti |
|
252 |
will consider the result as failed |
|
257 |
result |
|
258 |
the output of the algorithm; even if the algorithm failed |
|
259 |
(i.e. success is false), this must be returned as an empty list |
|
260 |
|
|
261 |
for allocate/relocate, this is the list of node(s) for the instance; |
|
262 |
note that the length of this list must equal the ``requested_nodes`` |
|
263 |
entry in the input message, otherwise Ganeti will consider the result |
|
264 |
as failed |
|
265 |
|
|
266 |
for multi-evacuation mode, this is a list of lists; each element of |
|
267 |
the list is a list of instance name and the new secondary node |
|
268 |
|
|
269 |
.. note:: Current Ganeti version accepts either ``result`` or ``nodes`` |
|
270 |
as a backwards-compatibility measure (older versions only supported |
|
271 |
``nodes``) |
|
253 | 272 |
|
254 | 273 |
Examples |
255 | 274 |
-------- |
... | ... | |
398 | 417 |
}, |
399 | 418 |
|
400 | 419 |
|
420 |
Input message, node evacuation:: |
|
421 |
|
|
422 |
"request": { |
|
423 |
"evac_nodes": [ |
|
424 |
"node2" |
|
425 |
], |
|
426 |
"type": "multi-evacuate" |
|
427 |
}, |
|
428 |
|
|
429 |
|
|
401 | 430 |
Response messages |
402 | 431 |
~~~~~~~~~~~~~~~~~ |
403 | 432 |
Successful response message:: |
404 | 433 |
|
405 | 434 |
{ |
406 | 435 |
"info": "Allocation successful", |
407 |
"nodes": [
|
|
436 |
"result": [
|
|
408 | 437 |
"node2.example.com", |
409 | 438 |
"node1.example.com" |
410 | 439 |
], |
... | ... | |
415 | 444 |
|
416 | 445 |
{ |
417 | 446 |
"info": "Can't find a suitable node for position 2 (already selected: node2.example.com)", |
418 |
"nodes": [],
|
|
447 |
"result": [],
|
|
419 | 448 |
"success": false |
420 | 449 |
} |
421 | 450 |
|
451 |
Successful node evacuation message:: |
|
452 |
|
|
453 |
{ |
|
454 |
"info": "Request successful", |
|
455 |
"result": [ |
|
456 |
[ |
|
457 |
"instance1", |
|
458 |
"node3" |
|
459 |
], |
|
460 |
[ |
|
461 |
"instance2", |
|
462 |
"node1" |
|
463 |
] |
|
464 |
], |
|
465 |
"success": true |
|
466 |
} |
|
467 |
|
|
468 |
|
|
422 | 469 |
Command line messages |
423 | 470 |
~~~~~~~~~~~~~~~~~~~~~ |
424 | 471 |
:: |
... | ... | |
437 | 484 |
Can't compute nodes using iallocator 'dumb-allocator': Can't find a suitable node for position 2 (already selected: node1.example.com) |
438 | 485 |
|
439 | 486 |
.. vim: set textwidth=72 : |
487 |
.. Local Variables: |
|
488 |
.. mode: rst |
|
489 |
.. fill-column: 72 |
|
490 |
.. End: |
Also available in: Unified diff